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

# Replacing Web Images with Xerosploit

Replace images in unencrypted web traffic during a controlled Xerosploit lab.

Xerosploit provides a `replace` module for replacing images in unencrypted web traffic.

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

### Install Xerosploit

Run the installer:

{% code overflow="wrap" %}

```bash
python3 install.py
```

{% endcode %}

<figure><img src="https://131707722-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>

### Start the tool

Launch Xerosploit:

{% code overflow="wrap" %}

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

{% endcode %}

<figure><img src="https://131707722-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>

### Available commands

* `scan` maps the network.
* `iface` sets the network interface.
* `gateway` sets the gateway.
* `start` sets a target IP address without scanning.
* `rmlog` deletes Xerosploit logs.
* `help` displays the available commands.
* `exit` closes Xerosploit.

<figure><img src="https://131707722-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>

### Set the lab device

Set the test device IP address:

<figure><img src="https://131707722-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 %}

### Run the replace module

Select the `replace` module:

<figure><img src="https://131707722-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>

Choose `replace`, then run the module. Load the image file to use:

<figure><img src="https://131707722-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>

Use this image path:

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

<figure><img src="https://131707722-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>

Web pages visited by the test device now display the replacement image. This applies only to unencrypted HTTP traffic.

The tool can also show images loaded by the selected device.


---

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