Prerequisites
- Target system, dependencies and environment configured.
Usage
Purpose
Most malware phones home — to receive commands, exfiltrate data, or pull the next stage. Understanding that command-and-control (C2) channel tells you how the malware operates, what an attacker can do through it, and — crucially for defence — how to detect it on the network. This skill covers analysing malware's C2 communication: the protocol, the beaconing pattern, and the encoding, turning it into network indicators and detections.
When to use it
When a sample communicates over the network (most do) and you need to understand or detect that channel. It combines dynamic analysis (observing the traffic), code analysis (understanding the protocol), and detection output (network signatures) — and it feeds threat-hunting's beaconing detection directly.
Procedure
- Capture the C2 traffic in the isolated lab. Detonate with network capture running and INetSim (or a controlled internet gateway) answering, so you observe the callbacks safely. The dynamic-analysis and packet-capture skills provide the setup:
# detonate in lab; Wireshark/tcpdump capturing; INetSim answering the callbacks
- Identify the protocol and destination. What does it talk — HTTP(S), DNS, raw TCP, a custom protocol? To where (domain/IP, and how it's resolved — hardcoded, DGA, or fetched)? HTTPS C2 hides content but still shows metadata (destination, timing, TLS fingerprint).
- Characterise the beaconing. C2 typically beacons — connecting to the C2 at intervals to check for commands. Note the interval, jitter (randomisation to evade detection), and the request pattern. Regular beaconing is a strong, detectable signature (feeds the threat-hunting beaconing skill):
# regular-interval connections to one destination = beaconing (the key detection signal)
- Decode the communication. C2 data is usually encoded/encrypted — base64, XOR, custom encoding, or TLS. From dynamic capture you see the wire format; from code analysis (disassembly skill) you can recover the encoding/encryption scheme and keys, letting you decode what's actually being sent (commands, exfil, config). Reversing the protocol is what reveals the channel's real capability.
- Understand the capability — what commands the C2 supports (shell, download/upload, persistence, lateral movement) tells you what an attacker can do through this malware, which shapes IR and impact assessment.
- Produce network detections — the destination indicators (domains/IPs/URLs), the beaconing pattern, TLS/JA3 fingerprints, and any distinctive request signatures become network IoCs and detection rules (Sigma/Suricata, YARA for the protocol handler). Behavioural signatures (beacon pattern, request structure) are more durable than the IP/domain (which rotates).
Cheatsheet
capture in the LAB (dynamic-analysis + packet-capture setup)
detonate + Wireshark/tcpdump + INetSim answering -> observe callbacks safely
characterise the channel
protocol HTTP(S) | DNS | raw TCP | custom (HTTPS hides content, shows metadata)
destination domain/IP, resolution (hardcoded / DGA / fetched)
BEACONING interval + jitter + request pattern <- key detectable signature
encoding base64 / XOR / custom / TLS
(code analysis recovers the scheme+keys -> decode the real traffic)
understand capability: shell? download/upload? persistence? lateral movement?
-> shapes IR + impact
produce NETWORK detections
destination IoCs (domain/IP/URL) — rotate, low durability
BEACON pattern + request structure + JA3/TLS fingerprint — durable, invest here
-> Sigma/Suricata rules, feeds threat-hunting beaconing detection
Reading the C2
- Regular-interval beaconing to one destination = the classic, detectable C2 signature; the interval-and-jitter pattern is a durable network detection even when the destination IP rotates. The highest-value observation for defence.
- HTTPS C2 = content is encrypted, but destination, timing/beacon pattern, and TLS/JA3 fingerprint are still visible and detectable — don't assume encrypted means undetectable.
- A recovered encoding/encryption scheme (from code analysis) = you can decode the actual commands and exfil, revealing the channel's real capability and content — worth the reversing effort for a significant threat.
- DGA or fetched C2 resolution = the destination changes, so blocking one domain is futile; the behavioural signature (beaconing, request structure) is what to detect instead.
- The command set (shell, file transfer, lateral movement) = the attacker's capability through this malware; critical for IR impact and scoping.
- Behavioural network signatures + destination IoCs fed to detection and hunting = analysis turned into network defence.
Pitfalls
- Capturing C2 without lab isolation. Letting the malware actually reach its real C2 tips off the attacker and may pull live payloads; use INetSim/controlled gateway in the isolated lab.
- Assuming HTTPS C2 is undetectable. Encrypted content still leaves destination, beacon timing, and TLS fingerprints — detectable metadata. Don't give up at "it's encrypted".
- Relying only on IP/domain indicators. C2 infrastructure rotates (DGA, fast flux); a domain/IP block is short-lived. Extract the durable behavioural signature (beacon pattern, request structure) too.
- Not reversing the protocol when it matters. For a significant threat, recovering the encoding/keys reveals the actual commands and exfil — the channel's real capability — which surface analysis misses.
- Stopping at observation. The goal is detection and impact understanding; feed the beacon pattern and command capability into detection-engineering, threat-hunting, and IR.
References
- Practical Malware Analysis (network/C2 chapters)
- Wireshark, INetSim documentation; JA3/JA3S TLS fingerprinting
- The dynamic-analysis-sandboxing, packet-capture-analysis, and threat-hunting (beaconing) skills
- MITRE ATT&CK — TA0011 (Command and Control), T1071, T1568 (DGA)
Inputs
- Relevant source code, logs, network traces, or system specifications.
Outputs
- Analysis findings, security audit report, or generated code artifacts.
1---2name: c2-and-network-analysis3description: Use when analysing how malware communicates with its command-and-control — the protocols, beaconing, and encoding — to understand the channel and produce network detections.4---5678## Prerequisites9- Target system, dependencies and environment configured.1011## Usage12### Purpose1314Most malware phones home — to receive commands, exfiltrate data, or pull the next stage. Understanding that command-and-control (C2) channel tells you how the malware operates, what an attacker can do through it, and — crucially for defence — how to detect it on the network. This skill covers analysing malware's C2 communication: the protocol, the beaconing pattern, and the encoding, turning it into network indicators and detections.1516### When to use it1718When a sample communicates over the network (most do) and you need to understand or detect that channel. It combines dynamic analysis (observing the traffic), code analysis (understanding the protocol), and detection output (network signatures) — and it feeds threat-hunting's beaconing detection directly.1920### Procedure21221. **Capture the C2 traffic in the isolated lab.** Detonate with network capture running and INetSim (or a controlled internet gateway) answering, so you observe the callbacks safely. The dynamic-analysis and packet-capture skills provide the setup:23 ```24 # detonate in lab; Wireshark/tcpdump capturing; INetSim answering the callbacks25 ```262. **Identify the protocol and destination.** What does it talk — HTTP(S), DNS, raw TCP, a custom protocol? To where (domain/IP, and how it's resolved — hardcoded, DGA, or fetched)? HTTPS C2 hides content but still shows metadata (destination, timing, TLS fingerprint).273. **Characterise the beaconing.** C2 typically beacons — connecting to the C2 at intervals to check for commands. Note the interval, jitter (randomisation to evade detection), and the request pattern. Regular beaconing is a strong, detectable signature (feeds the threat-hunting beaconing skill):28 ```29 # regular-interval connections to one destination = beaconing (the key detection signal)30 ```314. **Decode the communication.** C2 data is usually encoded/encrypted — base64, XOR, custom encoding, or TLS. From dynamic capture you see the wire format; from code analysis (disassembly skill) you can recover the encoding/encryption scheme and keys, letting you decode what's actually being sent (commands, exfil, config). Reversing the protocol is what reveals the channel's real capability.325. **Understand the capability** — what commands the C2 supports (shell, download/upload, persistence, lateral movement) tells you what an attacker can do through this malware, which shapes IR and impact assessment.336. **Produce network detections** — the destination indicators (domains/IPs/URLs), the beaconing pattern, TLS/JA3 fingerprints, and any distinctive request signatures become network IoCs and detection rules (Sigma/Suricata, YARA for the protocol handler). Behavioural signatures (beacon pattern, request structure) are more durable than the IP/domain (which rotates).3435### Cheatsheet3637```38capture in the LAB (dynamic-analysis + packet-capture setup)39 detonate + Wireshark/tcpdump + INetSim answering -> observe callbacks safely4041characterise the channel42 protocol HTTP(S) | DNS | raw TCP | custom (HTTPS hides content, shows metadata)43 destination domain/IP, resolution (hardcoded / DGA / fetched)44 BEACONING interval + jitter + request pattern <- key detectable signature45 encoding base64 / XOR / custom / TLS46 (code analysis recovers the scheme+keys -> decode the real traffic)4748understand capability: shell? download/upload? persistence? lateral movement?49 -> shapes IR + impact5051produce NETWORK detections52 destination IoCs (domain/IP/URL) — rotate, low durability53 BEACON pattern + request structure + JA3/TLS fingerprint — durable, invest here54 -> Sigma/Suricata rules, feeds threat-hunting beaconing detection55```5657### Reading the C25859- **Regular-interval beaconing to one destination** = the classic, detectable C2 signature; the interval-and-jitter pattern is a durable network detection even when the destination IP rotates. The highest-value observation for defence.60- **HTTPS C2** = content is encrypted, but destination, timing/beacon pattern, and TLS/JA3 fingerprint are still visible and detectable — don't assume encrypted means undetectable.61- **A recovered encoding/encryption scheme (from code analysis)** = you can decode the actual commands and exfil, revealing the channel's real capability and content — worth the reversing effort for a significant threat.62- **DGA or fetched C2 resolution** = the destination changes, so blocking one domain is futile; the behavioural signature (beaconing, request structure) is what to detect instead.63- **The command set** (shell, file transfer, lateral movement) = the attacker's capability through this malware; critical for IR impact and scoping.64- **Behavioural network signatures + destination IoCs fed to detection and hunting** = analysis turned into network defence.6566### Pitfalls6768- **Capturing C2 without lab isolation.** Letting the malware actually reach its real C2 tips off the attacker and may pull live payloads; use INetSim/controlled gateway in the isolated lab.69- **Assuming HTTPS C2 is undetectable.** Encrypted content still leaves destination, beacon timing, and TLS fingerprints — detectable metadata. Don't give up at "it's encrypted".70- **Relying only on IP/domain indicators.** C2 infrastructure rotates (DGA, fast flux); a domain/IP block is short-lived. Extract the durable behavioural signature (beacon pattern, request structure) too.71- **Not reversing the protocol when it matters.** For a significant threat, recovering the encoding/keys reveals the actual commands and exfil — the channel's real capability — which surface analysis misses.72- **Stopping at observation.** The goal is detection and impact understanding; feed the beacon pattern and command capability into detection-engineering, threat-hunting, and IR.7374### References7576- Practical Malware Analysis (network/C2 chapters)77- Wireshark, INetSim documentation; JA3/JA3S TLS fingerprinting78- The dynamic-analysis-sandboxing, packet-capture-analysis, and threat-hunting (beaconing) skills79- MITRE ATT&CK — TA0011 (Command and Control), T1071, T1568 (DGA)8081## Inputs82- Relevant source code, logs, network traces, or system specifications.8384## Outputs85- Analysis findings, security audit report, or generated code artifacts.