Module 14: Server-side Request Forgery
Introduction to SSRF
Interacting with the Vulnerable Server
Example: Using a SSRF we could interact with the loopback interface of a vulnerable server which would ordinarily not be accessible otherwise.
Interacting with Back-end Systems and Private IP Ranges
Private IP Addresses
IP address range
Number of addresses
10.0.0.0/8
16,777,216
172.16.0.0/12
1,048,576
192.168.0.0/16
65,536
Using a SSRF we could also potentially interact with other systems on the internal network.
Testing for SSRF
Accessing the SSRF Sandbox Application
Start the VPN, VM, and add the IPs and hostnames to your hosts file.
Discovering SSRF Vulnerabilities
If we discover upload functionality via URL, URI, or link, we should test for SSRF.
Note that requests to other domains will most likely fail since the VMs in the lab environment do not have full access to the Internet.
Calling Home to Kali
Restarting the Apache HTTP Server
Verifying the application requested a page from our Kali VM
Exploiting SSRF
Retrieving Data
Instance Metadate in Cloud
Some cloud hosting providers, such as AWS, use the link-local address 169.254.169.254 for their metadata services. Others provide access through DNS, such as Google Cloud, which uses metadata.google.internal. These may include sensitive/private information.
Bypassing Authentication in Microservices
Any security controls enforced by an API gateway on traffic entering the internal network would not apply to the traffic between two microservices since the traffic originates within the internal network
Alternative URL Schemes
Checking the contents of the kali default homepage
Starting a netcat listener on port 9000
Using curl to send a request with the Gopher protocol
Netcat listener handling the Gopher request
Example HTTP GET request
Sending a mock HTTP request over the Gopher protocol
Netcast listener handlin gour mock HTTP request
Extra Mile
Case Study: Group Office
Accessing Group Office
Start the VPN, the VM, and add the IP and hostname to your hosts file.
Discovering the SSRF Vulnerabilities
Restarting apache2
Checking our access.log file with tail
Access log contents include a request to /repeater
Access log contents include a request to /fromurl
Creating itworked.html and moving it to our webroot
Exploiting the SSRF Vulnerabilities
Last updated