Skip to content

Lesson 2 of 9 · 22m

Mapping Internal Reachability Before the Attacker Does

Localhost is only the beginning: private ranges, service discovery names, cloud load balancers, and the internal services most likely to become SSRF targets.

On assessments, the first SSRF proof is often http://127.0.0.1:8080/health. It gets a nervous laugh, then someone says the real network is segmented. Then the same server reaches http://10.20.4.18:8500/v1/catalog/services and the room gets quiet. The meaningful question is never whether localhost is reachable. It is what the workload can route to.

Know the address space your app really lives in

The boring ranges are the important ones:

127.0.0.0/8       loopback, including aliases beyond 127.0.0.1
10.0.0.0/8        RFC1918 private
172.16.0.0/12     RFC1918 private
192.168.0.0/16    RFC1918 private
169.254.0.0/16    link-local, including cloud metadata
100.64.0.0/10     carrier-grade NAT, common in container platforms
fd00::/8          IPv6 unique local addresses
::1               IPv6 loopback

If you only block 127.0.0.1, you have blocked the payload in the blog post and nothing else.

Service discovery gives attackers a directory

Internal names are not secret once SSRF exists. Kubernetes, Consul, Docker, and cloud load balancers all create predictable resolution patterns:

http://kubernetes.default.svc:443/api
http://redis.infra.svc.cluster.local:6379/
http://consul.service.consul:8500/v1/agent/services
http://internal-api.default.svc.cluster.local/admin
http://169.254.169.254/latest/meta-data/

An attacker does not need to scan blindly. Error messages, response timing, and known service ports narrow the search quickly.

High-value internal targets

The services that hurt most usually share one trait: they assume network locality means trust.

  • cloud metadata services, instance identity endpoints, and Kubernetes or kubelet APIs
  • Redis, Memcached, Elasticsearch, MongoDB, and internal search indexes
  • CI/CD control planes, artifact repositories, queue admins, feature flags, and support panels
  • monitoring endpoints, service mesh control planes, and metadata-aware proxies that reveal topology

A response body is nice for proof. Sometimes the damage is only the request: POST /jobs/run, DELETE /cache, or PUT /config on a service that trusts the network.

Build the reachability map defensively

Document what each egress-capable workload can actually reach, from the workload. Do not infer it from architecture diagrams drawn during the migration.

# from inside the workload's network namespace
ip route && cat /etc/resolv.conf
getent hosts kubernetes.default.svc 2>/dev/null || true
env | grep -E '^(AWS|AZURE|GOOGLE|KUBE|VAULT)_' | sed 's/=.*/=<set>/'

Then compare that reality with intent. The gap is your SSRF blast radius.

Field notes

  • Blocking only localhost and 127.0.0.1 misses loopback aliases, decimal and hex IP forms, and every private range.
  • Internal hostnames often leak through product features: status pages, debug endpoints, logs, and error messages.
  • SSRF port scanning is slow but viable when responses differ by status, timing, or error text.
  • If an internal service has no authentication because it is "private," treat that as a vulnerability SSRF exposes, not as a separate excuse.

Was this lesson helpful?

Sign in to rate