gipu/polictf/server/exploit-test.py

17 lines
500 B
Python
Raw Normal View History

from pwn import *
import subprocess
key_re = re.compile(".*\"(.*)\".*")
2017-07-08 10:35:56 +01:00
r = remote("pasticciotto.chall.polictf.it", 31337)
first = r.recv()
key = key_re.match(first).group(1)
print("Using key: {}".format(key))
subprocess.check_call(["python3", "../../assembler/assembler.py", "{}".format(key), "../asms/decrypt.pstc", "./out.pasticciotto"])
with open("./out.pasticciotto") as f:
data = f.read()
r.send("{}\n".format(len(data)))
print(r.recv())
r.send("{}\n".format(data))
2017-07-08 10:35:56 +01:00
print(r.recv(100000))