Network Sniffing
Sniffing is capturing and analysing the traffic flowing across the network. On a modern switched network you only see your own traffic by default, but combined with interception techniques (ARP spoofing, see ARP Spoofing and Man-in-the-Middle) or with access to a strategic point (span port, compromised gateway), you capture other hosts’ traffic. What you find: cleartext credentials, tokens, session cookies, authentication hashes and any information that travels unencrypted.
Threat model
Section titled “Threat model”Passive sniffing generates no traffic and is very hard to detect; active sniffing (requires getting in the middle) is detectable but grants access to other hosts’ traffic. The defensive key is to assume the network may be listened to and protect the content with encryption: what does not travel in the clear is not harvested even if someone captures the packets. The attacker needs, besides the capture, an observation point with interesting traffic.
flowchart LR
T["Network traffic"] --> C["Capture (tcpdump/wireshark)"]
C --> F[Filter by protocol/host]
F --> E["Extraction: credentials, hashes, files, sessions"]
E --> X["Offline cracking / reuse"]
What can be captured
Section titled “What can be captured”- Plaintext credentials: Telnet, FTP, HTTP, SMTP/POP3/IMAP without TLS.
- Authentication hashes: Net-NTLMv2 (Windows SMB/HTTP → see LLMNR / NBT-NS / mDNS Poisoning).
- Session cookies and tokens over unencrypted HTTP.
- Metadata: who talks to whom, which services are used, network structure.
- Even with TLS: SNI (which domains are visited), certificates, packet sizes and timings.
Capture tools
Section titled “Capture tools”tcpdump -i eth0 -w capture.pcap # capture to file (lightweight, CLI)tcpdump -i eth0 'port 80 or port 21' # filter by porttshark -r capture.pcap -Y 'http.request' # Wireshark on the command linengrep -d eth0 -q 'password' # search for patterns in live trafficFor deep graphical analysis, open the .pcap with Wireshark. To extract credentials and hashes automatically from a pcap or live, use PCredz or net-creds.
Useful Wireshark display filters
Section titled “Useful Wireshark display filters”http.request— HTTP requests.http.authorization— authentication headers.ftp || telnet— cleartext protocols.ntlmssp— NTLM authentication (hashes).tcp.port == 445— SMB.ip.addr == 10.0.0.5— filter by host.frame contains "password"— search by content.
Red Team: capturing traffic that is not yours
Section titled “Red Team: capturing traffic that is not yours”On a switched network you need an interception point. The options:
- Promiscuous mode plus active interception via ARP spoofing to get in the middle (see ARP Spoofing and Man-in-the-Middle).
- Access to a switch SPAN/mirror port, a network tap or a compromised gateway.
- Open or WEP WiFi: direct capture; WPA requires the key or the handshake (see WiFi).
Extracting the loot from a pcap
Section titled “Extracting the loot from a pcap”./Pcredz -f capture.pcap # cards, NTLM hashes, HTTP auth...hashcat -m 5600 hashes.txt rockyou.txt # crack Net-NTLMv2 offlineIn Wireshark, additionally: File > Export Objects > HTTP/SMB/FTP recovers transferred files, and Follow > TCP Stream reconstructs a full session. Extracted Net-NTLMv2 hashes are cracked offline (see Cryptography Fundamentals).
Blue Team
Section titled “Blue Team”Encrypt everything: HTTPS/TLS everywhere, SSH instead of Telnet, FTPS/SFTP, SNMPv3 and a VPN for sensitive traffic. On the network:
- Disable unencrypted legacy protocols.
- 802.1X and port security against unauthorized connections that could receive a mirror.
- Detection of promiscuous mode and ARP spoofing (arpwatch, Dynamic ARP Inspection).
- Segmentation to limit what traffic is reachable from a compromised point.
Checklist
Section titled “Checklist”- Capture traffic from your own segment (tcpdump/wireshark)
- Filter cleartext protocols (HTTP, FTP, Telnet, SMTP)
- Look for credentials/cookies/tokens in the traffic
- Extract Net-NTLMv2 hashes (ntlmssp) and crack them
- Export transferred files from the pcap
- Follow full TCP streams to reconstruct sessions
- Combine with ARP spoofing for other hosts’ traffic (ARP Spoofing)
- Automate extraction with PCredz/net-creds