# ARP Cache poisoning

### Setup

Install arpspoof on Kali Linux (In my case it was not working before...)

> sudo apt install dsniff

Attacker IP: 192.168.71.131 (Kali Linux)

Target IP: 192.168.71.149 (Win10 Box)

Gateway IP: 192.168.71.1

> netstat -nr

![](https://3977837039-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MfT0VPyK6X13Egd9pzy%2F-MhhXNgvN7rwHmkmgxny%2F-Mhi4v8FiqtnBNIy4ydf%2Fmitm01.png?alt=media\&token=aca12a66-2b85-49d8-bdb5-f71d40566d99)

Let's ping target ip, gateway and check the arp cache:

> arp

<div align="left"><img src="https://3977837039-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MfT0VPyK6X13Egd9pzy%2F-MhhXNgvN7rwHmkmgxny%2F-Mhi5nlpSnxAbwfmN57N%2Fmitm02.png?alt=media&#x26;token=4dae8df5-7c17-42f4-abcd-086e73df2bd4" alt="arp cache"></div>

Attacker MAC Address:

<div align="left"><img src="https://3977837039-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MfT0VPyK6X13Egd9pzy%2F-MhhXNgvN7rwHmkmgxny%2F-MhiA2EjdLafhJ2zfZT5%2Fmitm03.png?alt=media&#x26;token=d21a6bf5-5228-4e42-a526-7f59cdb52370" alt=""></div>

ARP Cache on target before attack:

<div align="left"><img src="https://3977837039-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MfT0VPyK6X13Egd9pzy%2F-MhhXNgvN7rwHmkmgxny%2F-MhiHvQh7Tmo8IIe3lHf%2Fmitm06.png?alt=media&#x26;token=cba5547e-7903-422c-adb1-47f3d2cb3fed" alt=""></div>

### ARP Cache Poisoning

> arpspoof -i eth1 192.168.71.1 192.168.149
>
> arpspoof -i eth1 192.168.71.149 192.168.71.1

<div align="left"><img src="https://3977837039-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MfT0VPyK6X13Egd9pzy%2F-MhhXNgvN7rwHmkmgxny%2F-MhiGlycuaLcoVxJirmo%2Fmitm04.png?alt=media&#x26;token=cf4b29e1-a4b4-49fc-bdce-3419dd00800a" alt=""></div>

<div align="left"><img src="https://3977837039-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MfT0VPyK6X13Egd9pzy%2F-MhhXNgvN7rwHmkmgxny%2F-MhiGtcFvFzm5r1Tkpgx%2Fmitm05.png?alt=media&#x26;token=1713ad03-efa8-4782-b027-ce1fa4de294f" alt=""></div>

ARP Cache on target

<div align="left"><img src="https://3977837039-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MfT0VPyK6X13Egd9pzy%2F-MhhXNgvN7rwHmkmgxny%2F-MhiIxDLfvk0aS11NeAC%2Fmitm07.png?alt=media&#x26;token=555b089b-cc88-4358-8929-b7f51d81a0f2" alt=""></div>

### Grab credentials

On Kali Linux start Wireshark and listen on the eth1 interface.

On the windows box let's navigate to <http://testphp.vulnweb.com/login.php>

Enter some sample credentials here: test / SecurePassw0rd

In wireshark set a filter to http and search the POST Request

Follow HTTP Stream

![](https://3977837039-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MfT0VPyK6X13Egd9pzy%2F-MhhXNgvN7rwHmkmgxny%2F-MhiQ0jsBv0bDRYEz3-3%2Fmitm08.png?alt=media\&token=e805b725-d819-4c56-8c51-a41ac29955b9)

Follow the POST Request

![](https://3977837039-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MfT0VPyK6X13Egd9pzy%2F-MhhXNgvN7rwHmkmgxny%2F-MhiQCM2rfnj55TgtJvI%2Fmitm09.png?alt=media\&token=c5e0ec71-0b9a-4656-be71-789cf469935d)

Note: http is unencrypted and therefore we can see the password in cleartext.

If the connection would be https instead, it would be much harder (or impossible) to grab the password.&#x20;
