Study guide

4.3 Sniffing Concepts and Layer 2 Attacks

EC-Council Certified Ethical Hacker CEH

Track your progress as you read

Finished sections get a check mark.

1 Introduction & Exam Overview

1.1 CEH Exam Format, Cost & Eligibility 1.2 The Five Phases of Ethical Hacking 1.3 Information Security Fundamentals 1.4 Ethical Hacking Concepts, Scope & Legal Framework 1.5 The CEH Domains & Your Study Priority Map

2 Reconnaissance, Footprinting, Scanning & Enumeration

2.1 Footprinting & Reconnaissance Concepts 2.2 Footprinting Sources & Techniques 2.3 Network Scanning Concepts 2.4 Banner Grabbing, OS Fingerprinting & Scanning Beyond IDS/Firewall 2.5 Enumeration 2.6 Vulnerability Scanning & Countermeasures

3 Vulnerability Analysis & System Hacking Phases

3.1 Vulnerability Analysis Concepts 3.2 System Hacking Methodology Overview 3.3 Gaining Access: Password Attack Concepts 3.4 Privilege Escalation Concepts 3.5 Maintaining Access: Backdoors, Rootkits & Persistence 3.6 Covering Tracks, Anti-Forensics & Blue-Team Detection

4 Malware Threats, Sniffing & Social Engineering

4.1 Malware Concepts and Taxonomy 4.2 Malware Analysis and Detection 4.3 Sniffing Concepts and Layer 2 Attacks 4.4 Sniffing Countermeasures and Detection 4.5 Social Engineering Types and Human Psychology 4.6 Social Engineering and Insider Threat Defenses

5 Network & Perimeter Hacking

5.1 Denial of Service and DDoS Attacks 5.2 Session Hijacking 5.3 Evading IDS and IPS (Defensive Focus) 5.4 Evading Firewalls 5.5 Evading Honeypots and Defensive Deception 5.6 Network Security Controls and Architecture 5.7 Packet Analysis and Secure Protocols for Defenders

6 Web Server & Web Application Hacking

6.1 Web Server Attacks & Hardening 6.2 OWASP Top 10 Overview 6.3 Injection: SQL Injection & Command Injection 6.4 Cross-Site Scripting (XSS) & CSRF 6.5 Authentication, Session & Access-Control Flaws 6.6 API & Web App Security Testing Concepts

7 Wireless Network Hacking

7.1 Wireless Concepts and Standards 7.2 Wireless Encryption 7.3 Wireless Threats and Attack Concepts 7.4 Wireless Security Countermeasures

8 Mobile Platform, IoT & OT Hacking

8.1 Mobile Platform Threats & Security Models 8.2 Mobile Attack Vectors & Risks 8.3 Mobile Device Management & Enterprise Defense 8.4 IoT Hacking Concepts & Defense 8.5 OT, ICS & SCADA Security

9 Cloud Computing & Cryptography

9.1 Cloud Computing Concepts 9.2 Cloud Threats & Attack Surfaces 9.3 Cloud Security Controls 9.4 Cryptography Fundamentals 9.5 PKI & Cryptographic Applications 9.6 Cryptanalysis, Crypto Attacks & Best Practices

4.3 Sniffing Concepts and Layer 2 Attacks

Key Takeaways Explain This Topic AI

Passive sniffing only captures traffic that already reaches the attacker (hubs, mirrored/SPAN ports, broadcast/multicast); active sniffing manipulates the network to force traffic to the attacker.

Switches forward unicast frames only to the destination port, so attackers attack the switch's logic (CAM table, ARP, DHCP), not the wire.

ARP poisoning works because ARP has no authentication; forged ARP replies let an attacker become a man-in-the-middle for two hosts.

MAC flooding overflows the switch CAM table so the switch fails open and floods frames like a hub, restoring passive visibility.

Wireshark and tcpdump are the standard capture tools; promiscuous mode grabs all frames on a shared segment, and a SPAN/mirror port is how you legitimately capture on a switch.

Last updated: June 2026

Passive vs Active Sniffing

Sniffing is capturing and inspecting network traffic. CEH frames it as both an authorized analysis skill (troubleshooting, IDS, security monitoring) and an attack technique. The first distinction is passive vs active .

Passive sniffing captures only the traffic that already reaches the attacker's NIC . To see frames not addressed to it, the NIC must run in promiscuous mode , which tells the card to pass every frame up to the OS regardless of destination MAC. Passive sniffing works on legacy hubs (which repeat every frame to every port), on broadcast/multicast traffic, and on a SPAN/mirror port where a switch is configured to copy traffic to a monitoring port. It generates no extra traffic and is hard to detect.

