SBN

Detecting command-and-control traffic at the network layer


Command-and-control traffic, often shortened to C2, is the communication path an attacker uses to control a compromised system after initial access. Once malware or a hands-on operator has a foothold, C2 is how they issue commands, move data, stage tools, and maintain persistence. For UK SMEs, the value of detecting C2 at the network layer is straightforward: it can expose malicious activity even when endpoint telemetry is incomplete, tampered with, or simply not available.

Network-layer detection is not a replacement for endpoint security. It is a complementary control that gives you visibility into outbound connections, DNS lookups, TLS handshakes, and flow patterns that are hard to hide completely. In practice, that means you can spot suspicious beaconing, rare destinations, and protocol anomalies before a compromise turns into data theft or wider lateral movement.

Key takeaways

  • Beaconing, rare destinations, DNS anomalies, and TLS fingerprints are often more useful than endpoint-only alerts for spotting command-and-control traffic.
  • Start with DNS, firewall, and endpoint process telemetry, then add Suricata, proxy logs, and TLS fingerprinting where they add real value.
  • Baseline normal traffic by device group before tuning alerts, or you will spend too much time on legitimate polling from update and remote support tools.
  • Map detections to MITRE ATT&CK Command and Control techniques so you can see coverage gaps and prioritise improvements.
  • If you confirm C2, isolate the host, block the destination, and preserve logs and packet data before you make wider changes.

What command-and-control traffic is and why it matters

C2 sits in the middle of the attack chain. An adversary first gains access, then uses C2 to establish a reliable channel back to infrastructure they control. That channel may be simple HTTP polling, encrypted HTTPS, DNS tunnelling, or a more bespoke protocol over common ports. The exact mechanism matters less than the behaviour it creates: repeated check-ins, unusual destinations, and traffic that looks more like a machine waiting for instructions than a user browsing the web.

When C2 goes unnoticed, the business impact is usually indirect at first. Attackers may spend time quietly enumerating the network, harvesting credentials, or preparing ransomware deployment. For SMEs, that often translates into operational disruption, recovery costs, and time spent investigating systems that should have been isolated earlier. If you want to understand how C2 fits into broader detection strategy, it helps to view it alongside endpoint and identity telemetry, as discussed in achieving centralised visibility across endpoints, identity, and network.

What searchers usually mean by C2 traffic

In most security discussions, C2 traffic means outbound communications from an infected host to attacker-controlled infrastructure. That infrastructure may be a dedicated server, a compromised legitimate site, a cloud-hosted endpoint, or a rotating set of domains. The traffic often blends into normal business use, which is why network-layer context is so important.

Beaconing is the classic pattern. A host connects at regular intervals, often with a consistent packet size, user agent, or TLS fingerprint. The traffic may be low volume and easy to miss if you only look for spikes. In some environments, the first clue is not a large transfer but a small, repetitive request pattern that appears every 30, 60, or 120 seconds.

Examples in real environments include a workstation making periodic HTTPS requests to a domain registered days earlier, a server resolving a suspicious domain through DNS at odd intervals, or a device using an uncommon TLS client fingerprint to contact an IP address with no obvious business purpose. These are not proof on their own, but they are strong leads when combined with endpoint and identity evidence.

Where network-layer detection adds value

Endpoint tools are essential, but they are not complete. Attackers may disable agents, run in memory, abuse legitimate tools, or operate on unmanaged devices. Even when endpoint logging is healthy, it may not show the full picture of where a host is connecting, what it is resolving, or whether the traffic matches normal user behaviour.

That is where network detection and response, or NDR, adds value. NDR platforms and packet inspection tools can identify flows, protocol metadata, DNS patterns, and TLS characteristics without relying on the endpoint to tell the whole story. For SMEs with limited staff, the goal is not to inspect every packet forever. It is to collect enough metadata to identify suspicious patterns quickly and to support triage when something looks wrong. If you are building this capability from scratch, designing integrated network detection and response is a useful companion topic.

Core indicators of suspicious C2 traffic

The most useful network indicators are behavioural rather than purely signature-based. Beaconing patterns, timing, and periodicity are often the first clue. Look for connections that occur at fixed or near-fixed intervals, especially when the destination is rare for that host or user. Consistent timing across many hours, including outside business hours, is more suspicious than a burst of activity during working time.

