Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- import hashlib
- import sys
- from pwn import *
- memory = dict()
- global i
- i= 0
- def decode(target) -> int:
- global i
- print("Decoding:\t", target)
- output = memory.get(target, -1)
- while output < 0:
- h = hashlib.sha1(str(i).encode('ascii')).hexdigest()
- memory[ h[-6:] ] = i
- if h.endswith(target):
- output = i
- #print(i, "\t", h, "\t", h[-6:], "\tTarget:", target)
- i += 1
- output = str(str(output)+"\n")
- print("Decoded: ", output)
- return bytes(output, encoding='utf8')
- while True:
- p = remote("rabbit.challs.olicyber.it", 10501)
- print(p.recvline())
- print(p.recvline())
- print(p.recvline())
- #Execute: python3 proof.py 9b2d6c
- output = p.recvline()
- print(output)
- hash = str(output)[-9:-3]
- print("\t Hash:", hash)
- key = decode(hash)
- print("\t Key:", key)
- p.sendline(key)
- p.interactive()
Add Comment
Please, Sign In to add comment