How to exploit a basic SSRF vulnerability?

Search for a command to run...

"><img src="x"onerror(document.domain);>
Get started with Cross Site Scripting: A Simple Guide for Beginner-Level Devs

What is XSS? Simply we can say that XSS (Cross-site scripting) is a JavaScript code injection on web applications. Attackers use vulnerable web apps to inject malicious javascript code or a script. There are several types of XSS attacks. The risks of...

A step-by-step guide on how I find security vulnerabilities that others miss

An easy-to-exploit SSRF vulnerability.

The challenge in this writeup is from Portswigger's web security academy lab. You can access it here for Free.
We need to access the admin panel and delete the user called Carlos. We can only access the admin panel from the internal network.
They have given us the details about the SSRF vulnerable endpoint. Stock check is the feature where SSRF vulnerability is present. Also, the admin interface URL is given.
The landing page of the lab.

On viewing any of the product details we could see an option to check stock.

The below request is being sent to the server whenever we check the stock.

Let's change the stock URL with the URL given on the challenge home page.

When we send the above request, we get the admin interface in the place of stock details.

The primary task we have to complete is to delete the user named Carlos.
There is a delete button near the username Carlos. If we click the button, a GET request is sent to the server from our browser.

However, the response is permission denied. What went wrong???

The server will only accept all admin-requests only if it is coming from the internal network. Otherwise, it will reject the request.
So, just as we accessed the admin panel earlier, we should send the user-deletion request.
Carlos?Let's exploit the SSRF vulnerability present in the stock check feature, and send the user deletion request via exploiting the SSRF, which will hopefully delete the user Carlos.

admin pageNow if we go again to the admin page through the stock check endpoint, we could see only one user there. The user Carlos has successfully deleted.

We solved an easy lab Basic SSRF against the local server from Portswigger's Web security Academy.