Unusual DNS, HTTP, HTTPS, and TLS characteristics are also important. DNS queries for algorithmically generated-looking domains, long subdomains, or domains with very low reputation can indicate infrastructure used for C2. HTTP requests with odd user agents, missing headers, or repetitive paths may indicate scripted communication. HTTPS can hide the payload, but not the metadata. TLS handshakes still expose certificate details, server name indications, cipher preferences, and client fingerprints that can be compared against known-good baselines.

Rare destinations, new domains, and abnormal geolocation are useful context, but they should not be treated as standalone indicators. A legitimate SaaS platform may host in another country, and many cloud services use shared infrastructure. The better question is whether the destination is expected for that host, user, and business function. A finance workstation talking to a newly registered domain in an unusual hosting range deserves more attention than a managed update service talking to a known vendor endpoint.

Detection approaches that work in practice

Signature-based detection still has a place, especially for known malicious infrastructure or protocol artefacts. Suricata can alert on suspicious HTTP headers, DNS patterns, or known bad indicators, and it remains a practical option for SMEs that want transparent rules and local control. If you are building or tuning rules, writing Suricata rules to detect command-and-control traffic covers the rule-writing side in more depth.

Behavioural detection using flow data and metadata is usually more durable. NetFlow, firewall logs, proxy logs, and DNS logs can all be enriched and correlated to identify periodic outbound connections, low-and-slow exfiltration precursors, or hosts that suddenly begin talking to unusual destinations. A simple heuristic such as repeated outbound connections to the same destination at fixed intervals, combined with low byte counts and no corresponding user activity, can be surprisingly effective when tuned to your environment.

TLS fingerprinting with JA3 and JARM is especially useful when payload inspection is limited. JA3 fingerprints the client-side TLS handshake, while JARM fingerprints the server-side response. Together, they can help you cluster suspicious infrastructure and identify families of tooling that reuse the same communication patterns. This is not a silver bullet, but it is a strong enrichment layer when you are trying to separate ordinary encrypted traffic from suspicious automation. For a deeper technical treatment, see detecting Cobalt Strike beacons with JA3 and JARM fingerprinting.

DNS and proxy telemetry are often the easiest sources to operationalise. DNS logs can reveal repeated lookups, NXDOMAIN bursts, and unusual domain age. Proxy logs can show user agents, URL paths, and destination reputation. When you combine DNS, proxy, and firewall data, you can often identify C2 even when the payload is encrypted. The key is correlation. A single DNS query may not mean much, but repeated lookups followed by periodic HTTPS connections to the resolved IP is a much stronger signal.

How to investigate suspected C2 traffic

When a detection fires, start with a small set of triage questions. Is the destination expected for this host or user? Is the timing periodic? Is the traffic new for this asset? Does the process on the endpoint match the network activity? Has the same destination appeared on other hosts? These questions help separate a genuine compromise from a noisy but legitimate service.

Useful pivots usually span endpoint, identity, and network logs. On the endpoint side, look for the parent process, command line, loaded modules, and any recent persistence changes. On the identity side, check whether the user account associated with the host has unusual sign-in activity, privilege changes, or concurrent sessions from other locations. On the network side, review DNS resolution history, proxy user agents, TLS fingerprints, and any other hosts contacting the same destination.

If you have packet capture available, use it selectively. Full packet capture is valuable, but not always practical for SMEs. Even short rolling captures around the alert window can help confirm whether the traffic is beaconing, whether the payload is encrypted, and whether the host is attempting to retrieve commands or send data. The aim is to gather enough evidence to decide whether to contain the host, not to reverse engineer the malware on the spot.

Common false positives and how to reduce them

Many legitimate tools create beacon-like traffic. Software update agents, remote monitoring tools, backup clients, and collaboration platforms often poll on a schedule. The difference is usually in the destination, the process, and the consistency with your baseline. A remote support tool may beacon regularly, but it should do so from a known process to a known vendor endpoint and from systems where that tool is approved.

Baselining normal traffic before tuning alerts is essential. Start by identifying the top outbound destinations, common DNS patterns, and routine TLS fingerprints for each major device group. Workstations, servers, and admin systems often have very different profiles. Once you know what normal looks like, you can tune out expected polling and focus on outliers. This is the same principle used in other detection disciplines, including measuring detection quality and false positives.

