This is the CTF framework used by Gallopsled in every CTF.
Most code is inside the pwnlib
folder with some functionality inside pwn
or
bin
. It is typically used as:
from pwn import *
context(arch = 'i386', os = 'linux')
# EXPLOIT HERE
However we have made command-line frontends for some of the functionality
in pwnlib
. These are:
asm
/disasm
: Small wrapper for various assemblers.constgrep
: Tool for finding constants defined in header files.cyclic
: De Bruijn sequence generator and lookup tool.hex
/unhex
: Command line tools for doing common hexing/unhexing operations.shellcraft
: Frontend to our shellcode.phd
: Replacement forhexdump
with colors.
Our documentation is available at http://docs.pwntools.com
To get you started, we've provided some example solutions for past CTF challenges in our write-ups repository.
pwntools is best supported on Ubuntu 12.04 and 14.04, but most functionality should work on any Posix-like distribution (Debian, Arch, FreeBSD, OSX, etc.).
In order to get the most out of pwntools
, you should have the following system libraries installed.
- binutils for your target architecture (Ubuntu)
- libcapstone 2.1 (Ubuntu i386 amd64)
- Python development headers (
python-dev
)
Pwntools is available as a pip
packag for easy installation.
apt-get install python2.7 python2.7-dev python-pip
pip install pwntools
You can also use the version from github.
git clone https://github.com/Gallopsled/pwntools
cd pwntools
python setup.py install
If you'd like to hack on pwntools, this is how we set things up:
git clone https://github.com/Gallopsled/pwntools
PWN=$(realpath pwntools)
cd $PWN
pip2 install -r requirements.txt
export PATH="$PWN/bin:$PATH"
export PYTHONPATH="$PWN:$PYTHONPATH"
If you want to make these settings permanent:
>>~/.bashrc cat <<EOF
# Set up path for Pwntools
export PATH="$PWN/bin:\$PATH"
export PYTHONPATH="$PWN:\$PYTHONPATH"
EOF
If you have any questions not worthy of a bug report, feel free to join us
at #gallopsled
on Freenode and ask away.
Click here to connect.