> 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/path-traversal.md).

# 路径遍历

路径遍历、文件读取、遍历序列绕过、URL 解码绕过、空字节技巧以及路径验证弱点。

针对 PortSwigger Web Security Academy 实验的路径遍历笔记，重点关注实际测试步骤、Burp Suite 验证、有效载荷行为以及利用流程。

## 测试流程

1. 识别存在漏洞的功能，以及相关的请求、参数、请求头、Cookie 或浏览器端 sink。
2. 在进一步发起攻击之前，先在 Burp Suite 中使用最小有效载荷复现该行为。
3. 使用清晰的概念验证来验证影响，例如账户访问、数据泄露、代码执行、SSRF 或状态变更。
4. 在记录利用路径时，保持有效载荷、URL、令牌和实验室凭据不变。

## 实验

<table><thead><tr><th data-type="content-ref"></th></tr></thead><tbody><tr><td><a href="/zh/web/path-traversal/basic-path-traversal.md">基础路径遍历</a></td></tr><tr><td><a href="/zh/web/path-traversal/bypass-by-double-url-decoding.md">通过双重 URL 解码绕过</a></td></tr><tr><td><a href="/zh/web/path-traversal/bypass-with-null-byte-and-extension-validation.md">通过空字节和扩展名验证绕过</a></td></tr><tr><td><a href="/zh/web/path-traversal/file-path-traversal-traversal-sequences-removed-without-recursive-processing.md">文件路径遍历：在未进行递归处理时移除遍历序列</a></td></tr><tr><td><a href="/zh/web/path-traversal/path-traversal-bypass-via-double-url-decoding.md">通过双重 URL 解码绕过路径遍历</a></td></tr><tr><td><a href="/zh/web/path-traversal/path-traversal-bypass-with-null-byte-and-extension-validation.md">使用空字节和扩展名验证绕过路径遍历</a></td></tr><tr><td><a href="/zh/web/path-traversal/path-traversal-sequences-stripped-without-recursive-processing.md">在未进行递归处理时剥离路径遍历序列</a></td></tr><tr><td><a href="/zh/web/path-traversal/path-traversal-with-absolute-bypass-when-sequences-are-blocked.md">在序列被阻止时通过绝对路径绕过路径遍历</a></td></tr><tr><td><a href="/zh/web/path-traversal/path-traversal-with-absolute-path-bypass-when-sequences-are-blocked.md">在序列被阻止时通过绝对路径绕过路径遍历</a></td></tr><tr><td><a href="/zh/web/path-traversal/path-traversal-with-start-of-path-validation.md">起始路径验证的路径遍历</a></td></tr><tr><td><a href="/zh/web/path-traversal/validating-the-start-of-the-path-directory-traversal.md">验证路径开头的目录遍历</a></td></tr></tbody></table>


---

# 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/path-traversal.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.
