Last active
August 29, 2015 14:01
-
-
Save revolunet/c2fc00696048cada0724 to your computer and use it in GitHub Desktop.
Change ALTAI routers password
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
# -*- encoding: UTF-8 -*- | |
""" | |
Change multiple WiFi routers password quickly | |
""" | |
import requests | |
ROUTER_AUTH = ('altai', 'wag') | |
ROUTERS = { | |
'altai-1': { | |
'host': 'http://192.168.1.40', | |
'mac': '00:19:be:a0:bb:4d' | |
}, | |
'altai-2': { | |
'host': 'http://192.168.1.53', | |
'mac': '00:19:be:a0:bb:4a' | |
} | |
} | |
def update_router_password(host, mac, password): | |
data = { | |
'selAthCphMod' : 259, | |
'radioKeyModDefKey' : 0, | |
'radioselchkvap' : 16, | |
'selKeyLen' : 0, | |
'securityError' : 'OK', | |
'aporstation' : 0, | |
'operationMode' : 0, | |
'auth_mode' : 3, | |
'eap_type' : 0, | |
'station_aumode' : 3, | |
'AP_Wepmod' : 1, | |
'wepKeyIndex' : 0, | |
'usertype' : 0, | |
'vapid' : 0, | |
'x' : 39, | |
'y' : 18, | |
'authMode' : 3, | |
'cipherMode' : 1, | |
'fKeyEntryMethod' : 0, | |
'sDefKey' : 1, | |
'szKey1' : '', | |
'sKsIdx1' : 0, | |
'szKey2' : '', | |
'sKsIdx2' : 0, | |
'szKey3' : '', | |
'sKsIdx3' : 0, | |
'szKey4' : '', | |
'sKsIdx4' : 0, | |
'wpaMode' : 0, | |
'secretMode' : 3, | |
'wpaUserName' : mac, | |
'wpaPPPoEPasswd' : mac, | |
'sGkuInterval' : 3600, | |
'szPassPhrase' : password, | |
'szRadiusServer1' : 0, | |
'szRadiusServer2' : 0, | |
'szRadiusServer3' : 0, | |
'szRadiusServer4' : 0, | |
'sRadiusPort' : 1812, | |
'szRadiusSecret' : '', | |
'szVlanIpAddr1' : '', | |
'szVlanIpAddr2' : '', | |
'szVlanIpAddr3' : '', | |
'szVlanIpAddr4' : '', | |
'szVlanNetMask1' : '', | |
'szVlanNetMask2' : '', | |
'szVlanNetMask3' : '', | |
'szVlanNetMask4' : '', | |
'uselessbutneed' : 1, | |
} | |
print '\t[+] Changement du mot de passe...' | |
r = requests.post(host + '/goform/securityset', auth=ROUTER_AUTH, data=data) | |
if r.status_code==200: | |
print '\t[+] Reboot en cours...' | |
r = requests.get(host + '/rebooting.asp', auth=ROUTER_AUTH) | |
return True | |
return False | |
new_password = '' | |
while len(new_password)<8: | |
new_password = raw_input('Nouveau mot de passe wifi (8 caracteres minimum) : ') | |
for router, config in ROUTERS.items(): | |
print "[+] %s" % router | |
success = update_router_password(config.get('host'), config.get('mac'), new_password) | |
if not success: | |
print "\t[-] ERREUR : Impossible de changer le mot de passe de %s" % router | |
else: | |
print "\t[+] SUCCES : Mot de passe de %s bien mis à jour en '%s'" % (router, new_password) | |
print "TERMINE, attendre 5 minutes le temps de redemarrage" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment