This repository contains stack-based buffer overflow exploits that demonstrate bypassing modern security protections such as NX bit, ASLR, and StackGuard. These exploits manipulate the stack to execute arbitrary code, effectively overcoming memory protection mechanisms.
Note: Unfortunately, the original writeup for these exploits was lost. At the time of creation, ASLR was not randomizing libc, as can be seen in this Ubuntu bug report. This issue significantly impacted the effectiveness of ASLR during the exploit development process.
-
NX Bit (No eXecute Bit): The exploit bypasses the protection that marks memory regions as non-executable, forcing the execution of shellcode.
-
ASLR (Address Space Layout Randomization): The exploit takes advantage of a vulnerability where libc addresses are not randomized as expected, making it easier to predict memory locations.
-
StackGuard: The exploit circumvents the protection that inserts "canaries" into the stack, which are used to detect buffer overflows.
The exploit relies on carefully crafting a buffer overflow to overwrite return addresses, function pointers, or other critical data on the stack. This allows for arbitrary code execution, bypassing protections like NX, ASLR, and StackGuard.
-
NX Bypass: Overwrites the return address with a pointer to a buffer containing shellcode, enabling execution.
-
ASLR Bypass: At the time of creation, ASLR was not fully randomizing libc memory locations. As a result, attackers could predict addresses in libc and craft reliable exploits.
-
StackGuard Bypass: Overwrites the canary value, preventing the stack protector from detecting the overflow.
-
ASLR Vulnerability: The effectiveness of ASLR was compromised due to improper randomization of the libc library at the time of creating these exploits. This may not be the case on newer systems where ASLR is functioning as intended.
-
Security Implications: These exploits highlight the weaknesses in certain memory protection techniques when improperly configured or implemented. While NX, ASLR, and StackGuard are all valuable tools in modern security, their implementation must be robust and correctly configured to be effective.
This repository is for educational purposes only. It should not be used for malicious intent. The intention is to demonstrate how attackers can bypass certain protections and to educate on the importance of proper security configurations.