MCPcopy
hub / github.com/Gallopsled/pwntools

github.com/Gallopsled/pwntools @4.15.0 sqlite

repository ↗ · DeepWiki ↗ · release 4.15.0 ↗
1,930 symbols 7,087 edges 224 files 892 documented · 46%
README

pwntools - CTF toolkit

pwntools logo

PyPI Docs GitHub Workflow Status (dev) Coveralls MIT License Packaging status Discord Twitter

Pwntools is a CTF framework and exploit development library. Written in Python, it is designed for rapid prototyping and development, and intended to make exploit writing as simple as possible.

from pwn import *
context(arch = 'i386', os = 'linux')

r = remote('exploitme.example.com', 31337)
# EXPLOIT CODE GOES HERE
r.send(asm(shellcraft.sh()))
r.interactive()

Documentation

Our documentation is available at docs.pwntools.com

A series of tutorials is also available online

To get you started, we've provided some example solutions for past CTF challenges in our write-ups repository.

Installation

Pwntools is best supported on 64-bit Ubuntu LTS releases (18.04, 20.04, 22.04, and 24.04). Most functionality should work on any Posix-like distribution (Debian, Arch, FreeBSD, OSX, etc.).

Python3 is suggested, but Pwntools still works with Python 2.7. Most of the functionality of pwntools is self-contained and Python-only. You should be able to get running quickly with

sudo apt-get update
sudo apt-get install python3 python3-pip python3-dev git libssl-dev libffi-dev build-essential
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade pwntools

However, some of the features (assembling/disassembling foreign architectures) require non-Python dependencies. For more information, see the complete installation instructions here.

Contribution

See CONTRIBUTING.md

Contact and Community

If you have any questions not worthy of a bug report, join the Discord server at https://discord.gg/96VA2zvjCB

Core symbols most depended-on inside this repo

error
called by 213
pwnlib/log.py
append
called by 187
pwnlib/term/term.py
get
called by 87
pwnlib/term/text.py
items
called by 78
pwnlib/context/__init__.py
warn_once
called by 60
pwnlib/log.py
format
called by 60
pwnlib/log.py
read
called by 60
pwnlib/elf/elf.py
info
called by 53
pwnlib/log.py

Shape

Method 1,143
Function 590
Class 196
Route 1

Languages

Python100%

Modules by API surface

pwnlib/elf/elf.py104 symbols
pwnlib/context/__init__.py99 symbols
pwnlib/adb/adb.py91 symbols
pwnlib/tubes/ssh.py88 symbols
pwnlib/tubes/tube.py77 symbols
pwnlib/filesystem/ssh.py72 symbols
pwnlib/elf/corefile.py56 symbols
pwnlib/protocols/adb/__init__.py50 symbols
pwnlib/elf/datatypes.py50 symbols
pwnlib/log.py49 symbols
pwnlib/rop/rop.py46 symbols
pwnlib/tubes/process.py43 symbols

Dependencies from manifests, versioned

capstone3.0.5rc2 · 1×
docutils0.18 · 1×
intervaltree3.0 · 1×
mako1.0.0 · 1×
packaging
paramiko1.15.2 · 1×
pip6.0.8 · 1×
psutil3.3.0 · 1×
pyelftools0.29 · 1×
pygments2.0 · 1×
pyserial2.7 · 1×
pysocks

For agents

$ claude mcp add pwntools \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact