> For the complete documentation index, see [llms.txt](https://ganesha-hk.gitbook.io/cybersecurity-writeups/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ganesha-hk.gitbook.io/cybersecurity-writeups/port-swigger-ssrf-lab/lab-1.md).

# lab-1

## Basic SSRF Against the Local Server

**Difficulty:** Apprentice

### Lab Description

This lab has a stock check feature which fetches data from an internal system.

**Objective:** Change the stock check URL to access the admin interface at `http://localhost/admin` and delete the user `carlos`.

### Root Cause

Some application servers have permission to make requests to other internal application servers to retrieve data. Developers sometimes allow these servers to access sensitive panels — such as admin or IT support interfaces — without any authentication, on the assumption that they are not reachable from outside the network. However, if the application makes outbound requests using a user-supplied URL without validation, an attacker can point that URL at internal resources the server can reach but the attacker normally cannot.

### Exploitation

1. Access any product page and find the **stock check** functionality. Click it and capture the request in Burp.
2. Find the `POST /product/stock` endpoint and send it to Repeater.
3. Change the `stockApi` parameter value to `http://localhost/admin` and send the request.
4. Open the response in the browser — the admin panel is accessible.
5. Click **Delete carlos** and note the URL path: `/admin/delete?username=carlos`.
6. Back in Repeater, set the `stockApi` parameter to:

   ```
   http://localhost/admin/delete?username=carlos
   ```
7. Send the request — `carlos` is deleted and the lab is complete.

### Lesson Learned

* The server must never blindly trust user-supplied URLs.
* Admin panels and other sensitive internal interfaces must require authentication even for loopback and internal network requests — "not reachable from outside" is not a substitute for access control.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ganesha-hk.gitbook.io/cybersecurity-writeups/port-swigger-ssrf-lab/lab-1.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
