TL;DR
PBAEG (Protection Bypass Automatic Exploit Generator) is a novel framework that automates the creation of functional exploits even when modern security features like ASLR, NX, and Stack Canaries are active. By intelligently combining format string vulnerabilities to leak secrets with stack overflows to hijack control flow, it bridges the gap between theoretical vulnerability research and practical, real-world attacks.
What Problem Does This Paper Address?
Since the DARPA Cyber Grand Challenge in 2016, Automatic Exploit Generation (AEG) has been a major research goal. However, most existing AEG tools operate in "ideal" environments where security protections are disabled.
In the real world, modern compilers like GCC enable a suite of defenses by default:
- NX (Non-Executable): Prevents executing code from the stack.
- ASLR & PIE: Randomize memory addresses, making it hard to know where to jump.
- Stack Canaries: Small "secret" values placed on the stack to detect overflows.
If any of these are active, a standard stack overflow exploit usually fails. This paper addresses the lack of AEG tools capable of bypassing these combined defenses automatically, especially in complex scenarios where a single vulnerability isn't enough to achieve a "shell."
Methods
The authors introduce PBAEG, which uses a mix of symbolic execution (via the Angr framework) and dynamic binary analysis. Its workflow consists of several novel stages:
- Dual-Pronged Detection: It uses "Hooking" to monitor dangerous functions (
read,gets,printf) and a "General Detection Strategy" that monitors theretinstruction. If the instruction pointer (rip) becomes "symbolic" (controllable by user input), PBAEG flags an exploitable state. - Vulnerability Synergy: This is the core innovation. If PBAEG finds a format string bug, it uses it to leak the Stack Canary or the base memory addresses. It then feeds this information into a second stage to craft a stack overflow exploit that "knows" the secrets required to bypass protections.
- Dynamic Payload Element Strategy: PBAEG marks parts of its exploit payload with attributes (like
elf_baseorCanary). When the exploit is finalized, these placeholders are dynamically replaced with the actual values leaked during execution. - Advanced ROP Techniques: To handle "difficult" binaries, it implements Return-Oriented Programming (ROP) variants like
ret-to-libc,ret-to-dl_resolve, and stack pivoting (used when the available overflow space is too small for a full attack chain).
Datasets
The authors evaluated PBAEG against a diverse set of targets:
- Self-defined Benchmark: 124 binary files with varying combinations of protections and vulnerabilities.
- CTF Benchmark: 22 binaries from real-world Capture The Flag competitions (e.g., DEFCON quals).
- Public Software: 10 real-world programs with known CVEs or Exploit-DB entries, including
abc2mtex,pms, andcrashmail. - Comparative Baseline: They compared PBAEG against three other modern AEG tools: Zeratool, BofAEG, and AngErza.
Key Insights and Ideas
- Vulnerabilities are better together: The most significant "aha" moment is that a "low-impact" format string leak is the perfect key to unlock a "high-impact" stack overflow. By chaining them, PBAEG defeats defenses that stop each vulnerability individually.
- Moving Beyond "Ideal" Environments: The paper argues that AEG research must stop assuming protections are off. By targeting the default configurations of modern GCC, the authors make their tool relevant to actual software security.
- Symbolic Execution for "Controllability": Instead of just looking for crashes (like a fuzzer), PBAEG looks for symbolic instruction pointers. This allows it to identify vulnerabilities that might not cause an immediate crash but allow for total system hijack.
Key Results
- High Success Rate: PBAEG successfully generated exploits for all 124 custom binaries, including 26 that had every protection mechanism (NX, ASLR, PIE, Canary) enabled.
- Superiority over Competitors: In head-to-head tests, PBAEG significantly outperformed Zeratool and BofAEG, which struggled with 32-bit binaries, static linking, or complex protection combinations.
- Zero-Day Discovery: While testing the public software
abc2mtex 1.6.1, PBAEG discovered a new vulnerable path that was not documented in existing CVEs. - Efficiency: PBAEG was generally faster than other tools because it uses aggressive state pruning to avoid the "path explosion" problem common in symbolic execution.
Limitations and Future Work
- Path Explosion: While optimized, very large and complex binaries can still cause the symbolic execution engine to run out of memory or time.
- Heap Vulnerabilities: Currently, PBAEG focuses on the stack. It does not yet handle heap-based attacks like Use-After-Free (UAF) or heap overflows, though the authors plan to add this.
- Stripped Binaries: Statically linked binaries that have been "stripped" of symbols are harder for the tool to analyze, as it relies on identifying library functions to improve efficiency.
- Future Direction: The authors suggest integrating PBAEG with grey-box fuzzing to find crash states in massive programs, then using their current symbolic logic to turn those crashes into functional exploits.
Summary updated