Skip to content

Releases: nvtruongops/CTF-Agent

CTF-Agent v1.3.7: Native CTFd MCP Server, FlagGuard Cache, Triage Board & Antigravity Specialization

Choose a tag to compare

@nvtruongops nvtruongops released this 11 Sep 13:03

What's Changed in CTF-Agent v1.3.7

🚀 Major Architectural Upgrades & Benchmarked Enhancements

1. Native CTFd MCP Server (scripts/ctfd_mcp_server.py)

  • Standard Model Context Protocol (MCP) server running over JSON-RPC 2.0 (stdio).
  • Zero external dependencies (pure Python standard library).
  • Exposes 5 native tools to AI agents: ctfd_list_challenges, ctfd_get_challenge, ctfd_download_files, ctfd_submit_flag, and ctfd_status.
  • Integrated directly into mcp_config.json.

2. FlagGuard & Anti-Hallucination Cache (scripts/flag_guard.py)

  • Prevents erroneous flag submissions and HTTP 429 rate-limit penalties.
  • Validates regex format for canonical CTF flag formats (flag{...}, HTB{...}, picoCTF{...}) and custom tournament regexes.
  • Maintains a local deduplication cache (.ctf_flag_cache.json) to skip already submitted or rejected flags.

3. Triage Board & Run State Tracker (scripts/triage_board.py)

  • Orchestrates multi-challenge CTF workflows across 4 progressive Tiers.
  • Generates and synchronizes triage_board.json for live challenge status.
  • Maintains an append-only run log in runs.jsonl tracking model, strategy, execution time, and outcome.
  • CLI status dashboard: python scripts/triage_board.py status.

4. Hard-Pwn Lane Taxonomy & Fast Exploit Selector (skills/ctf-pwn/hard-pwn-lanes.md)

  • Standardizes 7 canonical binary exploitation lanes:
    1. seccomp-orw (Open-Read-Write shellcode/ROP under seccomp filters)
    2. sandbox-orw (Syscall aliasing, openat2, x32 architecture switch)
    3. srop (Sigreturn-Oriented Programming)
    4. ret2dlresolve (Dynamic linker resolver without libc leak)
    5. heap-fsop (House of Apple 2 & _IO_FILE vtable for glibc 2.34+)
    6. heap-tcache-stash (Tcache Stashing Unlink Attack with calloc)
    7. shellcode-mmap (RWX jump or mprotect ROP)
  • Fast checksec decision tree and pwntools exploit skeletons.

5. Architectural De-bloat & Tiered Runtime Focus

  • Tier 1 (First-Class Native Focus): Google Antigravity IDE & CLI with complete agentic lifecycle (skills, personas, planning mode, MCP).
  • Tier 2 (Auxiliary Scaffolding): Re-classified multi_agent_adapter.py as an auxiliary configuration scaffolder for external editors (Claude, Cursor, Windsurf, Copilot, Aider), avoiding superficial "Universal" marketing claims.

🧪 Validation & Quality

  • Local CI Runner: 7/7 phases passed in 49.71s.
  • Automated Regression Suite: 118/118 tests passed (100%).
  • Package Distribution: NPM package ctf-agent@1.3.7 published.

CTF-Agent v1.3.6: Universal Multi-Agent Adapters, Safety Policy Sanitization & Dev Harness Integration

Choose a tag to compare

@nvtruongops nvtruongops released this 11 Sep 12:11

What's New in v1.3.6

Universal Multi-Agent Adapter Engine (scripts/multi_agent_adapter.py)

  • Cross-Harness Adapter Synchronization:
    • Automatically provisions lightweight, native configuration pointers and adapters for diverse AI coding agents:
      • Anthropic Claude Code: CLAUDE.md and .mcp.json
      • Cursor IDE: .cursorrules, .cursor/rules/ctf-agent.mdc, and .cursor/mcp.json
      • Codeium Windsurf: .windsurfrules
      • GitHub Copilot: .github/copilot-instructions.md
      • Aider CLI: .aider.conf.yml
      • Google Antigravity IDE: native AGENTS.md and .agents/ brain architecture
    • Establishes AGENTS.md and mcp_config.json as the Universal Single Source of Truth (SSOT), preventing duplicate configuration drift across tools.
    • Deployable individually or all-at-once via python scripts/multi_agent_adapter.py --agent all.

Advanced Safety Policy Sanitization & LLM Refusal Router

  • Diagnostic Lexicon Normalization (scripts/prompt_policy_sanitizer.py):
    • Automatically translates red-team aggressive attack terms into academic, diagnostic vulnerability evaluation terminology to avoid false-positive LLM safety triggers.
    • Expands rule coverage to handle complex multi-intent CTF prompts, payload descriptions, and exploit debugging without policy deadlocks.
  • Rules Hardening (rules/ctf-safety-framing-rules.md):
    • Introduces Turn-0 Tool-First cold-start requirements and deterministic CLI tool offloading (checksec, gdb, readelf, ROPgadget, curl, ffuf, pwntools) to bypass conversational safety rejections.

Comprehensive Developer Harness Guidelines (references/dev-harness-guidelines.md)

  • Authoritative documentation for framework maintainers on:
    • Strict separation of concerns: end-user CTF players vs framework maintainers.
    • Antigravity harness characteristics: Windows hook path formatting, session brain artifact lifecycle (task.md), goal stop hooks, and eager command execution (CASCADE_COMMANDS_AUTO_EXECUTION_EAGER).

Workspace Cleaner & Preflight Upgrades (scripts/workspace_cleaner.py)

  • Automated workspace sanitizer with --fast (blitz speedrun cleanup) and --deep (lab research archive) profiles.
  • Integrated automated tests: tests/test_multi_agent_adapter.py and tests/test_workspace_cleaner.py.
  • Full automated test suite expanded to 110/110 passed with zero regressions across all 7 local CI phases.

Multi-Engine Distribution Ecosystem

  • NPM Registry: Published officially as ctf-agent@1.3.6 (npx ctf-agent init).
  • GitHub Container Registry (GHCR): Container image pushed and tagged:
    • ghcr.io/nvtruongops/ctf-agent:1.3.6
    • ghcr.io/nvtruongops/ctf-agent:1.3
    • ghcr.io/nvtruongops/ctf-agent:latest
  • PyPI / UVX Distributions: Standalone wheels and source tarballs in GitHub Release assets.

Release Artifacts

  • Wheel: ctf_agent-1.3.6-py3-none-any.whl
  • Source Tarball: ctf_agent-1.3.6.tar.gz

CTF-Agent v1.3.4: Flexible Agent Brain Architecture & Multi-Engine Distribution

Choose a tag to compare

@nvtruongops nvtruongops released this 07 Sep 00:05

What's New in v1.3.4

Flexible Agent Brain Architecture & Scaffolding Control

  • Agent Brain Deployment (--brain / --agent-brain):
    • Injects the complete CTF-Agent cognitive framework (.agents/ skills, rules, subagents, operational scripts, references) alongside root AGENTS.md constitution, mcp_config.json, and skills-lock.json.
    • Strictly suppresses challenge scaffolding directories (resources/, notes/, solve.py, .env.example) to avoid cluttering existing repositories and lab writeups.
  • Root Constitution Enforcement (--with-agents-md):
    • Forces deployment and maintenance of the root AGENTS.md constitution, dynamically rewriting internal documentation links to point into .agents/.
  • Stealth Agent-Only Mode (--agent-only):
    • Produces zero files outside the .agents/ directory for pristine integration into existing security tooling repositories.
  • Smart Directory Detection & Scaffolding Controls (--no-scaffold vs --scaffold):
    • Automatically identifies non-empty directories and preserves existing file structures by defaulting to --no-scaffold.
  • Non-Interactive Unattended Flag (-y / --yes / --auto):
    • Supports headless CI/CD runs, automated scripting, and IDE terminal dispatch with stdin=subprocess.DEVNULL.

Workspace Synchronization & Upgrade Engine (ctf-agent update)

  • Brain Upgrade Command (ctf-agent update --brain):
    • Upgrades .agents/ and provisions missing root AGENTS.md constitution files in previously initialized workspaces.
  • Cryptographic Integrity Ledger (skills-lock.json):
    • Verifies SHA-256 checksums across all 11 skills and triggers automatic backups (.bak) before updating.

Clean Distribution & Developer Asset Isolation

  • Lean Distribution: Excludes internal developer test suites, CI runners, and packaging mirrors from end-user environments.
  • Essential Tooling Guarantee: Preserves all 14 primary operational scripts (ctf_init.py, ctf_update.py, install_as_agent.py, parallel_triage.py, scope_guard.py, cve_lookup.py, ctfd_client.py, extract_flags.py, workspace_cleaner.py, prompt_policy_sanitizer.py, skill_validator.py, install_ctf_tools.sh, ctf-tools.lock).

High-Speed Local CI Engine (scripts/local_ci.py)

  • Standardizes pre-release verification across 7 rigorous automated phases:
    1. Security & Secrets Audit (zero private keys, API credentials, or tokens)
    2. Git Hygiene & Line-Ending Audit (strict LF line endings)
    3. Package Version & Manifest Synchronization (canonical 1.3.4 across all 6 manifests)
    4. Asset Mirror Synchronization
    5. Skill & Persona Frontmatter Validation (11 skills, 3 personas)
    6. Documentation Standards & Badge Verification
    7. Automated Regression Test Suite (90/90 tests passing)

Multi-Engine Distribution Ecosystem

  • NPM Registry: Published officially as ctf-agent@1.3.4 (npx ctf-agent init).
  • GitHub Container Registry (GHCR): Automated OCI container image tagged as ghcr.io/nvtruongops/ctf-agent:1.3.4 and ghcr.io/nvtruongops/ctf-agent:latest.
  • PyPI / UVX: Standalone wheel and source distribution runnable via uvx --from git+https://github.com/nvtruongops/CTF-Agent ctf-agent init.

Release Artifacts

  • Wheel: ctf_agent-1.3.4-py3-none-any.whl
  • Source Tarball: ctf_agent-1.3.4.tar.gz

CTF-Agent v1.2.0: ScopeGuard Anti-SSRF, CVE Threat Intel v2.1 & GitHub Packages

Choose a tag to compare

@nvtruongops nvtruongops released this 06 Sep 20:00

What's New in v1.2.0

Machine-Enforced ScopeGuard v1.2 (Active Sandbox Hardening)

  • Anti-SSRF & IP Obfuscation Defense: Strictly blocks alternate IP representations designed for filter bypass:
    • Decimal integer IP (2130706433)
    • Hexadecimal IP (0x7f000001)
    • Octal IP notation (017700000001, 0177.0.0.1)
  • DNS Wildcard Rebinding Protection: Rejects wildcard rebinding services (*.nip.io, *.sslip.io, *.xip.io).
  • Target Taxonomy Separation: Explicitly distinguishes between:
    • challenge_instance: Dynamic instancers (*.chals.io, *.challs.io, *.chal.pw, *.picoctf.net, challenge.flagyard.com, lab.hackthebox.com, *.web-security-academy.net, challenge01.root-me.org, *.ctf.su, *.pwni.ng, *.seccon.games, *.kctf.dev).
    • platform_portal: CTF platforms & scoreboards (picoctf.org, ctfd.io, hackthebox.com, tryhackme.com, flagyard.com).
    • private_lab: Isolated environments (localhost, 127.0.0.1, ::1, RFC1918 subnets, *.local, *.internal, *.lan, *.test, *.lab, *.htb, *.thm).
    • local_file: Challenge binaries, PCAPs, and source trees.
  • Port & Protocol Sanitization: Validates ports (1..65535) and strictly enforces permitted schemes (http, https, tcp, nc, ssl, ws, wss, ssh) while rejecting dangerous schemes (javascript:, file:, data:, gopher:, dict:, ldap:, vbscript:).

