RainFall is a binary exploitation wargame that focuses on teaching various memory corruption vulnerabilities and exploitation techniques. This repository contains detailed writeups and solutions for all levels of the RainFall challenge.
rainfall/
├── README.md # This file
├── binaries/ # contain the binaries of all the levels
├── level0-9/
├── writeup.md # Detailed solutions for this level
├── flag # The flag of this level
├── source.c # decompiled binary
- Technique: Classic stack buffer overflow
- Objective: Overwrite return address to execute system("/bin/sh")
- Key Concepts: Stack layout, return address control, function arguments
- Technique: Heap-based shellcode execution
- Objective: Bypass stack execution prevention using heap
- Key Concepts: NX bit bypass, heap memory layout, shellcode injection
- Technique: Format string attack to overwrite global variable
- Objective: Change global variable value to trigger shell
- Key Concepts: Format string vulnerabilities, %n specifier, memory writes
- Technique: Format string attack with large value
- Objective: Write specific large value to global variable
- Key Concepts: Large value format string writes, padding calculations
- Technique: Global Offset Table manipulation
- Objective: Redirect exit() call to custom function
- Key Concepts: GOT/PLT, function pointer hijacking, multi-byte writes
- Technique: Heap buffer overflow
- Objective: Overwrite function pointer in heap
- Key Concepts: Heap layout, malloc/free, function pointer control
- Technique: Complex heap manipulation
- Objective: Multi-stage overflow to control execution flow
- Key Concepts: Heap chunk manipulation, pointer arithmetic, staged attacks
- GDB: GNU Debugger for analysis and exploitation
- Python: For payload generation and automation
- readelf: For binary analysis and GOT/PLT inspection
- objdump: For disassembly and code analysis
Most RainFall binaries have minimal protections:
- RELRO: Disabled
- Stack Canaries: Disabled
- NX Bit: Varies by level
- PIE: Disabled
- ASLR: Disabled
- Stack-based overflows to control return addresses
- Heap-based overflows to corrupt metadata
- Arbitrary memory reads and writes
- GOT/PLT manipulation
- Global variable modification
- Bypassing execution prevention
- Code reuse attacks
- Heap layout manipulation
- Function pointer overwrites
- Chunk corruption
The information provided in this repository is for educational and research purposes only. Users are responsible for ensuring they have proper authorization before testing these techniques on any systems.
