A buffer overflow occurs when an attacker writes more data into a memory buffer than it can hold. This excess data overflows into adjacent memory, potentially altering the program's behavior.
8 bytes
of input.Attackers probe applications to find areas vulnerable to buffer overflows. Once found, they try to:
⚠️ Exploiting buffer overflows is not trivial. Incorrect attempts may crash the system or application. The attacker’s goal is to find a repeatable and advantageous overflow.
1979
.< 2000
: guest/user access.≥ 24000
: administrator access.Although Variable B is not editable via the application, Variable A has a buffer overflow vulnerability. Writing 9 bytes to Variable A causes:
The attacker writes the word "excessive"
(9 characters) into Variable A:
0x65
, decimal 101
) → overflows into Variable B.
The overflow changes Variable B’s value to 25,856
, which grants administrator access.
This example demonstrates how a crafted buffer overflow can: