<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->
<!-- NERF is a trademark of defconxt. -->
---
name: analyzing-c2-network-traffic
description: >-
  Analyze command and control network traffic to identify communication patterns, extract payloads, and map infrastructure relationships.
domain: cybersecurity
subdomain: c2-frameworks
tags:
  - traffic-analysis
  - pcap
  - payload-extraction
  - network-forensics
  - zeek
version: "1.0"
author: defconxt
license: AGPL-3.0
metadata:
  mitre-attack: ["T1071", "T1573"]
  cwe: ["CWE-300"]
  tools: ["Zeek", "Wireshark", "tshark", "NetworkMiner", "Arkime"]
---

# Analyzing C2 Network Traffic

## Overview

Analyze command and control network traffic to identify communication patterns, extract payloads, and map infrastructure relationships.

## Prerequisites

| Tool / Requirement | Details |
|---|---|
| `Zeek` | Security tooling |
| `Wireshark` | Security tooling |
| `tshark` | Security tooling |
| `NetworkMiner` | Security tooling |
| `Arkime` | Security tooling |
| Isolated lab environment for testing | Environment requirement |
| Authorization and signed Rules of Engagement (RoE) | Environment requirement |
| Relevant target samples or systems acquired through authorized channels | Environment requirement |

## Quick Reference

```bash
# Zeek protocol analysis
zeek -r c2_capture.pcap
cat http.log | zeek-cut ts host uri status_code

# Extract HTTP payloads
tshark -r capture.pcap -T fields \
    -e http.request.uri -e http.file_data \
    -Y "http.request"

# JA3 TLS fingerprinting
zeek -r capture.pcap ja3.zeek
cat ja3.log | zeek-cut ja3 ja3s

# DNS query analysis
tshark -r capture.pcap -Y "dns" -T fields \
    -e dns.qry.name -e dns.qry.type | sort | uniq -c | sort -rn
```

## Workflow

### Step 1: Preparation and Reconnaissance

```bash
# Identify target and gather initial intelligence
file ./target_sample
zeek --version 2>/dev/null || echo "Install Zeek"

# Set up working directory
mkdir -p /tmp/analyzing-c2-network-traffic/{output,logs,artifacts}
```

### Step 2: Primary Analysis

```bash
# Execute primary analysis with Zeek
# Refer to Quick Reference above for detailed commands
echo "[*] Running Analyzing C2 Network Traffic with Zeek..."

# Log all operations
script -q /tmp/analyzing-c2-network-traffic/logs/session.log
```

### Step 3: Deep Investigation

```bash
# Apply Wireshark for secondary analysis
echo "[*] Deep investigation with Wireshark..."

# Cross-reference findings
diff /tmp/analyzing-c2-network-traffic/output/primary.json /tmp/analyzing-c2-network-traffic/output/secondary.json
```

### Step 4: Documentation and Reporting

```bash
# Generate structured findings report
cat <<'EOF' > /tmp/analyzing-c2-network-traffic/output/report.json
{
  "technique": "analyzing-c2-network-traffic",
  "domain": "c2-frameworks",
  "tools_used": ["Zeek", "Wireshark"],
  "findings": [],
  "recommendations": []
}
EOF
```

## Detection

```yaml
title: C2 Network Traffic Detection
id: f5676782-7c23-4539-9bea-4d03a9092863
status: experimental
description: Detects suspicious activity related to analyzing c2 network traffic techniques in c2 frameworks context
logsource:
  category: network_connection
  product: windows
detection:
  selection:
    DestinationPort: 443
    Initiated: "true"
  condition: selection
level: high
tags:
  - attack.t1071
  - attack.t1573
  - attack.command_and_control
falsepositives:
  - Authorized penetration testing tools during scheduled assessments
```


**Detection Opportunities**

| Indicator | Source | Detection Logic |
|---|---|---|
| C2 Network Traffic Detection | windows/network_connection | Sigma rule (high) |
| ATT&CK Coverage | MITRE ATT&CK | T1071, T1573 |

## Verification

- [ ] Environment and tools verified and operational
- [ ] Target samples acquired through authorized channels
- [ ] Primary analysis completed with findings documented
- [ ] Secondary validation performed with independent tooling
- [ ] All artifacts preserved in structured output directory
- [ ] Detection opportunities documented for blue team

## References

- [MITRE ATT&CK T1071](https://attack.mitre.org/techniques/T1071) — Related technique
- [Zeek Documentation](https://zeek.org/) — Primary tooling
- [Wireshark Reference](https://wireshark.org/) — Secondary tooling
