Skip to content
udonsari0101Public

About

Self-hosted AI-assisted workspace for Jeopardy-style CTF challenges, with CTFd sync, solver sessions, files, flags, and write-ups.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

CTF Agent icon

CTF Agent

Built for Jeopardy-style CTF challenges: analyze, find flags, and document solutions. Continuous-score King of the Hill arenas are outside the automated solve and submission workflow.

A workspace for CTF challenges, solver sessions, files, flags, and write-ups.

Download · Windows installation · Documentation · 한국어

Challenge board with synthetic example data

The screenshots use synthetic challenges and account data.

Features

  • Keep each CTF in a separate workspace. Save a CTFd site and API token or username/password in workspace settings, then reuse that connection for import and optional flag submission; imports can also use new credentials for a single session. Add challenges manually or import selected challenges from CTFd; sync new or changed challenges later. Import recognizes unambiguous service addresses in the challenge description as well as CTFd's connection field. Link related challenges by ID, including challenges with duplicate names.
  • When adding a challenge, use + Solver configuration to create up to 12 independent challenges at once, each with its own Codex account, model, reasoning level, speed tier, and subagent setting. The same configurations can be used to clone an existing challenge. Select cards with Ctrl/Cmd-click or a Shift-click range, then stop active solves or move stopped challenges to the trash in bulk. Cloned challenges run independently; verified observations can be sent to a sibling job when needed.
  • Inspect clone groups, move or separate individual members, and restore deleted challenges from the workspace trash. A clone's write-up keeps the original challenge title even if the clone is renamed.
  • Connect Codex and Claude Code through account sign-in or an API key. Rename registered agents, choose the account, model, and reasoning level per challenge, and see remaining quota when supported by the account connection, live solve time, session activity, and child agents.
  • Send instructions during a solve. On retry, a compatible provider session can resume directly. Switching between Codex and Claude Code carries available work files and bounded analysis notes into a new session; if a run stops before it writes notes, a bounded summary of its recorded activity supplies the retry context.
  • Upload multiple files, including large binaries with resumable transfers. Stage files in a workspace before challenge details are available, then attach them to one or more challenges. CTFd import reuses a staged file with a matching SHA-256; it can skip the download when a single attachment has an explicit published digest. Challenge files and the database use separate data directories.
  • See status and flags update while a solve runs, without refreshing the page. Review, copy, and download Markdown write-ups in the selected interface language; request a revised write-up when needed.
  • Reject a wrong Flag candidate while its solve is running. A definitive incorrect CTFd response also stops the current draft and excludes that candidate from retry. Administrators can export a filtered, redacted diagnostic ZIP for troubleshooting.
  • Set the default Ultra escalation policy in Personal settings and refresh the locally generated profile image. Owners can download a saved Codex auth.json from the account's additional actions.
  • Each user can register a Telegram bot token in Personal settings, connect a chat through a one-time link, send a test alert showing the saved installation name, and receive flag, write-up, error, and input-request notifications. No bot token is bundled or required during installation. CTFd flag submission is off by default.
  • Use the first-run administrator setup for a multi-user installation. A separate no-login mode is available for explicitly configured single-user instances.
  • Switch the web interface between English and Korean. Interface translations live in language packs so more languages can be added.

Move a workspace or challenge between installations with a manual ZIP or an optional HTTPS direct transfer. The receiving installation shows the exact ZIP size and estimated unpacked attachment size for approval before transfer. The bundle carries read-only solver session logs alongside challenge data; credentials and resumable provider sessions stay on the source installation. Files still staged at the workspace level are not in the transfer bundle; attach them to challenges before moving the workspace. The transfer guide explains the public HTTPS requirement, retries, and the manual ZIP route for local-only or Cloudflare Access protected destinations.

Screenshots

Workspaces Live solver session
Workspace overview Challenge details and live log
Write-up preview Agent accounts
Markdown write-up preview Agent account management
Personal settings Administration
Personal settings User administration

System requirements

The Windows release uses WSL 2 and Docker Desktop's Linux-container backend. Use a supported 64-bit Windows version, a CPU with hardware virtualization and SLAT enabled, and a WSL distribution integrated with Docker Desktop. Docker's current Windows requirements specify at least 8 GB of RAM and WSL 2.1.5 or later; that is a Docker prerequisite, not a comfortable CTF Agent target.

Usage target RAM CPU Free SSD space before CTF Agent installation*
One solver, modest challenge files 16 GB 4 logical CPUs 30 GiB
Comfortable use, roughly 2–3 simultaneous solvers 32 GB 8 logical CPUs 50 GiB
Four or more solvers, large disk images, or separate host-side VM work 64 GB or more 12+ logical CPUs 100 GiB or more, plus space for the challenge files

