Binary exploitation
Stack buffer overflow
Writing past a fixed stack buffer until the write reaches the function's saved return address, then choosing where the function returns to.
A stack buffer overflow is a write that runs past a fixed-size buffer on the stack and overwrites the function's
saved return address, stored just above it. It happens when input is copied without a length check (gets,
strcpy). Whoever controls that address chooses where the function returns; ret2win points it at a function
already in the binary. Defences: a stack canary, ASLR/PIE, and a non-executable stack.
Read next
- Memory disclosure Making a program hand back memory it never meant to reveal — classically through a format string built from untrusted input.
- Privilege escalation Turning a limited login on a host into full control, by abusing one thing the system was left doing wrong.
- Setuid and setgid A permission bit that makes a program run as its owner, not as whoever started it — safe on a few tools, dangerous on one that runs other commands.