Pbaeg: combine-vulnerabilities AEG to defeat protection mechanisms

Yu Wang, Zhoujun Li, Yipeng ZhangCybersecurity 2025 · DOI

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:

  1. Dual-Pronged Detection: It uses "Hooking" to monitor dangerous functions (read, gets, printf) and a "General Detection Strategy" that monitors the ret instruction. If the instruction pointer (rip) becomes "symbolic" (controllable by user input), PBAEG flags an exploitable state.
  2. 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.
  3. Dynamic Payload Element Strategy: PBAEG marks parts of its exploit payload with attributes (like elf_base or Canary). When the exploit is finalized, these placeholders are dynamically replaced with the actual values leaked during execution.
  4. 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, and crashmail.
  • 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

Abstract

Abstract Automatic exploit generation (AEG) refers to the process of automatically finding the path in the program that can trigger vulnerabilities and generate exploits. Typically, the process of finding vulnerabilities requires fuzzing and symbolic execution techniques. The existing AEG usually sets the preset environment ideally, which does not enable all protection mechanisms. This environment is not universally applicable in actual attacks. In the newest version of GCC, the default compilation configuration has enabled all protection mechanisms. In response to this situation, we propose an exploit generation system Protection Bypass Automatic Exploit Generator (PBAEG) which automatically detects some types of stack overflow vulnerabilities and format string vulnerabilities. Then PBAEG combines the above two vulnerabilities to generate exploits. PBAEG uses symbolic execution and dynamic binary analysis to find the above two vulnerabilities, adopts different exploit generation strategies for different protection mechanisms, and defeats Non-Executable, Position-Independent Executable, Canary, and Address Space Layout Randomization (ASLR) protection mechanisms. At the same time, for some difficult-to-exploit situations, advanced stack overflow exploitation methods are applied to generate exploits. Finally, we also use docker to simulate the remote environment to test the ability of PBAEG to attack the remote environment. Experiments show that PBAEG can complete the vulnerability detection and exploitation generation of 124 binary files, 22 capture-the-flag binary files, and 10 public software, which takes a shorter time than the existing AEG and covers more types of vulnerabilities. PBAEG adopts more vulnerability exploitation techniques, can generate exploits in the form of files by using pwntools, and successfully verifies the exploitations generated in the remote simulation environment.
BibTeX
@inproceedings{wang2025pbaeg,
  author = {Yu Wang and Zhoujun Li and Yipeng Zhang},
  title = {{Pbaeg: combine-vulnerabilities AEG to defeat protection mechanisms}},
  booktitle = {Cybersecurity},
  year = {2025},
  doi = {10.1186/s42400-024-00322-9},
}
Figure