05 - CTF Tooling and Environment Setup π οΈ
A well-configured environment is half the battle in a CTF. You need a dedicated Linux VM equipped with offensive tooling.
π§ The Base Environmentβ
While Kali Linux and Parrot OS come pre-installed with many tools, many top-tier CTF players prefer a clean Ubuntu VM and install only what they need.
Essential Packagesβ
sudo apt update
sudo apt install -y build-essential python3 python3-pip git wget curl gdb ncat docker.io docker-compose jq
π₯ Pwn & Rev Toolingβ
1. Pwntoolsβ
The core library for exploit development.
pip3 install pwntools
2. GDB & Pwndbgβ
Vanilla GDB is difficult to use. Pwndbg adds a clean interface, memory visualization, and exploit-specific commands.
git clone https://github.com/pwndbg/pwndbg
cd pwndbg
./setup.sh
3. Ghidraβ
For reverse engineering. Requires Java.
sudo apt install default-jdk
wget https://github.com/NationalSecurityAgency/ghidra/releases/download/Ghidra_10.3_build/ghidra_10.3_PUBLIC_20230510.zip
unzip ghidra_10.3_PUBLIC_20230510.zip
./ghidraRun
πΈοΈ Web Toolingβ
1. Burp Suite Community Editionβ
The ultimate web proxy. Download from PortSwigger. Use it to intercept, modify, and replay HTTP requests.
2. Dirsearch / Gobusterβ
For directory and file fuzzing.
sudo apt install gobuster
gobuster dir -u http://target.com -w /usr/share/wordlists/dirb/common.txt
π¨ CyberChef (Offline)β
CyberChef (the "Cyber Swiss Army Knife") is a web app for decoding, encrypting, and parsing data. In some CTFs, internet access is restricted, so hosting it locally is crucial.
Local Docker Deployment:
docker run -d -p 8000:8000 mpepping/cyberchef
Access at http://localhost:8000.
π³ Dockerized Challenge Deploymentβ
Many CTF challenges are distributed as Docker containers so you can debug them locally before attacking the remote server.
Example docker-compose.yml for a CTF Challenge:
version: '3.3'
services:
web-challenge:
build: .
ports:
- "5000:5000"
environment:
- FLAG=flag{local_docker_test_flag}
read_only: true
Running the Challenge:
# Build and start the challenge
docker-compose up --build -d
# Check logs for errors
docker-compose logs -f
# Stop and remove the challenge
docker-compose down