Lab 11: Advanced SSRF — Internal Network Pivoting

Objective

Chain Server-Side Request Forgery attacks to pivot from the web application into the internal network from Kali Linux:

  1. Direct SSRF — use /api/fetch?url= to read internal-only API endpoints the attacker cannot reach directly

  2. Webhook filter bypass — the webhook endpoint blocks localhost literally but not 127.0.0.1, 0.0.0.0, or [::]

  3. Internal port scanning — use SSRF to enumerate open ports on the victim container

  4. Cloud metadata simulation — read a simulated 169.254.169.254 metadata endpoint for IAM credentials


Background

SSRF weaponises the server as a proxy into networks the attacker cannot reach — internal APIs, admin panels, cloud metadata, database management interfaces.

Real-world examples:

  • 2019 Capital One breach — SSRF via AWS WAF misconfiguration allowed an EC2 instance to reach 169.254.169.254; IAM role credentials returned; attacker accessed S3 buckets containing 100M customer records.

  • 2021 GitLab (CVE-2021-22214) — SSRF in the CI/CD webhook feature allowed requests to internal Kubernetes API server; cluster credentials returned.

  • 2022 Confluence SSRF — combined with RCE to scan internal networks; used to pivot from DMZ web servers to internal database servers.

  • AWS IMDSv1 — any EC2 instance can request http://169.254.169.254/latest/meta-data/iam/security-credentials/<role> to get temporary AWS credentials. IMDSv2 requires a PUT pre-flight to mitigate SSRF, but many apps still use IMDSv1.

OWASP: A10:2021 Server-Side Request Forgery


Architecture

Time

40 minutes


Lab Instructions

Step 1: Setup


Step 2: Launch Kali


Step 3: Direct SSRF — Read Internal Endpoints

📸 Verified Output:


Step 4: Webhook Filter Bypass

📸 Verified Output:


Step 5: Internal Port Scanning via SSRF


Step 6–8: AWS Metadata + SSRF Mitigations + Cleanup


Further Reading

Last updated