How jailctf/how2python works
Project type and purpose
• This is an open-source research tool / exploit PoC repository for tracking and demonstrating Python memory-corruption bugs.
• There is no “frontend” or “backend” in the traditional sense—rather a collection of standalone Python scripts under a single bugs/ directory, each targeting a specific bug in CPython.
File structure
• Top level:
• .gitignore
• README.md (project description, Python version notes, bug table)
• bugs/ directory containing one .py per bug pattern
• No build scripts, no external services, no configuration files beyond standard Git and Python.
• Each script is a minimal PoC: import one or more stdlib modules, trigger a bug, demonstrate arbitrary write.
README for additional insights
• The README defines:
• Supported platforms (Windows, Linux, 64-bit)
• Target Python versions (>=3.13.0, notes on 3.14 compatibility)
• A table listing bugs, their introduction version, patch status, and whether a PoC exists
a. Main components
• Developer / Security researcher (user of the repo)
• GitHub repository (version control)
• Local filesystem containing:
– README.md & metadata
– bugs/ folder with PoC scripts
• Python interpreter (CPython runtime)
• Operating system (Windows/Linux, 64-bit)
• Standard library modules under test (e.g., bytearray, itertools, decimal)
b. Relationships & interactions
• User ↔ GitHub repo: clone / pull / push
• User → local bugs/*.py: selects and runs a PoC via python bug_x.py
• PoC script → CPython runtime: imports stdlib module(s), triggers bug in C code
• CPython runtime → OS memory subsystem: corrupts memory, prints results
• Feedback loop: developer examines output, crafts new PoCs
c. Architectural patterns / design principles
• Modular: one script per bug, easy to add new exploits
• Declarative metadata in README: versioning, patch status, links
• Git‐centric workflow: track issues via GitHub Issues / PRs
d. Key technologies & libraries
• Python 3.13.x (and 3.14 preview)
• Standard library modules under test
• Git / GitHub for collaboration
Detailed capture of architectural elements
• README.md as the project’s metadata hub