Last active
November 24, 2024 19:20
-
-
Save extremecoders-re/1876f9a656761a628855d6c6ac88a39d to your computer and use it in GitHub Desktop.
Script to decrypt TP-Link 3g modem config file [https://www.tp-link.com/en/support/3g/]
This file contains hidden or 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
from Crypto.Cipher import DES | |
import hashlib | |
modem_key = bytearray(b'\x47\x8d\xa5\x0b\xf9\xe3\xd2\xcf') | |
ct = open('/workspace/wr902ac/Huawei-K3771.bin','rb').read() | |
des = DES.new(modem_key, DES.MODE_ECB) | |
pt = des.decrypt(ct) | |
assert pt[0:16] == hashlib.md5(pt[16:]).hexdigest().decode('hex') | |
print pt[16:] | |
Author
extremecoders-re
commented
Aug 13, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment