ctf-web

ctf-web is a skill for Claude Code, Codex from Unclecheng-li/DeepSec. It costs 56 tokens per session (2,858 once invoked), scanned A, a copy of ctf-web, MIT.

A reference library for web-security challenges in CTFs, or capture-the-flag security competitions. It focuses on common PHP weaknesses, injection bypasses, source-code discovery, file inclusion, and finding hidden challenge data.

In plain words
What is it for?
Inspecting a challenge's source and HTTP details, checking common files and paths, reviewing PHP code, and investigating weak comparisons, file inclusion, command injection, server-side template injection, and deserialisation.
Why use it?
It reduces the time needed to recognise familiar challenge patterns and choose tested-looking checks or payload structures.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/unclecheng-li/deepsec/ctf-web
Any agent
npx skills add Unclecheng-li/DeepSec --skill ctf-web
Clone the repo
git clone --depth 1 https://github.com/Unclecheng-li/DeepSec

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ctf-web

README.md
[![agentmods](https://agentmods.dev/badge/skills/unclecheng-li/deepsec/ctf-web.svg)](https://agentmods.dev/skills/unclecheng-li/deepsec/ctf-web)
Your own site
<a href="https://agentmods.dev/skills/unclecheng-li/deepsec/ctf-web"><img src="https://agentmods.dev/badge/skills/unclecheng-li/deepsec/ctf-web.svg" alt="Measured on agentmods" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,858 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00056 $0.02858
Opus 5 $0.00028 $0.01429
Sonnet 5 $0.00011 $0.00572
Haiku 4.5 $0.00006 $0.00286

Measured 4d ago against content hash 4b81b251d5d5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ctf-web scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to ctf-web — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

deepsec/spear/skills/specialized/ctf-web/SKILL.md · 176 lines

How it starts

The opening of the file, as written. The whole thing — 176 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CTF Web 攻击知识库

针对 CTF Web 题目的实战知识库,提供具体绕过值、payload 模板、代码审计 checklist,而非渗透测试方法论。

web-security-advanced 的区别

  • web-security-advanced → 渗透测试方法论(怎么系统性测试一个 Web 应用)
  • ctf-web → CTF 实战知识库(PHP 弱比较用什么值、空格怎么绕过、eval 输出怎么回显)

核心原则

  1. 精确值优于方法论 — 提供可直接使用的绕过值和 payload,而非"可以尝试"的建议
  2. 工具验证 — 所有 payload 必须用 fetchpython_execute 工具实际发送验证,不猜测结果
  3. 路径选择 — 多条利用路径时,优先选过滤最少、最简单的
  4. 失败记录 — 某个 payload 失败后立即记录,不重复尝试

First-Pass 工作流(CTF Web 题标准流程)

  1. 访问目标 URL,查看页面源码、HTTP 头、Cookie
  2. 如源码含 highlight_file → 用 python_execute + strip_tags 提取纯源码(fetch 输出可能误读)
  3. 检查 robots.txt、.git/、.svn/、备份文件(index.php.bak、www.zip 等)
  4. 目录扫描(常见:/flag、/admin、/login、/upload、/api)
  5. 如有源码 → 进入代码审计模式(见 php-code-audit-checklist.md
  6. 如无源码 → 主动探测注入点、上传点、文件包含

场景路由

场景 参考文档 核心内容
⭐ PHP 伪协议读文件(遇到文件包含/参数传文件名时优先尝试) 见下方「PHP 伪协议速查」 php://filter 直接读源码/flag
源码提取 source-code-extraction.md strip_tags 提取、php://filter、.phps、备份文件、完整性校验
PHP 弱比较/类型绕过 php-bypass-cheatsheet.md 0e 开头 MD5 值大全、数组绕过、extract() 覆写
⭐ MD5 弱比较碰撞(md5(a)==md5(b) 弱比较) php-bypass-cheatsheet.md ⚠️ 0e 后必须纯数字!直接用 QNKCDZO+240610708 等已验证值
⭐ preg_replace/str_replace 双写绕过 见下方「双写绕过速查」 NSSNSSCTFCTF → 替换后 = NSSCTF
命令注入空格绕过 command-injection-bypass.md ${IFS}/$IFS$9/</%09/%0a 全表
eval/RCE 技巧 eval-and-rce-techniques.md system/exec/passthru 区别、highlight_file 输出顺序、无回显外带
SSTI 注入链 ssti-injection-chains.md Jinja2/Twig/ERB/Mako 等注入链速查
反序列化利用链 deserialization-playbook.md PHP/Java/Python 反序列化、SoapClient CRLF
文件上传 → RCE web-security-advancedweb-playbook-08-file-vulnerabilities.md .htaccess 绕过、日志投毒、多语言 Webshell
CTF 快速参考 web-ctf-quick-reference.md flag 位置、常见链形状、响应头 hint
PHP 代码审计 php-code-audit-checklist.md 输入入口→过滤→危险函数→输出分析

⭐ PHP 伪协议速查(文件包含/参数传文件名时优先尝试)

触发条件:当题目出现以下任一特征时,先试 php://filter 再想其他方法

触发特征 示例
参数接受文件名/路径 ?file=xxx / ?page=xxx / ?num=xxx / ?path=xxx
include / require / include_once 源码中有这些函数
页面展示源码 highlight_file() / show_source()
题目要求"读文件"或"找 flag" 明确要读取服务器文件

Read the full file on GitHub · 176 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 176 lines · 56 tokens per session scan A 4b81b251d5d5

Subscribe to this mod's changes

ctf-web is a skill published in the GitHub repository Unclecheng-li/DeepSec (386 stars, last pushed 10d ago), licensed MIT. It adds 56 tokens to every session and 2,858 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to ctf-web, differing in 0 lines, and is treated as a copy.