> 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/hacking-wifi/wpa-wpa2-psk-network-attacks/traffic-manipulation/replacing-web-images-with-xerosploit.md).

# 使用 Xerosploit 替换网页图片

在受控的 Xerosploit 实验中替换未加密 Web 流量中的图片。

Xerosploit 提供一个 `替换` 用于替换未加密 Web 流量中图像的模块。

{% embed url="<https://github.com/lionsec/xerosploit/>" %}

### 安装 Xerosploit

运行安装程序：

{% code overflow="wrap" %}

```bash
python3 install.py
```

{% endcode %}

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FGGr6v6RAmZxRNoPJGGuk%2Fimage.png?alt=media&amp;token=5d20751f-57c8-4961-bfb1-67431502c8d2" alt=""><figcaption></figcaption></figure>

### 启动工具

启动 Xerosploit：

{% code overflow="wrap" %}

```bash
sudo python3 xerosploit.py
```

{% endcode %}

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FEwguzgEU2ba6owrbNL8e%2Fimage.png?alt=media&amp;token=97a7c85d-45e5-415d-b42a-9986abcd822d" alt=""><figcaption></figcaption></figure>

### 可用命令

* `扫描` 映射网络。
* `iface` 设置网络接口。
* `gateway` 设置网关。
* `启动` 无需扫描即可设置目标 IP 地址。
* `rmlog` 删除 Xerosploit 日志。
* `帮助` 显示可用命令。
* `退出` 关闭 Xerosploit。

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FypfDsG63SzenRE048EMZ%2Fimage.png?alt=media&amp;token=4597026a-4a7e-480f-8080-f7113c5f99c2" alt=""><figcaption></figcaption></figure>

### 设置实验设备

设置测试设备 IP 地址：

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FR6ZfPczvBUFBhWdbxwcE%2Fimage.png?alt=media&amp;token=667f2887-7911-4705-823d-a399c6da842f" alt="" width="536"><figcaption></figcaption></figure>

{% code overflow="wrap" %}

```bash
172.20.10.2
```

{% endcode %}

### 运行替换模块

选择 `替换` 模块：

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FDn5RLWSfp6MdvnifdovR%2Fimage.png?alt=media&amp;token=cbb2082e-2cfa-45b3-a02c-aaaf2e90f095" alt=""><figcaption></figcaption></figure>

选择 `替换`，然后运行该模块。加载要使用的图像文件：

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FanbnnmzxiwoWMgQl2z5r%2Fimage.png?alt=media&amp;token=f30ca38d-cb5c-45fe-a9d1-0a0a662e4aa0" alt="" width="563"><figcaption></figcaption></figure>

使用此图像路径：

`/home/jordan/Downloads/pwned.jpeg`

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FAUd6y7nmOv3Kzdo3rygZ%2Fimage.png?alt=media&amp;token=47d78dc0-4983-4164-8c27-8543e687b114" alt=""><figcaption></figcaption></figure>

测试设备访问的网页现在会显示替换后的图像。这仅适用于未加密的 HTTP 流量。

该工具还可以显示所选设备加载的图像。


---

# 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/hacking-wifi/wpa-wpa2-psk-network-attacks/traffic-manipulation/replacing-web-images-with-xerosploit.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.
