Quick Setup
The fastest way to get started is with the Quick Setup method, which uses your system’s glibc.1
Install Required Tools
Make sure you have the following packages installed:Also ensure
/usr/bin/python points to your Python binary:2
Clone and Build
Clone the repository and build the base binaries:This builds the base binaries:
malloc_playground, first_fit, and calc_tcache_idx.3
Run Malloc Playground
The malloc playground is an interactive tool to experiment with heap operations:You’ll see a prompt where you can enter commands:
Using Malloc Playground
The malloc playground allows you to allocate, free, and manipulate memory interactively.Basic Commands
Available Commands
The malloc playground tracks up to 20 pointers at once. Use
clearlist to reset and free all allocations.Your First Technique: First Fit
Now let’s run your first heap exploitation technique demo.1
Compile first_fit
The
first_fit example demonstrates glibc’s first-fit allocation behavior:2
Run the Example
Execute the compiled binary:You’ll see output demonstrating how glibc reuses freed chunks:
3
Understand the Technique
The example shows:
- Allocate chunk A (0x512 bytes)
- Allocate chunk B (0x256 bytes)
- Free chunk A
- Allocate chunk C (0x500 bytes) - gets the same address as A!
Exploring Techniques
The repository includes dozens of techniques organized by glibc version:Fastbin Techniques
fastbin_dup- Double free attackfastbin_dup_into_stack- Arbitrary pointerfastbin_dup_consolidate- Bypass checks
Tcache Techniques
tcache_poisoning- Poison tcache entriestcache_dup- Double free in tcachehouse_of_botcake- Advanced tcache exploit
House Techniques
house_of_spirit- Fake fastbin chunkshouse_of_lore- Smallbin exploitationhouse_of_einherjar- Null byte overflow
Advanced
unsafe_unlink- Arbitrary writepoison_null_byte- Single byte overflowlarge_bin_attack- Large bin exploitation
Next Steps
Complete Setup
Configure specific glibc versions using Docker or linker methods
Debugging
Use GDB with heap visualization tools like pwndbg or gef
