> 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/post-exploitation.md).

# 后渗透

初始访问后的操作说明：稳定 shell、传输文件、通过内部网络进行转移、验证已授权的持久化、恢复有用的工件，并在不影响可重复性的前提下记录证据。

## 后渗透技术

<table data-view="cards" data-full-width="false" data-search="false"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><h3><i class="fa-folder-tree" style="color:$primary;">:folder-tree:</i></h3></td><td><h4>端口转发技术</h4></td><td>使用 SSH、chisel、socat、ligolo-ng、Meterpreter 和 Windows 工具，通过被攻陷主机进行跳板转移的端口转发技术。</td><td><a href="/pages/6299e11b56861adcb5fbae2feda443faabc03d13">/pages/6299e11b56861adcb5fbae2feda443faabc03d13</a></td></tr><tr><td><h3><i class="fa-folder-tree" style="color:$primary;">:folder-tree:</i></h3></td><td><h4>文件传输</h4></td><td>渗透测试文件传输速查表：使用 HTTP、SMB、Netcat、PowerShell、SCP、certutil、wget 和 curl 传送载荷和证据。</td><td><a href="/pages/7e48128022ad77158982510bcbd286d29200a2ad">/pages/7e48128022ad77158982510bcbd286d29200a2ad</a></td></tr><tr><td><h3><i class="fa-rotate" style="color:$primary;">:rotate:</i></h3></td><td><h4>Linux 持久化</h4></td><td>针对用户账户、SSH 密钥、cron 任务、启动脚本、Web 访问验证、报告和清理的已授权 Linux 持久化说明。</td><td><a href="/pages/a5a90d6982a21c70c05b821d4910d3a80273584c">/pages/a5a90d6982a21c70c05b821d4910d3a80273584c</a></td></tr><tr><td><h3><i class="fa-key" style="color:$primary;">:key:</i></h3></td><td><h4>无需密码启动 Linux</h4></td><td>Linux 启动密码重置说明，涉及编辑 GRUB 条目、进入 root shell、重新挂载文件系统，以及在授权实验环境中恢复访问。</td><td><a href="/pages/6a88a9d399f510a43f8315f8ac676fe70ae1c20a">/pages/6a88a9d399f510a43f8315f8ac676fe70ae1c20a</a></td></tr><tr><td><h3><i class="fa-folder-tree" style="color:$primary;">:folder-tree:</i></h3></td><td><h4>升级 Linux 非交互式 Shell</h4></td><td>Linux TTY 稳定化指南：使用 Python、script、stty、rlwrap、socat 以及终端环境修复来升级非交互式 shell。</td><td><a href="/pages/52445cb5c72987d7240715fbe8e49de5aad5d758">/pages/52445cb5c72987d7240715fbe8e49de5aad5d758</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>从 RBash 逃逸到正常 Bash</h4></td><td>受限 Bash 逃逸说明：绕过 rbash 限制、恢复命令执行、修复 PATH 问题，并升级到正常的 Linux shell。</td><td><a href="/pages/d0e3803d858870995b8856be2fc7f53a7c5a7a49">/pages/d0e3803d858870995b8856be2fc7f53a7c5a7a49</a></td></tr><tr><td><h3><i class="fa-python" style="color:$primary;">:python:</i></h3></td><td><h4>从 Python 逃逸到正常 Bash</h4></td><td>Linux shell 升级说明：从受 Python 限制的 shell 中逃逸、启动交互式 Bash、稳定 TTY 会话，并提升后渗透可用性。</td><td><a href="/pages/0a9fab54e6d8bda9c490e964901e10baa17e5b02">/pages/0a9fab54e6d8bda9c490e964901e10baa17e5b02</a></td></tr><tr><td><h3><i class="fa-server" style="color:$primary;">:server:</i></h3></td><td><h4>在 PowerShell 中查看历史记录</h4></td><td>PowerShell 历史记录查看说明：查找 PSReadLine 命令历史、审计已执行命令，并提取有用的 Windows 后渗透线索。</td><td><a href="/pages/a06c3d9077728c272646750a4087adacb6c627dc">/pages/a06c3d9077728c272646750a4087adacb6c627dc</a></td></tr><tr><td><h3><i class="fa-folder-tree" style="color:$primary;">:folder-tree:</i></h3></td><td><h4>替代数据流（ADS）</h4></td><td>Windows 替代数据流（ADS）说明：在 NTFS 文件中隐藏数据、发现数据流、提取内容，并在渗透测试期间验证取证证据。</td><td><a href="/pages/7db752be04c1e828045f93f4ad48db23877d366e">/pages/7db752be04c1e828045f93f4ad48db23877d366e</a></td></tr><tr><td><h3><i class="fa-key" style="color:$primary;">:key:</i></h3></td><td><h4>KeePass 内存转储（.mdp）</h4></td><td>KeePass 内存转储说明：从进程内存中提取密码候选项、处理 .mdp 工件，并安全地验证恢复的凭据。</td><td><a href="/pages/5b4eaadd987501b599dffcbd92bc5757262b940f">/pages/5b4eaadd987501b599dffcbd92bc5757262b940f</a></td></tr><tr><td><h3><i class="fa-key" style="color:$primary;">:key:</i></h3></td><td><h4>提取 Firefox 配置文件凭据</h4></td><td>Firefox 凭据提取说明：定位浏览器配置文件、恢复已保存的登录信息、处理密钥数据库，并审计暴露的用户机密。</td><td><a href="/pages/b2ef4f807ccf8c7bef670c05d138592b1ac867be">/pages/b2ef4f807ccf8c7bef670c05d138592b1ac867be</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>将 PuTTY 密钥转换为 OpenSSH</h4></td><td>PuTTY 到 OpenSSH 密钥转换指南，涵盖 PPK 导出、私钥格式更改、SSH 身份验证以及基于密钥访问的故障排查。</td><td><a href="/pages/ee5af24d4e15907b96ae58442c6a7d159d71e479">/pages/ee5af24d4e15907b96ae58442c6a7d159d71e479</a></td></tr><tr><td><h3><i class="fa-check-to-slot" style="color:$primary;">:check-to-slot:</i></h3></td><td><h4>Windows 横向移动（PowerShell）</h4></td><td>Windows PowerShell 横向移动说明：用于端口转发、代理流量、通过被攻陷主机建立隧道，以及测试内部网络可达性。</td><td><a href="/pages/23c4468c62ebc4aa664fd557a0bf6994ef3eb4b5">/pages/23c4468c62ebc4aa664fd557a0bf6994ef3eb4b5</a></td></tr><tr><td><h3><i class="fa-check-to-slot" style="color:$primary;">:check-to-slot:</i></h3></td><td><h4>WinRM（5985）端口转发跳板</h4></td><td>WinRM 5985 转移说明：用于转发远程管理流量、访问内部 Windows 服务，并验证横向移动路径。</td><td><a href="/pages/c0c71d414af2ec9e094ce6bbda3d1e3aebe8fa6e">/pages/c0c71d414af2ec9e094ce6bbda3d1e3aebe8fa6e</a></td></tr></tbody></table>

