Access Denied - Please log in to view this lesson.

Packet Sniffing

Packet sniffing is the process of capturing, analyzing, and inspecting network packets to monitor data transmission. It is commonly used in cybersecurity to observe network behavior, discover vulnerabilities, and in some cases, extract sensitive information.

How does packet sniffing work?

Normally, a network interface card (NIC) only receives packets intended for it. In sniffing, we put the NIC into "promiscuous mode" to capture all packets flowing through the network segment, regardless of destination.

Popular tools for sniffing:

Useful tcpdump commands:

sudo tcpdump -i eth0
sudo tcpdump -i wlan0 port 80
sudo tcpdump -A -i eth0 'tcp and port 443'

Sniffing with Wireshark:

Sniffing in MITM attacks:

After performing ARP spoofing, the attacker can act as a bridge and sniff all traffic passing between the victim and the router.

sudo bettercap -iface wlan0
net.probe on
net.sniff on

Dangers of packet sniffing:

How to protect against sniffing:

Summary:

Packet sniffing is a double-edged sword. For attackers, it's a powerful reconnaissance tool. For defenders, it's essential for monitoring, troubleshooting, and detecting anomalies. Mastering sniffing techniques helps in both offense and defense in cybersecurity.