{"library":"pwntools","title":"Pwntools","description":"Pwntools is a CTF (Capture The Flag) framework and exploit development library for Python. It provides a comprehensive set of tools for writing exploits, interacting with binaries and remote services, performing assembly/disassembly, ROP chain generation, and much more. The current version is 4.15.0, and it maintains an active release cadence.","language":"python","status":"active","last_verified":"Mon May 18","install":{"commands":["pip install pwntools"],"cli":{"name":"pwntools","version":"sh: 1: pwntools: not found"}},"imports":["from pwn import *","from pwn import remote","from pwn import process","from pwn import ELF","from pwn import ROP","from pwn import asm","from pwn import log"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from pwn import *\n\n# Configure global context for architecture and OS (important for assembly/disassembly, packing)\ncontext.arch = 'amd64' # Example: ARM, i386, amd64\ncontext.os = 'linux'  # Example: windows, freebsd\ncontext.log_level = 'info' # Debug, info, warn, error, critical\n\n# --- Example: Interact with a remote service ---\n# Replace with the actual challenge host and port\nHOST = 'challenge.example.com'\nPORT = 1337\n\ntry:\n    log.info(f\"Connecting to {HOST}:{PORT}...\")\n    # Establish a connection to the remote service\n    io = remote(HOST, PORT)\n    log.success(\"Connected!\")\n\n    # Receive initial data (e.g., a banner)\n    banner = io.recvline()\n    log.info(f\"Received banner: {banner.decode(errors='ignore').strip()}\")\n\n    # Send some input (e.g., a simple payload for a buffer overflow)\n    # pwntools handles bytes automatically for send/recv\n    payload = b'A' * 72 + p64(0xdeadbeef) # 72 bytes of 'A', then an 8-byte address\n    io.sendline(payload)\n    log.info(f\"Sent payload: {payload!r}\")\n\n    # Receive the response after sending data\n    response = io.recvall()\n    log.info(f\"Received full response: {response.decode(errors='ignore').strip()}\")\n\n    io.close()\n    log.success(\"Connection closed.\")\n\nexcept PwnlibException as e:\n    log.error(f\"Pwntools error: {e}\")\nexcept Exception as e:\n    log.error(f\"General error: {e}\")\n","lang":"python","description":"This quickstart demonstrates how to connect to a remote service, send data (e.g., a simple buffer overflow payload using `p64` for packing), and receive responses. It highlights setting `context.arch` and `context.os`, which are crucial for correct behavior in many pwntools operations. Replace `HOST` and `PORT` with your target challenge details.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-18","installed_version":"4.15.0","pypi_latest":"4.15.0","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":8.9,"avg_import_s":0.6,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"pwntools","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":0.54,"mem_mb":15.8,"disk_size":"221.1M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"pwntools","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":8.9,"import_time_s":0.4,"mem_mb":15.8,"disk_size":"228M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"pwntools","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":0.73,"mem_mb":17.7,"disk_size":"229.0M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"pwntools","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":8.7,"import_time_s":0.72,"mem_mb":17.7,"disk_size":"236M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"pwntools","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":0.71,"mem_mb":17.3,"disk_size":"219.4M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"pwntools","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":8,"import_time_s":0.71,"mem_mb":17.3,"disk_size":"227M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"pwntools","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":0.61,"mem_mb":16.9,"disk_size":"219.2M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"pwntools","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":8,"import_time_s":0.68,"mem_mb":16.9,"disk_size":"227M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"pwntools","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":0.47,"mem_mb":14.9,"disk_size":"221.0M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"pwntools","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":10.8,"import_time_s":0.47,"mem_mb":14.9,"disk_size":"228M"}]}}