Hello cancahens!
I haven't written a post in a while. I decided to write this post to support the forum and share my experience with those new to penetration testing. In my experience, SSRF is one of the most common vulnerabilities. This vulnerability is often underestimated, especially in bug bounty programs, but it is very useful for reconnaissance and sometimes even for information disclosure.
p.s. The photos in the post are from different targets.
SSRF vulnerability concept
Server Side Request Forgery is a vulnerability that allow an attacker send requests on behalf of web server.
This is happens because server accepting url from client input and send request to this url. And the input may not only be url, its can be ip address, I'll say even more, its can be local ip address)).

SSRF also allows you to get the real IP address of a web server if it is behind Cloudflare or another reverse proxy.

SSRF filtration bypass
SSRF filtration can be of 4 types (at least I have only these types)
All others urls are blocked expect for the one that is needed, mostly target domain of subdomain.
All ip addresses are blocked, but other urls are allowed.
All local ip addresses are blocked, but all others ips and urls are allowed.
All urls are blocked, but they forgot about the ip addresses.
The first type of filtering can’t be bypassed, but the other types can be completely bypassed.
But today i want to talk about only 2 bypass types for local network reconnaissance.
If all urls are blocked, but they forgot about the ip addresses, it’s perfect. You can easily scan local network behind web server.
When using the second and third types of filtering, there is one bypass method is used that always works.
SSRF bypass via Open Redirect
Open redirect is a low level vulnerability that allows attacker redirecting user from A site to B site via redirect endpoint.original url: example.com/redirect?url=facebook.com
vulnerable url: example.com/redirect?url=attacker.com
Open Redirect can be used for redirecting ssrf vulnerable server to a local ip if that filterting local ip addresses.
I usually create an open redirect endpoint on my website and use it for the attack.example: cymbermyber.am/redirect?url=127.0.0.1

Second type of filter bypass is
short links. You can set local IP address when creating short link and force the server to send request to that short link. I think anyone can find a site for creating short links.
Reconnaissance
The main objective of reconnaissance via SSRF is a find real local network range and getting information about servers and devices on this local network.
The fastest way to find the right IP address range is using intruder. You just need to bruteforce using the first IP address in all local ranges. In my experience this is the most working variant.

Once the correct range of local IP addresses has been determined, it is time to scan frequently used ports on all hosts.

Depending on the SSRF type (basic/blind) except recon you can find credentials or important files from local network devices.
This vulnerability often found on websites with smm and simillar services.
Thank you!!









Comments (0)