Binary exploitation (pwn) workshop materials for HTB Meetup.
This repository contains hands-on challenges and a mini-CTF for learning buffer overflow exploitation on both x86 (32-bit) and x64 (64-bit) architectures.
├── docs/ # Workshop materials
│ ├── preparation.md/pdf # Setup guide for attendees
│ └── slides.md/pdf # Presentation slides
│
├── handson/ # Guided practice challenges
│ ├── x64/ # 64-bit ret2win challenge
│ └── x86/ # 32-bit ret2win challenge
│
├── mini-ctf/ # CTF-style challenges (Docker-based)
│ ├── x64/ # 64-bit challenge with hidden flag
│ └── x86/ # 32-bit challenge with hidden flag
│
└── scripts/ # Helper scripts
└── install-tools.sh # Install required tools on Kali
Simple ret2win challenges to practice the basics:
- Overflow a buffer to overwrite the return address
- Redirect execution to a
win()function that prints the flag
More realistic challenges running in Docker containers:
- Find and exploit the buffer overflow vulnerability
- Call a hidden
get_flag()function to readflag.txt
- GCC with multilib support
- Python 3 with pwntools
- Docker & Docker Compose (for mini-CTF)
- GDB with pwndbg
- Ghidra for reverse engineering
Kali Linux users: Run
scripts/install-tools.shto install all required tools.
# Build challenges
cd handons && ./build.sh
cd mini-ctf && docker-compose up -d
# Try the x64 hands-on
cd handons/x64
./challenge
python solve.py- Understanding stack-based buffer overflows
- Finding offsets to overwrite return addresses
- Using pwntools for exploit development
- x86 vs x64 calling conventions and stack alignment
A detailed writeup for these challenges is available at: HTB Meetup IIUM 2025 - Intro to PWN