by Arvin Liu
140.112.31.87
140.112.31.88
So we needs 88's MAC to let switch forward.
src: 140.112.31.87
dst: 140.112.31.88
dst MAC: ???
87:87:87:87:87:87
88:88:88:88:88:88
<3
140.112.31.87
140.112.31.88
ARP Request
who has 140.112.31.88 ?
87:87:87:87:87:87
88:88:88:88:88:88
ARP Reply
140.112.31.88 is at
88:88:88:88:88:88
src ip: 140.112.31.87 src MAC: 87:87:87:87:87:87
dst ip: 140.112.31.88 dst MAC: 88:88:88:88:88:88
140.112.31.87
140.112.31.88
I know 140.112.31.88 => 88:88:88:88:88:88
87:87:87:87:87:87
88:88:88:88:88:88
ARP Reply
140.112.31.88 is at 89:89:89:89:89:89
140.112.31.89
89:89:89:89:89:89
89:89:89:89:89:89
(victim)
(attacker)
bridge
VM1 (victim)
ping 8.8.8.8
VM2 (attacker)
ARP spoofing
Redirect
Router
VM1 (victim)
VM2 (attacker)
Router
Gateway:
192.168.0.1
192.168.0.1
192.168.0.2
192.168.0.1 is at bb:b..
bb:bb:bb:bb:bb:bb
aa:aa:aa:aa:aa:aa
192.168.0.1 is at aa:a..
You can choose not to use these tools, though.
Ubuntu 20.04 already has python3.
Install pip (python package manager)
sudo apt install python3-pip
Install scapy
sudo pip install scapy==2.4.0
# or
sudo python3 -m pip install scapy==2.4.0
import all you can use.
from scapy.all import *
craft any protocol packet you want
pkt = IP(dst="127.0.0.1")
print(bytes(pkt))
# b'E\x00\x00\x14\x00\x ...
# Which is packet's raw bytes
using "/" to concat
udp_pkt = IP(dst="127.0.0.1") / UDP(dport=80, sport=65001)
send it!
send(udp_pkt)
UDP data "AAA"
udp_pkt = IP(dst="127.0.0.1") / UDP(dport=777, sport=8888) / b"AAA"
send(udp_pkt)
fake ARP Request
arp_pkt = ARP(op=ARP.who_has, psrc="1.1.1.1", pdst="8.8.8.8")
send(arp_pkt)
ARP Parmeters
op : ARP.who_has (ARP request) /
ARP.is_at (ARP response)
psrc : ip source (e.g. "127.0.0.1")
pdst : ip destination
hwsrc : MAC source (e.g. "08:00:27:1e:0f:88")
hwdst : MAC destination
Type command "arp".
VM1 (victim)
ping 8.8.8.8
VM2 (attacker)
ARP spoofing
Redirect
Router
ping 8.8.8.8 and highlight
1. ICMP request's Ethernet Src & Dst
2. victim's ip & MAC
highlight attackers ip & mac
ping 8.8.8.8 and highlight
ICMP request's Ethernet Src & Dst
Ether Dst must be equal to Attacker's MAC,
And these ICMP may not respond in a row.
Or you can webcast it :).
(If you cannot use bridge mode to ping 8.8.8.8, like you're using dorm's networks)
Router
Router
NAT
(+virtual router)
It should be "NAT Networks", not NAT.
if using NAT, your VMs cannot connect to each others.
VM 1
VM 2
1. They should have different IP & MAC
2. Can ping each others.
3. Can ping 8.8.8.8