Buffer overflow
A buffer overflow (or overrun) is a very common and well-known attack vector that is mostly used to "overflow" vulnerable programs. This involves sending a large amount of data, which is handled without proper input validation, causing the program to fail in one of a number of ways. Once this vulnerability has been exploited, it can be used to inject malicious shellcode and take full control of the victim's device. Over the years, buffer-overflow vulnerabilities have also been exploited in the wild to bypass security mechanisms such as antivirus software, both through bypassing antivirus engines and through gaining full control of the target victim machine.
There are two types of buffer overflow vulnerabilities that can be exploited:
- Stack-based buffer overflow
- Heap-based buffer overflow
To keep things simple, we will focus on stack-based buffer overflow, since the goal of this book is to bypass antivirus software and not primarily...