#!/usr/bin/python # # Use the Serial Number output from wpscan # ./serial2key.py 1011TSABC # # By h3mp3r 2012-02-06 # Based on a script from Hubert Seiwert, hubert.seiwert@nccgroup.com 2008-04-17 # import sys import hashlib serial = sys.argv[1] def ascii2hex(char): return hex(ord(char))[2:] print 'Key for Serial Number: CP%s' % serial sn = 'CP%s%s%s%s' % (serial[0:4],ascii2hex(serial[6]),ascii2hex(serial[7]),ascii2hex(serial[8])) hash = hashlib.sha1(sn.upper()).hexdigest() print hash[0:10].upper()