2017-05-29 16:55:36 +01:00
|
|
|
from pwn import *
|
|
|
|
import subprocess
|
|
|
|
|
|
|
|
key_re = re.compile(".*\"(.*)\".*")
|
2017-07-08 10:35:56 +01:00
|
|
|
r = remote("pasticciotto.chall.polictf.it", 31337)
|
2017-05-29 16:55:36 +01:00
|
|
|
|
|
|
|
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))
|