17 lines
500 B
Python
17 lines
500 B
Python
from pwn import *
|
|
import subprocess
|
|
|
|
key_re = re.compile(".*\"(.*)\".*")
|
|
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))
|
|
print(r.recv(100000))
|