Php Exploit Chain logo

Php Exploit Chain

OrganizationPopular
wgpsec
php-exploit-chain

PHP 审计漏洞链组装方法论。当已完成各分类漏洞审计、需要评估多个漏洞组合利用的可行性时触发。 覆盖: 文件写入→文件包含→RCE 链、反序列化→敏感操作链、SQL 注入→文件写入链、 SSRF→内部服务链、信息泄露→权限提升链。同时包含 Composer 依赖 CVE 扫描方法。

Overview

Publisherwgpsec
RepositoryAboutSecurity
Skill namephp-exploit-chain
Stars
1.7K
Forks
242
Bundled files
Instructions only
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.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

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

Installation

Install the Php Exploit Chain 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/wgpsec/AboutSecurity.git /tmp/AboutSecurity
mkdir -p .claude/skills
cp -r /tmp/AboutSecurity/skills/code-audit/php/php-exploit-chain .claude/skills/php-exploit-chain
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Php Exploit Chain 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 Php Exploit Chain 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 Php Exploit Chain 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.

PHP 审计漏洞链组装方法论

本 skill 是审计流水线 Phase 5 的核心环节。各分类审计 skill 产出独立漏洞清单后,在此评估多个漏洞组合利用的可行性,将单点漏洞串联为完整攻击路径。

链组装前提

  • 各子审计(P4 阶段)已完成,漏洞清单已产出
  • 每个"已确认"漏洞均附有完整的 EVID_* 证据(Source→Sink 路径、可控参数、过滤状态)
  • 缺少 EVID 证据的漏洞不参与链组装,只能标注为"潜在链节点"

常见利用链模式

#入口漏洞中间跳板最终效果严重度
1文件写入(任意内容)include/require 路径可控RCECritical
2SQL 注入INTO OUTFILE / DUMPFILEWebshell 落地Critical
3反序列化入口POP Gadget 链任意操作(文件写/命令执行)Critical
4SSRF内部未认证服务(Redis/FastCGI)RCE / 数据泄露High-Critical
5信息泄露(密钥/盐值)伪造签名 / 解密 Token认证绕过High
6XSS(存储型)CSRF Token 窃取管理员操作劫持High

链组装流程

  1. 收集已确认漏洞 — 汇总所有子审计产出,仅纳入 EVID 证据完整的条目。按漏洞类型标注其"输出能力"(可写文件、可发请求、可泄露数据、可执行代码)
  2. 构建漏洞关系图 — 判断每个漏洞的输出是否可作为另一漏洞的输入(文件写入路径→文件包含路径、信息泄露内容→认证伪造密钥、SSRF 可达范围→内部服务地址)
  3. 寻找 Source→Sink 链对 — 沿关系图搜索从低权限入口到高影响 Sink 的最短路径,优先关注无需认证的入口点
  4. 验证链条前置条件 — 逐步确认: 认证要求(权限断层)、网络可达(目标网段)、时序依赖(文件清理/Session 过期)、环境约束(open_basedir/disable_functions/secure_file_priv
  5. 计算链严重度Score = R * 0.40 + I * 0.35 + C * 0.25(与 pipeline 一致),链条取最弱环节的 R/I/C 值,任何一步不可达则整条链不成立

各链模式详细条件

文件写入 + include → RCE: 写入路径必须在 include_path 或 Web 根目录下;写入内容必须包含可控的 PHP 代码片段;include/require 的路径参数必须可控或可预测(如固定日志路径)。

SQL 注入 + INTO OUTFILE → Webshell: 数据库用户需具备 FILE 权限;secure_file_priv 必须为空或包含 Web 目录;写入路径必须 Web 可直接访问;目标文件不能已存在(OUTFILE 不覆盖)。

反序列化 + POP 链 → 任意操作: 用户可控数据到达 unserialize/phar:// 触发点;项目或 Composer 依赖中存在可用的 Gadget 类;__destruct/__wakeup → 危险 Sink 的调用链完整可达。

SSRF + 内部服务 → RCE/数据泄露: gopher://http:// 协议可用(未被 CURLOPT_PROTOCOLS 限制);目标内部服务无认证(Redis 无密码、FastCGI 无访问控制);响应可回显或支持盲利用(DNS/延时)。

信息泄露 + 伪造签名 → 认证绕过: 泄露的密钥为实际签名密钥(非测试值);签名算法已知且可本地复现;伪造的 Token/Cookie 在有效期内且未被吊销机制拦截。

XSS + CSRF → 管理员操作劫持: XSS 为存储型或可持久触发;目标管理页面无独立 CSRF Token 或 Token 可通过 XSS 读取;关键操作(添加管理员/修改配置)无二次确认。

Composer 依赖审计

  • 解析 composer.lock 获取所有直接 + 间接依赖的精确版本号
  • 比对 Packagist Security Advisories 和 CVE 数据库(NVD/GitHub Advisory)
  • 重点关注间接依赖(require 的包所依赖的包)中的已知漏洞 — 开发者往往忽略
  • 工具辅助: composer audit(Composer 2.4+)、local-php-security-checker
  • 发现的依赖 CVE 同样纳入利用链关系图,评估是否可与业务漏洞串联

链不可行时的报告要求

当链条无法成立时,必须明确说明断裂点:

  • 具体哪一步的前置条件不满足(如 secure_file_priv 限制了写入路径)
  • 该条件是否可能在其他环境/配置下成立(标注为"环境依赖")
  • 是否存在替代路径绕过该断裂点

检测清单

  • 所有已确认漏洞已汇总,EVID 证据完整性已复核
  • 漏洞关系图已构建,输出→输入对应关系已标注
  • 每条可行链的前置条件已逐步验证
  • 环境约束(open_basedir/disable_functions/secure_file_priv)已确认
  • 链严重度已按最弱环节计算,评分与 pipeline 一致
  • 不可行链条已标明断裂点和原因
  • Composer 依赖 CVE 已扫描并纳入链评估
  • 链条利用路径已在源码层面完整验证

Frequently asked questions

What does the Php Exploit Chain AI skill do?

PHP 审计漏洞链组装方法论。当已完成各分类漏洞审计、需要评估多个漏洞组合利用的可行性时触发。 覆盖: 文件写入→文件包含→RCE 链、反序列化→敏感操作链、SQL 注入→文件写入链、 SSRF→内部服务链、信息泄露→权限提升链。同时包含 Composer 依赖 CVE 扫描方法。

Why use Php Exploit Chain on TypingMind?

Because you install it once and use it with any model. Php Exploit Chain 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 Php Exploit Chain in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/wgpsec/AboutSecurity/tree/master/skills/code-audit/php/php-exploit-chain. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Php Exploit Chain?

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 Php Exploit Chain?

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

Is the Php Exploit Chain AI skill free?

It is published on GitHub by wgpsec. Check the repository for licensing terms. 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 👇