MAC Flooding Attacks
What you'll learn: How attackers can force a network switch to act like a basic hub, turning switched traffic into broadcast traffic you can sniff.
Why Switches Normally Block Sniffing
You learned in the previous lesson that switches are smart. They maintain a CAM table (Content Addressable Memory) — essentially a phone book mapping MAC addresses to physical switch ports. This way, a switch only forwards frames to the specific port where the destination device lives, preventing your sniffer from seeing other people's traffic.
The Attack: Flooding the Phone Book
Every switch's CAM table has limited memory. A MAC flooding attack exploits this by bombarding the switch with thousands of fake Ethernet frames, each from a different, invented MAC address.
Analogy: Imagine a receptionist's desk with a small notepad listing which office each employee sits in. An attacker floods the lobby with thousands of fake visitors, each claiming a unique name. The receptionist runs out of notepad space and gives up — now they just announce every visitor's arrival over the loudspeaker to the whole building.
What Happens When CAM Overflows
When the CAM table fills up completely, the switch can no longer remember which MAC addresses belong on which ports. It fails open and enters a hub-like mode, broadcasting all incoming frames out every port. Now your packet sniffer sees everything—just like on an old hub network.
Real-World Impact
Tools like macof can generate millions of random MAC addresses per minute. Once the switch is flooded, attackers can capture credentials, session tokens, and sensitive data traversing the network until the CAM table stabilizes (or an admin notices).
Key Takeaway: MAC flooding attacks overwhelm a switch's CAM table with fake MAC addresses, forcing it to broadcast all traffic like a hub and enabling passive sniffing across the entire switched network.