Educational Heap Exploitation
A comprehensive repository for learning heap exploitation techniques with working C examples, verified to work on Ubuntu’s glibc releases from version 2.23 through 2.41.
What is how2heap?
how2heap is an educational repository designed to teach various heap exploitation techniques through practical, working examples. Each technique is implemented in C and verified to work on corresponding Ubuntu releases, making it an invaluable resource for security researchers, CTF players, and anyone interested in understanding heap exploitation. The project was created during a hack meeting and has grown to include over 40 different techniques, with version-specific implementations spanning glibc versions 2.23 through 2.41.Key Features
40+ Techniques
Comprehensive collection of heap exploitation techniques with working C implementations
Multi-Version Support
Version-specific implementations for glibc 2.23 through 2.41
Interactive Playground
malloc_playground for hands-on experimentation with heap operations
CTF References
Real-world CTF challenge references and links to writeups
Debug Integration
Browser-based debugging support via Ret2 Wargames for many techniques
Docker Support
Both Docker and native compilation methods supported
Technique Categories
how2heap organizes techniques into several categories:Fastbin Techniques
Exploits targeting the fastbin freelist mechanism, including double-free attacks and arbitrary pointer techniques.Tcache Techniques
Modern exploitation techniques targeting the thread-local cache introduced in glibc 2.26.House Techniques
A collection of classic and modern “House of X” exploitation techniques, each providing different primitives for gaining control.Bin & Chunk Manipulation
Techniques that manipulate bin freelists and chunk metadata to achieve overlapping allocations or arbitrary writes.Advanced Techniques
Sophisticated exploitation methods including safe-linking bypasses and relative write primitives.Who Is This For?
- Security Researchers learning modern heap exploitation techniques
- CTF Players preparing for binary exploitation challenges
- Students studying memory corruption and exploitation
- Developers understanding heap security and mitigation techniques
Quick Example
Here’s a simple example of the first-fit behavior demonstration:first_fit.c
Get Started
Ready to learn heap exploitation? Here’s how to get started:The quick setup uses your system libc. For version-specific testing, see the Setup Guide for Docker and multi-version compilation instructions.
Community and Resources
- GitHub Repository: shellphish/how2heap
- Interactive Debugging: Ret2 Wargames
- License: MIT License
Next Steps
Quickstart Guide
Get up and running in minutes with practical examples
Heap Basics
Learn the fundamentals of heap memory management
Browse Techniques
Explore all available exploitation techniques
Setup Guide
Configure your environment for multi-version testing