### 工作流程

1. 先稳定访问：升级 shell、确认环境细节，并准备可靠的文件传输。
2. 谨慎移动工具和证据，保留命令历史和时间戳，以便用于报告。
3. 仅在绘制出可达的内部服务后，再建立跳板或端口转发。
4. 仅在明确授权时验证持久化，并将清理命令与证据放在一起。
5. 检查凭据工件，例如历史记录、内存转储、浏览器配置文件、密钥文件和 ADS。
6. 记录确切的命令、路径、端口、凭据和截图，以确保可复现性。

## 导航指南

* 使用 [文件传输](/zh/post-exploitation/file-transfer.md) 在获得有限立足点后，立即查看 shell 升级页面。
* 使用 [Linux 持久化](/zh/post-exploitation/linux-persistence.md) 当本次工作允许进行可重复的访问验证时。
* 使用 [端口转发技术](/zh/post-exploitation/port-forwarding-techniques.md) 以及在内部服务无法直接访问时查看跳板转移页面。
* 使用 PowerShell、KeePass、Firefox、PuTTY 和 ADS 页面进行以工件为重点的后渗透检查。
* 使用 [无需密码启动 Linux](/zh/post-exploitation/boot-linux-without-password.md) 用于本地访问恢复练习。


---

# 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/post-exploitation.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.
