ctf-web

A practical knowledge base for web challenges in Capture the Flag (CTF) competitions, including PHP mistakes, injection techniques, source-code checks, and common flag locations.

In plain words
What is it for?
It is for examining challenge websites, reviewing PHP source, checking hidden files and paths, and testing issues such as weak comparisons, code injection, template injection, and unsafe deserialization.
Why use it?
It helps solve challenge-specific puzzles when general web-security advice is too broad. It provides concrete values, payload patterns, and checks to try and verify.

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/fb0sh/pentester/ctf-web
Any agent
npx skills add fb0sh/pentester --skill ctf-web
Clone the repo
git clone --depth 1 https://github.com/fb0sh/pentester

Made for: Claude Code, Codex.

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 2d 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 2d 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.

.agents/skills/third-party/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. 2d 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 fb0sh/pentester (23 stars, last pushed 1mo 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.

Related

Other skills, from other repositories

transilience-report-style

Threat Intelligence Report Design System — ReportLab-based PDF generation for A4 reports with Transilience branding, typography, and layout standards.

transilienceai/communitytools · 31 tokens

firewall-review

Evidence-safe firewall ruleset audit reference specification — 22 documented detector patterns (17 vendor-agnostic plus 5 FortiGate-specific), a 15-check semantic catalogue, CIS Fortinet FortiGate Benchmark guidance, a custom customer-policy benchmark, and consolidated network-team Excel profiles including grouped…

transilienceai/communitytools · 100 tokens

pentest-engagement

Run a professional penetration engagement OR a network vulnerability scan from a scope. WEB mode (apex domains / app URLs) — mandatory surface expansion, systematic OWASP attack-class coverage, reversible active exploitation, authoritative validation, Transilience PDF. NETWORK mode (a list of IPs/CIDRs, e.g. 1500…

transilienceai/communitytools · 140 tokens

attack-path-stitcher

Stitches confirmed single-asset findings into multi-hop attack paths across the organization. Builds a graph where nodes are assets and edges are confirmed exploit hops citing the findings that enable them.

transilienceai/communitytools · 42 tokens

coordination

Pentest coordination — orchestrates executor and validator agents with context-controlled spawning. Entry point for all engagements.

transilienceai/communitytools · 24 tokens

dfir

Digital forensics and incident response - Windows event log analysis, PCAP forensics, filesystem artifact analysis, AD attack detection, and timeline correlation. Use when investigating security incidents, analyzing Sherlocks, or performing threat hunting on provided evidence files.

transilienceai/communitytools · 51 tokens