Network traffic analysis is the foundation of security monitoring, providing visibility into what's happening on your network at the packet level. It's essential for detecting threats that bypass other security controls.
Identify malicious activity such as command and control (C2) communications, data exfiltration, lateral movement, and reconnaissance activities.
Reconstruct attack timelines, identify compromised systems, and understand attacker tactics, techniques, and procedures (TTPs).
Packet captures provide irrefutable evidence of network activity, essential for legal proceedings and post-incident analysis.
Meet regulatory requirements for network monitoring, detect policy violations, and ensure secure configurations.
Network traffic analysis complements other security layers (endpoint, application, perimeter). Attackers often evade one control but leave network traces. By analyzing packets, you see the ground truth of what actually happened on the wire.
According to the SANS Institute, organizations with strong network traffic analysis capabilities detect breaches 3-5 times faster than those without, reducing average dwell time from months to days.
A PCAP is a complete copy of network packets as they traverse the network. It includes all headers, payloads, and metadata - everything transmitted on the wire.
Command-line packet analyzer. Lightweight and powerful for quick captures.
GUI-based protocol analyzer. Industry standard for deep packet inspection and analysis.
Features: Protocol dissection, flow reconstruction, expert analysis, statistics
Command-line version of Wireshark for automated analysis and scripting.
Network taps, SPAN ports, full packet capture appliances (e.g., Gigamon, NetScout, SecurityOnion)
Always obtain proper authorization before capturing network traffic. PCAPs may contain sensitive data (passwords, personal information, proprietary data). Follow your organization's data handling policies and legal requirements.
| Protocol | Port(s) | Security Relevance | Key Indicators |
|---|---|---|---|
| HTTP/HTTPS | 80, 443 | Web traffic, C2 channels, exfiltration | User-agents, POST data, TLS certificates |
| DNS | 53 | Domain lookups, tunneling, DGA detection | Query volume, subdomain length, entropy |
| SMB | 445, 139 | Lateral movement, file sharing, ransomware | Authentication attempts, file access patterns |
| RDP | 3389 | Remote access, credential attacks | Connection frequency, source IPs |
| SSH | 22 | Remote shell, tunneling, brute force | Failed auth attempts, unusual sources |
| FTP | 21, 20 | Data transfer, credential exposure | Cleartext passwords, large transfers |
SYN - Connection initiation (watch for SYN floods)ACK - Acknowledgment (normal in established connections)FIN - Graceful connection closeRST - Abrupt connection reset (may indicate blocks, errors, scans)PSH - Push data immediately (interactive traffic)URG - Urgent data (rarely used, may indicate anomaly)What it captures: Flow records with 5-tuple (src IP, dst IP, src port, dst port, protocol) + byte counts, packet counts, timestamps
Pros:
Cons:
What it captures: Complete packets including all headers and payloads
Pros:
Cons:
Modern SOCs use a tiered strategy:
| Scenario | NetFlow | PCAP |
|---|---|---|
| Identify top talkers and bandwidth hogs | ✓ Ideal | ~ Overkill |
| Detect port scanning activity | ✓ Ideal | ✓ More detail |
| Extract malware from HTTP session | ✗ Impossible | ✓ Required |
| Follow TCP stream to read commands | ✗ Impossible | ✓ Required |
| Identify beaconing intervals | ✓ Ideal | ✓ Works |
| Track lateral movement over 30 days | ✓ Ideal | ✗ Storage limits |
You cannot detect abnormal traffic without understanding what's normal for your environment. Baselines establish expected behavior patterns.
Indicator: Sudden spikes or drops in traffic volume
Possible Threats: Data exfiltration, DDoS, service outage, crypto mining
Indicator: Traffic during off-hours (2 AM on Sunday)
Possible Threats: Insider threat, compromised credentials, automated malware
Indicator: Workstation initiating SMB to 50 hosts in 5 minutes
Possible Threats: Lateral movement, ransomware propagation, credential harvesting
Indicator: Connections to countries where you have no business presence
Possible Threats: C2 servers, compromised accounts, data exfiltration
After initial compromise, malware establishes communication with attacker-controlled infrastructure to receive commands and exfiltrate data. Detecting C2 is critical for early threat containment.
Regular, periodic communication intervals indicating automated check-ins.
Indicators:
Encoding data in DNS queries/responses to bypass firewall restrictions.
Indicators:
Malware generates random-looking domains to evade blocklists.
Indicators:
C2 traffic often uses HTTPS to hide in encrypted traffic.
Indicators:
Attackers steal data through various network channels. Detecting exfiltration requires understanding normal data flow patterns and identifying deviations.
Indicator: Gigabytes of data leaving the network to external IPs
Detection:
Indicator: FTP, TFTP, or custom ports used unexpectedly
Detection:
Indicator: Data hidden in images, DNS, or ICMP packets
Detection:
Indicator: Uploads to Dropbox, Google Drive, OneDrive from unexpected hosts
Detection:
An attacker exfiltrated 200GB of customer data over 60 days using HTTPS to a compromised WordPress site. NetFlow showed the pattern: daily uploads of 3-5GB during off-hours. Baseline analysis revealed this server normally had <100MB daily uploads. Alert triggered investigation, leading to breach containment.
After initial compromise, attackers move through the network to access additional systems, escalate privileges, and reach high-value targets. Network traffic analysis is essential for detecting this activity.
Attack Techniques:
Detection Indicators:
Attack Techniques:
Detection Indicators:
Attack Techniques:
Detection Indicators:
Attack Techniques:
Detection Indicators:
Attackers increasingly use legitimate Windows tools (PsExec, PowerShell, WMI) for lateral movement, making detection harder. Network traffic analysis must focus on behavioral anomalies rather than just known-bad signatures.
Before exploitation, attackers gather information about the target network - open ports, services, vulnerabilities, and network topology. Detecting recon early can prevent full compromise.
Description: Systematic probing of ports to identify open services
Types:
Detection:
Indicators:
Description: Discovering live hosts on local network segment
Detection:
Indicators:
Description: Using ICMP echo requests to find live hosts
Detection:
Indicators:
Description: Banner grabbing and service version detection
Indicators:
| Activity | Legitimate | Suspicious |
|---|---|---|
| Port scanning | Authorized vulnerability scanner from known IP | Unknown external IP scanning all hosts |
| ICMP requests | Monitoring tool pinging specific servers | Workstation pinging entire subnet |
| Service connections | Application connecting to database | User workstation connecting to all servers on port 22 |
Maintain an inventory of authorized scanning tools (IP addresses, schedules). Any scanning activity outside this inventory should trigger alerts. Use reputation feeds to identify known scanner IPs (Shodan, Censys).
Display filters allow you to slice through massive packet captures to find exactly what you need. Mastering filter syntax is critical for efficient analysis.
Reconstructs entire conversation between client and server. Essential for:
Capture filters (BPF syntax) limit what's captured: tcpdump -i eth0 'tcp port 80'
Display filters (Wireshark syntax) control what's shown in already-captured data: http.request.method == "GET"
Use capture filters to reduce file size, display filters for analysis flexibility.
Over 95% of web traffic uses HTTPS/TLS. While encryption protects privacy, it also hides malicious activity. Analysts must use metadata analysis since payload inspection is not possible.
What to examine:
Red flags:
Domain name sent in cleartext during TLS handshake
Analysis value:
JA3 creates a fingerprint from TLS client hello parameters (TLS version, cipher suites, extensions, elliptic curves, formats). The fingerprint identifies the client application, not the user.
JA3S does the same for server hello, identifying the server configuration.
Tools: ja3er.com (JA3 database), Zeek, Suricata
Method: Analyze connection frequency and payload sizes despite encryption
Method: Detect large HTTPS uploads to unusual destinations
TLS 1.3 encrypts more of the handshake, and Encrypted SNI (ESNI) hides the server name. This reduces metadata visibility. Analysts must increasingly rely on behavioral analytics, machine learning, and endpoint telemetry to detect threats in encrypted traffic.
When responding to an incident, follow a systematic workflow to ensure thorough analysis and defensible findings.
| Tool | Purpose | Key Features |
|---|---|---|
| Wireshark | Interactive analysis | Protocol dissection, stream following, expert info |
| NetworkMiner | Automated artifact extraction | File extraction, OS fingerprinting, session reconstruction |
| Zeek (Bro) | Log generation from PCAPs | Protocol logs, file extraction, scripting capability |
| Moloch | Full packet capture indexing | Fast search, tagging, PCAP retrieval at scale |
| Security Onion | Complete NSM platform | IDS, PCAP, Zeek, visualization, hunting |
Don't just explore PCAPs randomly. Start with a hypothesis based on alerts, IOCs, or anomalies. Example: "I suspect this host is exfiltrating data via DNS tunneling." Then use filters and analysis techniques to prove or disprove the hypothesis systematically.
Congratulations! You've completed the Network Traffic Analysis presentation. You now have the foundational knowledge to analyze packets, detect threats, and conduct network forensics at a SOC Analyst / CySA+ level.
Click "Complete Module" below to mark this presentation as finished and unlock the next components.