Putting It Together: Lab 1
- Lab 1 gives you a small vulnerable binary with a stack buffer and a hidden "win" function.
- Your workflow uses everything from today:
checksecthe binary (expect NX on, no canary, no PIE).- In GDB/pwndbg, find the offset from your buffer to the saved return address (use
cyclic). info functions/elf.symbolsto get the win address.- Build
b'A'*offset + p64(win_addr)with pwntools. - Send it, watch
retjump to win, get the flag.
Key Takeaway
You now understand the target (saved RIP), the mechanism (call/ret), the encoding (little-endian p64), and the tools (GDB, checksec, pwntools).