It also helps to maintain an allow list with care. Overly broad allow lists can hide real threats, especially if they include wildcard domains or entire cloud ranges. Prefer specific vendor endpoints, specific applications, and time-bound exceptions where possible. Review exceptions regularly and remove anything no longer needed.

A practical detection stack for UK SMEs

A minimum viable stack does not need to be expensive. At a basic level, collect firewall logs, DNS logs, proxy logs if you have them, and endpoint telemetry from your EDR or EPP platform. If you can add Suricata or another IDS sensor at a key egress point, that improves visibility further. The goal is to give analysts enough context to answer three questions quickly: what connected, where it connected, and whether that behaviour is normal.

If resources are limited, prioritise the highest-value telemetry first. For most SMEs, that means DNS, firewall, and endpoint process data. DNS often provides the earliest clue, firewall logs show the destination and timing, and endpoint data links the network activity to a process. Once those are in place, add proxy logs and TLS fingerprinting where feasible. This staged approach is usually more sustainable than trying to deploy a full packet inspection programme on day one.

For teams building a broader network control set, it is worth aligning detection work with segmentation and egress control. If a host should not be talking to the internet directly, that policy should be enforced. Network detection is stronger when paired with implementing network segmentation and egress restrictions that reduce the number of places malware can call home.

How to map C2 detections to MITRE ATT&CK

MITRE ATT&CK is useful here because it gives you a common language for describing what the detection covers. C2 activity commonly maps to the Command and Control tactic, with techniques such as Application Layer Protocol, Proxy, Encrypted Channel, and DNS. In practice, the exact mapping depends on the protocol and behaviour you observe.

Coverage mapping helps identify blind spots. If you only detect known bad domains, you have narrow coverage. If you also detect beaconing periodicity, suspicious TLS fingerprints, and anomalous DNS behaviour, your coverage is broader and more resilient. That matters because attackers change infrastructure frequently. A detection strategy built only on indicators of compromise tends to age quickly, while one built on behaviour is more durable.

When you review detections, ask whether each one is tied to a specific ATT&CK technique, whether it has a clear data source, and whether it produces actionable context. This makes it easier to tune detections, explain them to stakeholders, and understand where your visibility is weak.

Operational response when C2 is confirmed

If you confirm C2, containment should be the first priority. Isolate the affected host, block the destination at the firewall or secure web gateway, and preserve the relevant logs before they roll over. If the host is a server or critical workstation, coordinate containment carefully so you do not destroy evidence or interrupt essential services without a plan.

Preserving evidence matters because C2 is often only one part of a larger compromise. Keep copies of DNS logs, proxy logs, firewall logs, endpoint telemetry, and any packet capture associated with the alert window. Record the time of first detection, the destination, the process involved, and any related identity events. This gives you a defensible timeline for investigation and recovery, and it supports later lessons learned.

Once the immediate risk is contained, review whether the same infrastructure appears elsewhere in your environment. Attackers often reuse the same domains, IPs, or TLS fingerprints across multiple hosts. If you find more than one affected system, widen the scope of containment and look for common initial access paths.

How to improve resilience over time

Detection improves when you treat every alert as feedback. Review false positives, missed detections, and slow triage cases on a regular cycle. Ask whether the issue was poor telemetry, weak tuning, or a genuine gap in coverage. Small changes, such as adding a DNS enrichment source or tightening a proxy rule, can make a meaningful difference.

Use incidents to strengthen network visibility. If an investigation showed that you could not link a connection to a process, add the missing endpoint telemetry. If you could not tell whether a destination was rare, build a baseline. If encrypted traffic hid too much context, consider TLS fingerprinting or better proxy logging. This is the same continuous improvement mindset that underpins effective security operations.

For UK SMEs, the practical objective is not to detect every possible C2 technique. It is to make malicious outbound communication visible enough that you can act before the compromise spreads. That is achievable with a focused set of logs, sensible baselines, and a detection stack that matches your environment.

If you want help reviewing your network visibility, tuning detections, or aligning this work with a broader security programme, Speak to a consultant.

Frequently asked questions

What is NTA in cybersecurity?

NTA usually means network traffic analysis. It is the practice of analysing flows, metadata, and sometimes packet contents to spot suspicious behaviour on the network, including command-and-control communication.

What is the role of command and control in cybersecurity?

In an attack, command and control is the communication channel an adversary uses to control a compromised system, issue commands, move laterally, or stage data theft. Detecting it helps you find and contain compromises earlier.