Preparing your workspace...
Loading latest data

How SSRF Works:
An application allows users to fetch remote URLs (e.g., fetching profile images), but it does not properly validate the requested URL. An attacker exploits this by making the server request internal or restricted URLs.
Example of SSRF Vulnerability:
A web app allows fetching external images using: https://example.com/fetch?url=http://example.com/image.jpg
An attacker changes the URL to:
https://example.com/fetch?url=http://localhost/admin
If the server processes this request, it might expose internal services that were never meant to be accessed publicly.
Dangers of SSRF
1. Accessing Internal Services: Attackers can reach private/internal endpoints (e.g., http://localhost:8000/admin).
2. Bypassing Firewalls: SSRF can be used to interact with internal services not exposed to the public.
3. Extracting Metadata from Cloud Services:
AWS: http://169.254.169.254/latest/meta-data/
GCP: http://metadata.google.internal/computeMetadata/v1/
4. Port Scanning Internal Networks: Attackers can probe different internal services.
How to Prevent SSRF
1. Whitelist Allowed Domains – Only allow specific, trusted domains to be accessed.
2. Deny Private IP Ranges – Block internal addresses (127.0.0.1, 169.254.169.254, 192.168.0.0/16, etc.).
3. Use URL Parsing & Validation – Ensure the URL is properly validated and doesn’t redirect to internal services.
4. Restrict HTTP Methods – Limit requests to only GET if necessary.
5. Use Network Firewalls – Block outbound requests to internal services from the web server.
6. Monitor & Log Requests – Keep track of unusual request patterns to detect exploitation attempts.
Question 1.
SSRF stand for
Question 2.
Accessing Internal Services
A website has a feature that fetches URLs entered by the user: https://example.com/fetch?url=http://external-site.com
Can you use this to access an internal admin panel at http://localhost:8080/admin?
Question 3.
Retrieving Cloud Metadata
An application allows users to fetch data from external APIs. The following request is accepted: https://example.com/fetch?url=https://api.example.com/data
How can you use this to retrieve AWS instance metadata?
url: http://169.254.169.254/latest/meta-data/iam/security_credentials/
Question 4.
Exploiting Redis via SSRF
An API allows fetching user-defined URLs: https://example.com/fetch?url=http://some- api.com
How can you interact with an internal Redis service running on port 6379?
Question 5.
Bypassing Authentication via SSRF
A backend server makes requests on behalf of users: https://example.com/get-data?url=http://public-api.com
How can you access the internal admin panel at http://localhost/admin?