A lightweight, zero dependency, standalone SSRF detection proxy for outbound HTTP requests.
This is a basic outbound request guard. It is not a full application firewall and should be paired with allowlists and authentication in production.
- Internal IP address detection (including decimal IPv4 forms and unspecified addresses)
- DNS rebinding attack detection (hostname patterns plus dial time IP checks)
- Uncommon HTTP method detection
- Redirect chain attacks (each hop is revalidated)
Ready to use executables for all platforms:
| Platform | Download Link | Run Command |
|---|---|---|
| Windows | ssrf-proxy-windows-amd64.exe | .\ssrf-proxy-windows-amd64.exe |
| Linux | ssrf-proxy-linux-amd64 | chmod +x ssrf-proxy-linux-amd64 && ./ssrf-proxy-linux-amd64 |
| macOS Intel | ssrf-proxy-darwin-amd64 | chmod +x ssrf-proxy-darwin-amd64 && ./ssrf-proxy-darwin-amd64 |
| macOS Apple Silicon | ssrf-proxy-darwin-arm64 | chmod +x ssrf-proxy-darwin-arm64 && ./ssrf-proxy-darwin-arm64 |
docker build -t ssrf-proxy .
docker run -p 8080:8080 ssrf-proxy# Test the health endpoint (works with any installation method)
curl http://localhost:8080/healthThe proxy works in three modes:
# This request will be proxied to http://example.com
curl http://localhost:8080/http://example.com
# This will be blocked (internal IP)
curl http://localhost:8080/http://192.168.1.1curl "http://localhost:8080/?url=http://example.com"
curl "http://localhost:8080/?url=http://192.168.1.1"# Use X-Target-URL header to specify the target
curl -H "X-Target-URL: http://example.com" http://localhost:8080/When an SSRF attempt is detected, the proxy:
- Blocks the request immediately (returns HTTP 403 Forbidden)
- Logs the attempt in JSON
- Returns error details including detection type and description
Example response body:
{
"error": "SSRF attempt detected",
"count": 1,
"detections": [
{
"type": "internal_ip",
"description": "Request to internal IP address detected: 127.0.0.1 -> 127.0.0.1",
"url": "http://127.0.0.1/",
"method": "GET",
"ip": "127.0.0.1"
}
]
}- This proxy is a request guard, not a complete SSRF defense for application code.
- DNS rebinding protection resolves and checks addresses at dial time; keep alives are disabled to reduce reuse surprises.
- Prefer application level allowlists for production sensitive targets.
- Deploy within a trusted network and terminate TLS at a reverse proxy when exposing it.
See documentation
Licensed under the MIT License