27 lines
733 B
Python
27 lines
733 B
Python
|
from hackingscripts import util
|
||
|
from mersenne import BreakerPy
|
||
|
from Crypto.Util.number import long_to_bytes
|
||
|
|
||
|
files = {}
|
||
|
def read_file(path):
|
||
|
with open(path, "rb") as f:
|
||
|
data = f.read()
|
||
|
files[path] = data
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
for file in ["memes/a.jpg", "memes/b.jpeg", "memes/c.jpg", "backup/a.jpg"]:
|
||
|
read_file(file)
|
||
|
|
||
|
key = util.xor(files["backup/a.jpg"], files["memes/a.jpg"])
|
||
|
key = [int.from_bytes(key[i:i+4], "big") for i in range(0, len(key), 4)]
|
||
|
key = key[0:624]
|
||
|
|
||
|
breaker = BreakerPy()
|
||
|
seed_arr = breaker.get_seeds_python_fast(key)
|
||
|
seed = breaker.array_to_int(seed_arr)
|
||
|
|
||
|
print("[+] Recovered Seed:", seed)
|
||
|
print("[+] Flag:", long_to_bytes(seed).decode())
|
||
|
|
||
|
|