* Planning estimates for an existing WSL/Docker Desktop installation, not guaranteed capacity limits. A fresh WSL/Docker installation needs additional room. The release installer reserves 18 GiB for a cold image pull, 1 GiB for application staging, and 5 GiB that must remain free; a separate database VHDX adds a 1 GiB growth estimate. If these use the same Windows drive, their estimates are added; different drives are checked independently. Large attachments may need space for the download, extracted files, and solver scratch at the same time. See the disk-space checks.

The local solver pool sizes itself from available memory inside WSL and effective CPU limits, budgeting 6 GiB and two logical CPUs per solver after a 2 GiB service reserve. Installed RAM alone therefore does not guarantee the solver counts in the table; other apps, WSL limits, and challenge workloads matter. The administrator can cap the pool. Keep challenge data on the WSL Linux filesystem for better file I/O; Windows Explorer can still reach it through \\wsl.localhost (Docker's WSL guidance).

Install on Windows

  1. Download the latest CTF_Agent-*-local-windows.zip release and extract it to a local folder.
  2. Run Install.cmd. It checks WSL 2, selects a suitable Linux distribution, checks Docker Desktop and disk space, and uses the usual data path inside WSL. WSL and Docker choices use their displayed defaults after 30 seconds. Add -Interactive to review all settings, or pass command-line options to skip the corresponding questions.
  3. Open http://127.0.0.1:5050. If you selected password login, create the first administrator account; the explicit no-login mode skips that step. Connect a Codex or Claude Code account in Agents.

If an existing WSL distribution runs its own Docker Engine, use -Interactive to choose a new Ubuntu or specify a separate distribution with -Distribution. After setting its Linux username and password, type exit in the Linux window so the installer can continue.

Open Administration → Service updates to check public releases, read release notes, and install an update. Install.cmd can also update an existing installation. Both paths preserve the selected data directory. The installer pulls the commit-pinned public GHCR image used on servers and verifies that its solver worker matches the release. It uses that image directly, without rebuilding the CTF toolchain or a duplicate local runtime layer. Installation and Start report success after /readyz confirms the solver is ready. See the installation guide for requirements, troubleshooting, and Windows Explorer access to challenge files.

After a web update that changes the Windows launchers, run the new release's Install.cmd once to refresh Start.cmd and Uninstall.cmd in your Windows user profile. The web updater updates the WSL service; it cannot reliably replace Windows launcher files when WSL interop is unavailable. Existing installations with a database VHDX on a Windows drive need the patched release's Install.cmd once before web updates can use the verified Docker database path.

Use -Interactive to choose whether the service starts when you sign in to Windows, or -StartAtSignIn to turn it on; saved choices are reused. You can always use Start.cmd to start manually and Uninstall.cmd to remove its containers, local image tags, and installed release files. Both launchers are placed in your Windows user profile under CTF Agent. A shared public image cache may remain. Uninstall keeps the selected data and database folders, WSL distribution, and Docker Desktop.

To host this Windows installation through a LAN address or an HTTPS tunnel, pass -PublicUrl "https://ctf.example.com" to Install.cmd. The installer binds the service to 0.0.0.0 and accepts requests only from the configured browser origins and local loopback. A no-login installation opened to the network is directly available in every browser without a connection ticket. Password-login installations still require account login and a first-admin setup token. Anyone who reaches an open no-login installation can use it as an administrator, so expose it only on networks you intend to trust. See the Windows installation guide for options and firewall details.

To open your challenge files from Windows, use Explorer at \\wsl.localhost\<distribution>\<Linux data path>\ctf_agent_data\workspace_files.

To place only the database at a Windows location, pass -DatabaseFolder D:\CTF-Agent\data, or enter that folder when prompted with -Interactive. The installer creates D:\CTF-Agent\data\ctf-agent-db.vhdx for the ext4 database; the application and challenge files keep the usual WSL path. Any fixed local drive, including C:, D:, or E:, is accepted even when it also holds the selected WSL distribution. D: is only an example, not a default. Omitting the option keeps all data at the usual WSL location. The database remains accessible in Explorer through \\wsl.localhost; see the Windows installation guide. Existing databases are not moved automatically.

Install from source

Run this line inside a WSL 2 distribution with Docker Desktop integration enabled:

git clone https://github.com/udonsari0101/CTF_Agent.git ~/CTF_Agent && cd ~/CTF_Agent && CTF_AUTH_MODE=password CTF_ALLOW_WEB_BOOTSTRAP=true CTF_LOCAL_UID=$(id -u) CTF_LOCAL_GID=$(id -g) python3 deploy/local-compose.py up -d --build

Solver environment

Each solver runs in a separate container with its own scratch space. The challenge brief, attachments, category playbooks, and analysis notes are assembled for that job. The solver may use the tools relevant to the challenge; a category label is a hint rather than a constraint.

Field Available tools and typical uses
Web curl, Chromium via ctf-browser, Playwright interaction via ctf-browser-act (with optional job-local Firefox download for Firefox-specific cases), bounded same-origin JSON API observation, ffuf, sqlmap, websocat, Python HTTP libraries: request inspection, paths, sessions, browser forms and uploads.
Pwn gdb, gdbserver, pwndbg, pwntools, ROPgadget, ropper, seccomp-tools, patchelf, qemu-user, strace: binary behavior, seccomp filters, and exploit reproduction.
Reverse Ghidra headless, JADX, GoReSym, radare2, objdump, readelf, angr, LIEF, Capstone, Unicorn, apktool, wabt: native, Go, Android, and WebAssembly analysis.
Crypto PARI/GP, PyCryptodome, SymPy, gmpy2, Z3, fpylll, owiener, john: algebra, lattice, RSA, and password challenges.
Forensics binwalk, foremost, exiftool, Sleuth Kit, testdisk, Volatility 3, tshark, YARA, ffmpeg, steghide, stegseek: file, disk, memory, traffic, media, and steganography analysis.
Network and misc dig, whois, nmap, Scapy, socat, tesseract, zbarimg, Python: protocol inspection, automation, and OCR.

REA is not bundled. It is an optional MCP interface to analysis engines; Ghidra and JADX are already available directly in the image. The supplied solver containers do not mount host GPU or KVM devices. See the toolchain inventory for versions and execution limits.

Research references

These projects and studies informed our design review. Their code is not bundled, and their reported solve rates are not performance claims for CTF Agent.

  • Agent coordination and continuity: ctf-solver-agent (solver coordination), ctfsolver (file-based handoff), Muteki (evidence-linked findings), and Veria Labs ctf-agent (parallel workers and submission cooldown). We reviewed these ideas without importing their implementations.
  • Tool use and failure analysis: EnIGMA (interactive tools and observed output), PwnAgent (debugger feedback), Reveree (reverse-engineering milestones), and A Second Look (orchestration's time and cost trade-offs).
  • Evaluation design: Baselines Before Architecture (artifact) motivates a same-model, same-budget plain-CLI control; its historical XBOW web results are not general CTF scores. CTFusion studies isolated live-CTF comparisons, while CTF-ABACUS audits flag provenance.
  • Public test material: NYU CTF Bench provides public development/test splits, Cybench includes subtasks, and CTFTiny supports smaller-scale checks. CTF-Dojo contributes executable training tasks; its published improvement is from model training, not a runtime harness. Public answers may have been encountered during training or search. Any future live results should be reported separately.

Source-to-implementation map

The table distinguishes bundled tools and protocol integrations from design references. CTF Agent's orchestration and evaluation code is independently implemented; the cited projects' agent code is not copied. The evaluation tooling below does not yet represent a completed model benchmark.

Source What was reflected Where to find it
CTFd Challenge and attachment import, later synchronization, and optional Flag submission through CTFd-compatible endpoints. CTFd client and submission worker. Direct protocol integration; auto-submit defaults to off.
Ghidra and JADX Headless native and Android/DEX decompilation commands in the solver image. Toolchain image and image smoke checks. Upstream tools are installed; their agent logic is not used.
Pwndbg GDB-assisted binary inspection for pwn tasks. Toolchain image and image smoke checks. Upstream tool installation.
ctfsolver CTFd challenges handed to isolated, tool-equipped agent containers were compared with our solve workflow. CTFd client and solver worker. Independent workflow design; no upstream agent code was imported.
CTFusion Independent attempts and separation of local Flag findings from official CTFd submission informed the evaluation boundary. Benchmark protocol and submission worker. Design reference; no live benchmark result is claimed.
Baselines Before Architecture (artifact) Motivates a same-model, same-budget plain-CLI control distinct from our existing minimal-prompt app-server control. Benchmark protocol, plan validator, and report validator. Plain-CLI trials remain blocked until provider credentials can be isolated from model tools.
NYU CTF Bench and Cybench Reproducible challenge inputs, a separate answer oracle, and category-aware reporting guide the benchmark manifest. Benchmark protocol. Their problem sets are not bundled in this repository.

About

Self-hosted AI-assisted workspace for Jeopardy-style CTF challenges, with CTFd sync, solver sessions, files, flags, and write-ups.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages