Given a C2 alert from an IDS, how do you tell which IP is the infected host and which is the command-and-control server?
From the direction of the flow and the network ranges: the infected host is the internal address that initiates the connection (usually from a high source port), and the C2 server is the external address it connects to (usually on a web port such as 80/443 or 8080).
* The infected internal host opens the connection outward; the C2 server answers from outside. *
C2 traffic is almost always outbound. Malware inside the network calls out, because inbound connections would be blocked by the firewall and NAT. So in the alert:
| Infected host | C2 server | |
|---|---|---|
| Address | internal / private (in $HOME_NET) |
external, often already on reputation lists |
| Role in the flow | client: sends the first packet (SYN) | server: answers |
| Port | random high source port | service port, often 80, 443, 8080 |
Rules are often written with this direction in mind ($HOME_NET any -> $EXTERNAL_NET any with flow:to_server), so src_ip in the alert is the victim.
Other fields help classify the victim further. For example, an HTTP User-Agent or SMB/NetBIOS traffic can reveal its operating system family. Emotet itself is Windows malware, so a host confirmed as infected runs Windows.
Go deeper:
Unit 42: Wireshark Tutorial – Identifying Hosts and Users — pinning down an infected host's name, OS and user from DHCP, NBNS and User-Agent.
MITRE ATT&CK: Command and Control (TA0011) — the catalogue of how malware hides its outbound C2 traffic.