Generating, capturing, saving, and analyzing traffic with tcpdump
and Wireshark across a two-VM lab (Kali + Ubuntu).
This lab demonstrates how to monitor and analyze network traffic using tcpdump
and Wireshark. You’ll see how to generate realistic traffic (including simulated malicious activity), capture it, save it to PCAP, and perform targeted analysis.
Environment: Two VMs on a virtual network — Kali Linux (traffic generation, tcpdump
, Wireshark) and Ubuntu (target with ports 22 and 80 open).
tcpdump
commands and filtered captures..pcap
and analyze with Wireshark.tcpdump
?tcpdump
is a CLI packet capture tool. Its flexible filtering and ability to write PCAPs make it a core utility in security workflows.
tcpdump
tcpdump -i eth0
– capture all traffic on the interface.tcpdump -i eth0 port 80
– focus on HTTP.tcpdump -i eth0 src 10.38.1.113 and dst port 22
– SSH from Kali to Ubuntu.Run a sweep/scan from Kali using arp-scan
, fping
, and nmap -sn
to find live hosts. The first three can create significant ARP traffic.
Establish SSH from Kali to Ubuntu and use scp
to move files.
Use hping3
to craft suspicious packets and floods.
Write traffic to a PCAP for later analysis:
tcpdump -i eth0 -w network_capture.pcap
network_capture.pcap
.Below are representative findings from the capture.
Large bursts of ARP requests/replies reveal active hosts and MAC addresses (classic network mapping behavior).
ICMP echo requests across ranges quickly reveal which hosts are up.
SYN scans probe many ports; closed ports reset, open ones reply with SYN/ACK.
Rapid SYNs without completion create half-open connections — classic DoS symptom.
Deliberate fragmentation (MF flag) can stress reassembly and slip past defenses.
Example: hping -S -p 443 -d 100 --data "malicious payload" 10.38.1.116
— target replies with RST,ACK
indicating rejection of unexpected traffic.
Example: hping3 -S -p 80 --spoof 192.168.1.100 10.38.1.116
— packets show forged source IP, masking origin.
tcpdump
and Wireshark provide critical visibility for detection and troubleshooting — from spotting reconnaissance to confirming legitimate encrypted transfers — and are foundational tools for defenders.