Active sniffing is required on a switched network , because a switch forwards a unicast frame only to the port of the destination MAC (it learns MAC-to-port mappings in its CAM/MAC address table ). The attacker therefore cannot passively see other hosts' traffic — so active sniffing manipulates the switch or protocols to redirect or flood traffic to the attacker. The key insight CEH tests: on a switch, you attack the device's logic and trust assumptions (ARP, DHCP, DNS, CAM table), not the physical wire.

The standard capture tools are Wireshark (GUI analysis with powerful display filters like http , ip.addr==10.0.0.5 , tcp.port==443 ), tcpdump/tshark (CLI capture and automation), and Cain & Abel/Ettercap/Bettercap for active MITM.

Layer 2 Attacks: MAC Flooding and ARP Poisoning

MAC flooding abuses the finite size of the switch CAM table . The attacker sends a torrent of frames with random, spoofed source MAC addresses (tools like macof ), filling the CAM table. When the table is full, many switches fail open — they stop learning and flood all unicast frames out every port like a hub . This restores passive visibility for the attacker and is essentially a DoS against the switch's filtering.

ARP poisoning (ARP spoofing) is the most-tested Layer 2 attack. The Address Resolution Protocol maps an IP to a MAC on the local segment, and it is stateless and unauthenticated — a host accepts an ARP reply even if it never sent a request (a gratuitous ARP ). The attacker sends forged ARP replies telling the victim "the gateway's IP is at my MAC" and tells the gateway "the victim's IP is at my MAC." Both poison their ARP caches and send traffic through the attacker, who becomes a man-in-the-middle (MITM) . From there the attacker can read cleartext, perform SSL stripping , or selectively modify traffic.

  • Attack Abused mechanism Result
  • MAC flooding Switch CAM table overflow Switch floods like a hub
  • ARP poisoning Unauthenticated ARP replies MITM between two hosts
  • MAC spoofing No port-to-MAC binding Impersonate another host
  • Switch port stealing ARP race for a victim's port Hijack frames

DHCP and DNS Attacks; Span-Port Capture

DHCP starvation floods the DHCP server with requests using spoofed source MAC addresses (tool: dhcpstarv /Yersinia), exhausting the pool of leasable IP addresses so legitimate clients can't get an address — a denial of service. It is often paired with a rogue DHCP server the attacker stands up: starve the real server, then hand victims a lease pointing at the attacker's IP as the default gateway and DNS server , achieving MITM by configuration.

DNS poisoning corrupts name resolution so a hostname resolves to an attacker IP. Variants include local hosts-file/cache poisoning , rogue-DHCP DNS (above), and DNS cache poisoning against a resolver. The victim types the right URL but lands on the attacker's server.

All of these share a root cause CEH wants you to recognize: unauthenticated control-plane protocols (ARP, DHCP, DNS) trust whatever they receive.

For authorized capture on a switch, defenders use a SPAN port (Switched Port Analyzer / port mirroring) : the switch copies traffic from one or more ports/VLANs to a designated monitor port where Wireshark or an IDS listens. Because switches isolate traffic, SPAN — not promiscuous mode — is the reliable, legitimate way to see full traffic on modern wired networks. A network TAP is the hardware equivalent and is preferred for forensics because it cannot drop frames under load.

Remember the layered targets: hub = passive sniffing trivially; switch = needs active sniffing (CAM/ARP/DHCP/DNS abuse); monitored switch = use SPAN/TAP for legitimate analysis.

Protocols at Risk and Wireshark in Practice

Sniffing matters because many legacy protocols carry credentials and data in cleartext . CEH wants you to know which protocols leak and what replaces them:

  • Cleartext protocol Port Leaks Secure replacement
  • Telnet 23 Login + session SSH (22)
  • FTP 21 Credentials + files SFTP / FTPS
  • HTTP 80 Cookies, form data HTTPS (443)
  • POP3 / IMAP / SMTP 110 / 143 / 25 Mail creds & content POP3S/IMAPS/SMTPS, STARTTLS
  • SNMP v1/v2c 161 Community strings SNMPv3
  • LDAP 389 Directory binds LDAPS (636)

When an attacker MITMs or captures a segment, these protocols hand over usable credentials directly — which is why sniffing pairs naturally with the credential-attack material elsewhere in CEH.

Wireshark is the tool you must understand operationally. syn==1 , dns ). Useful workflows CEH references: **Follow TCP/HTTP Stream** to reconstruct a conversation, **Statistics > Conversations/Endpoints** to spot top talkers, and **Export Objects** to pull files out of a capture. To capture beyond your own traffic you need **promiscuous mode** on a shared segment, or a **SPAN/mirror port** or **TAP** on a switch. pcap , and tshark automates analysis. Recognizing a filter, identifying a leaked credential in a stream, or naming the capture mechanism are all realistic exam tasks — and all are framed as authorized security analysis.