mirror of
https://github.com/KnugiHK/WhatsApp-Chat-Exporter.git
synced 2026-04-27 08:21:33 +00:00
Update bruteforce_crypt15.py
This commit is contained in:
@@ -26,24 +26,24 @@ def _extract_encrypted_key(keyfile):
|
|||||||
|
|
||||||
return _generate_hmac_of_hmac(key_stream)
|
return _generate_hmac_of_hmac(key_stream)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
key = open("encrypted_backup.key", "rb").read()
|
||||||
|
database = open("wa.db.crypt15", "rb").read()
|
||||||
|
main_key, hex_key = _extract_encrypted_key(key)
|
||||||
|
for i in range(100):
|
||||||
|
iv = database[i:i+16]
|
||||||
|
for j in range(100):
|
||||||
|
cipher = AES.new(main_key, AES.MODE_GCM, iv)
|
||||||
|
db_ciphertext = database[j:]
|
||||||
|
db_compressed = cipher.decrypt(db_ciphertext)
|
||||||
|
try:
|
||||||
|
db = zlib.decompress(db_compressed)
|
||||||
|
except zlib.error:
|
||||||
|
...
|
||||||
|
else:
|
||||||
|
if db[0:6] == b"SQLite":
|
||||||
|
print(f"Found!\nIV: {i}\nOffset: {j}")
|
||||||
|
print(db_compressed[:10])
|
||||||
|
exit()
|
||||||
|
|
||||||
key = open("encrypted_backup.key", "rb").read()
|
print("Not found! Try to increase maximum search.")
|
||||||
database = open("wa.db.crypt15", "rb").read()
|
|
||||||
main_key, hex_key = _extract_encrypted_key(key)
|
|
||||||
for i in range(100):
|
|
||||||
iv = database[i:i+16]
|
|
||||||
for j in range(100):
|
|
||||||
cipher = AES.new(main_key, AES.MODE_GCM, iv)
|
|
||||||
db_ciphertext = database[j:]
|
|
||||||
db_compressed = cipher.decrypt(db_ciphertext)
|
|
||||||
try:
|
|
||||||
db = zlib.decompress(db_compressed)
|
|
||||||
except zlib.error:
|
|
||||||
...
|
|
||||||
else:
|
|
||||||
if db[0:6] == b"SQLite":
|
|
||||||
print(f"Found!\nIV: {i}\nOffset: {j}")
|
|
||||||
print(db_compressed[:10])
|
|
||||||
exit()
|
|
||||||
|
|
||||||
print("Not found! Try to increase maximum search.")
|
|
||||||
|
|||||||
Reference in New Issue
Block a user