Vulnerability Threat Intelligence Pipeline v2.1 (scripts/cve_lookup.py)

  • In-Memory Caching (LRU): Caches the multi-megabyte CISA KEV catalog via @lru_cache, eliminating network bottlenecks and rate-limit risks during batch lookups.
  • Statistical & Threat Semantics Precision:
    • EPSS: Clarified as an estimation of probability of exploitation in the wild, not proof of an active campaign and distinct from CTF exploitability.
    • CISA KEV: Accurately phrased to denote historical confirmation of in-the-wild exploitation.
  • Public PoC & Exploit Classification: Automatically identifies exploit references (Exploit-DB, Packet Storm, GitHub PoCs, Rapid7, Sploitus) and outputs structured reference counts.
  • Decoupled CTF Challenge Relevance Layer: Heuristic score (0.0 to 1.0) with diagnostic signals (public_exploit_poc_available, cisa_kev_listed, network_attack_vector, high_severity_cvss, challenge_vulnerability_pattern), strictly separated from CVSS and EPSS.
  • Machine-Readable JSON Mode: Added --json output flag for automated consumption by AI agents and subagents.
  • Network Resilience: Differentiates HTTP 404 (not found) from rate limits (429) and server errors with exponential backoff retries.

Automated Testing & Packaging

  • 100% Passing Test Suite: 72 automated tests passing across 12 test modules.
  • GitHub Packages Integration: Configured GitHub Actions workflow (.github/workflows/publish-packages.yml) to automatically build and publish OCI container images to GitHub Container Registry (ghcr.io/nvtruongops/ctf-agent).
  • CLI Dispatchers: Added clean / clean-workspace and cve / cve-lookup subcommands.

Release Artifacts

  • Wheel: ctf_agent-1.2.0-py3-none-any.whl
  • Source Tarball: ctf_agent-1.2.0.tar.gz

CTF-Agent v1.1.0: Triple-Engine CLI & Reconnaissance Platform

Choose a tag to compare

@nvtruongops nvtruongops released this 06 Sep 19:05

What's New in v1.1.0

Triple-Engine CLI & Distribution

  • NPM / NPX: npx ctf-agent init - Zero-clone workspace initialization.
  • Python Native: python scripts/ctf_init.py - Standard library installation.
  • Modern UV / UVX: uvx ctf-agent init - Ultra-fast ephemeral execution.
  • Workload-Aware Scoring: Automatically evaluates host capabilities (CPU, RAM, disk, WSL Kali, Docker) tailored for rev-pwn, web, security-lab, live-ctf, or full workloads.

High-Speed Parallel Reconnaissance (P0)

  • Parallel Triage Scheduler (scripts/parallel_triage.py): Concurrently executes Tier 1 and Tier 2 diagnostics for binary and web challenges via ThreadPoolExecutor.
  • Embedded Native ELF Parser: Pure Python standard library binary parser extracting architecture, bitness, endianness, entry point, section counts, NX stack mitigation, and PIE position independence without host tool dependencies.

Active Safety & Scope Guardrails (P0)

  • Machine-Enforced Scope Guard (scripts/scope_guard.py): Active runtime boundary enforcement allowing only authorized loopback, RFC1918 private subnets, and designated CTF domains while blocking destructive commands and persistence attempts.
  • Prompt Policy Sanitizer: Automatically translates adversarial keywords into academic diagnostic terminology.

Workspace Conflict Protection

  • Surgical Directory Synchronization (scripts/ctf_update.py): File-by-file SHA-256 diffing protecting custom local files in rules/, agents/, references/, and scripts/ with automatic .bak backups.

Release Artifacts

  • Binary wheel: ctf_agent-1.1.0-py3-none-any.whl
  • Source distribution: ctf_agent-1.1.0.tar.gz