
C2 Detection: How to Hunt Command and Control Channels
C2 detection, or command and control detection, is the work of finding the channels attackers use to control compromised systems, most often beacons to their own servers, tunnels through protocols the network allows, and relays through legitimate web services or remote access tools.
For eight hours, a macOS implant that Prophet Security investigated checked in with its operator once an hour. The address it called never appeared in the malware. Each time it ran, it read the current C2 domain from a smart contract on the Polygon blockchain. The operator swapped in a new domain roughly once a week.
A blocklist of those domains would have been out of date within a week. The implant's behavior stayed the same on every run: a script interpreter calling out every hour, first to public blockchain services and then to a short, random-looking domain.
Indicator lists still help, but many operators rotate the domains and addresses those lists track. C2 hunting holds up better when it follows how each channel behaves: its timing, how rare its destination is, and which process talks to which service. Much of a hunt's effort goes into ruling out legitimate software that behaves the same way, so each section below names the normal traffic to rule out.
This guide to C2 detection covers how to hunt the main channel families in proxy, DNS, firewall and endpoint data. It leaves out movement between hosts. Two related topics have their own guides: data exfiltration detection, for data leaving the network, and web shell detection, for C2 into web servers.
The checks below work as hypothesis-driven hunts run by hand, or as scheduled hunts that AI threat hunting agents run for the team.
{{ebook-cta}}
What does C2 detection have to cover?
Attackers commonly try to make C2 traffic look like normal, expected traffic, as MITRE ATT&CK's Command and Control tactic notes. For command and control detection, the channels sort into a few families, and each family appears in different logs with its own legitimate look-alikes.
Beacons are easiest to spot in proxy and firewall logs, DNS channels in resolver logs, and tunnels and remote access tools in endpoint process records. Relays through web services are easiest to spot by the process making the call.
Less common channels, such as non-standard ports and peer-to-peer traffic, can be hunted with the same timing and process checks. Where a team runs network detection and response, its network detection data adds protocol and session detail that flow records lack.
How to hunt C2 beaconing in proxy and firewall logs
C2 beaconing is an implant checking in with its server on a schedule to ask for instructions. Beaconing detection starts by grouping connections by source host and destination over a day or more, then measuring the time between connections in each group.
Many implants let the operator add jitter, a random change to each wait, so check-ins drift around an average instead of landing on the minute. Active Countermeasures gives the example of a 20-second delay with 50 percent jitter, which spreads check-ins anywhere from 10 to 30 seconds apart. Jitter weakens the pattern without hiding it, unless the jitter is very heavy. Look for gaps that cluster around a typical value over hours or days, rather than gaps that match exactly.
Timing alone flags plenty of legitimate software, because anything on a timer produces the same pattern. Two more checks narrow the list. First, see whether the amount of data per check-in stays about the same, a measure Elastic Security Labs uses. Second, check how rare the destination is: how many hosts reach it, how long the domain has existed and whether your logs have seen it before.
A regular connection that only one or two hosts make to a rarely seen destination deserves a closer look. Update agents, security tools and telemetry clients also call home on a schedule, but usually from many hosts to their vendor's domains.
Keep a list of the scheduled destinations your fleet calls and the processes that call them, so they drop out of each hunt, and update it as software changes.
Encryption hides what a beacon says. Its timing, its sizes and, in most setups, its destination stay visible, so C2 traffic detection built on these checks works on HTTPS without decryption.
For each lead, find the process that made the connection in endpoint records. A browser calling a content delivery network is usually noise. An unsigned program, a script interpreter or a system tool calling a young domain at a steady rhythm is worth confirming.
How to hunt hosts still calling dead, blocked or sinkholed C2
Many implants keep calling their C2 domain after it has been blocked, taken down or sinkholed. A sinkhole is a server that researchers, security vendors or law enforcement point a malicious domain at after taking it over or registering it first. Infected hosts then connect to the sinkhole instead of the attacker.
Because many implants keep retrying, your own block logs become a hunting source. Look for one host making repeated blocked requests or failed lookups for the same destination at a steady rate. Also look for connections to sinkhole addresses listed in your threat intelligence.
In the Fireworks AI breach, malicious copies of a developer extension retried a tunnel to the attacker's server about every 60 seconds. After the server went offline, repeated attempts at that interval pointed to persistence that was still running.
Retries also come from software calling a vendor domain that no longer exists, from misconfigured apps and from adware, so check which process makes them before escalating. When the process is unfamiliar, treat the host as likely infected even though its channel is down, and look for other outbound connections from the same process.
How to hunt DNS used as a C2 channel
DNS can carry C2 in both directions. The implant hides its check-in in a subdomain of a domain the attacker controls. The answer carries the next instruction, in a TXT record or even in the numbers of an IP address.
Group DNS resolver logs by host and parent domain, and look for:
- A steady rhythm. One or two hosts querying the same parent domain at regular intervals, which can be beaconing over DNS.
- Many single-use subdomains. Long or random-looking names under one domain, most of them queried only once.
- Heavy TXT use. Many TXT queries, or large TXT answers, for one domain.
- Outside resolvers. In firewall, proxy or endpoint records, hosts that skip the internal resolver and query an outside one directly, or use DNS over HTTPS.
Content delivery networks, reputation and blocklist lookups, and telemetry also produce long, random-looking names, so review hits by parent domain before treating any as C2. Newer browsers may also switch to encrypted DNS on their own, the NSA warns. A browser using DNS over HTTPS usually points to a policy gap, while a script or an unknown program doing it is the stronger lead.
When the queries carry data out rather than instructions in, see the DNS tunneling section of our data exfiltration detection guide.
How to hunt protocol tunneling and proxy tools
Protocol tunneling wraps command and control traffic inside a protocol the network allows, such as HTTPS, SSH or DNS. Proxy tools relay an attacker's traffic through a compromised host. MITRE ATT&CK's protocol tunneling page lists groups using common tools for it, such as ngrok, Chisel and Plink. Microsoft saw Flax Typhoon install SoftEther VPN renamed to look like a Windows component.
In endpoint process and network records, look for:
- First runs. A tunneling or proxy tool on a host that has never run one, especially a server or a workstation outside IT.
- Renamed copies. A program running under a name that doesn't match its publisher, such as a VPN client named like a Windows component.
- New listeners. A workstation that starts listening on a port, which some proxy and tunnel tools need.
- Long sessions. Connections to one outside address that stay open for hours. Tunnels often hold them, while beacons usually make short, repeated connections.
- Anonymity networks. Tor or other anonymizing clients with steady encrypted traffic out, which ATT&CK's guidance on multi-hop proxies flags.
Tunneling services count too. In the ARTEX AI attacks, Google advised watching for servers calling webhook, out-of-band testing and tunneling services they had not used before. Google also saw the attackers' agents post command output back to webhook URLs.
When a threat report names a tunneling tool, search your endpoint records for its first run across the fleet. Our post on actionable threat intelligence covers when a report should become a hunt.
The same tools have legitimate uses: sanctioned VPN clients, developer tunnels for testing, and IT staff using SSH or proxies. For each hit, check who installed the tool, whether IT approved it and where it connected.
How to hunt C2 hidden in legitimate web services
Attackers also relay C2 through services the network already trusts, such as cloud storage, messaging and collaboration APIs, and paste and code-hosting sites. MITRE ATT&CK's Web Service technique lists implants that used Slack, Discord, Telegram, Pastebin, GitHub, OneDrive and Google Drive for C2.
Some implants use a service only to find their real server. In a dead drop resolver, the implant reads its current C2 address from a page or record the attacker can update. In Prophet Security's EtherHiding investigation, that record was a smart contract, which the implant read every hour through public blockchain RPC providers.
The diagram below follows one hourly run and the logs that record it.

Which process makes the call usually gives it away. A browser or an approved app reaching cloud storage is routine. A script interpreter, an Office app or a system tool calling a messaging API, a paste site or a blockchain service is a lead. The lead gets stronger when it is the host's first contact with the service and the calls come at a steady rhythm.
In the EtherHiding case, Prophet Security auto-dispositioned every detection in the cluster as malicious with no analyst intervention. It then reconstructed the whole chain in under ten minutes, from the endpoint detection through the on-chain C2, the full domain rotation history and the funding wallet cluster.
Browsers and approved apps use the same services every day, so judge each hit by its process and its host. For a lead, check what the process downloaded or ran right after the call.
When remote access software is the C2 channel
Remote access tools give an attacker an interactive channel that looks like IT work, and ATT&CK lists them under Command and Control. CISA described attackers running portable copies of ScreenConnect and AnyDesk, which need no installation or administrator rights and so get around controls that only govern installed software.
Hunt for remote access tools outside your approved list and for portable copies running from user folders. On approved tools, look for sessions from accounts, addresses or hours that don't fit how your IT team works. A tool started soon after a call from someone posing as IT support is a strong lead, as our guide to vishing attacks explains. IT and help desk sessions on approved tools from known accounts are the normal to rule out.
How to confirm a C2 lead and scope it
In C2 detection, a lead becomes a finding once the host and the process behind it are explained. Start on the endpoint, using the same steps as investigating EDR alerts:
- Process and parent. What started the program that made the connection, and where it runs from.
- Persistence. Scheduled tasks, services, launch agents or startup entries that bring it back after a restart.
- What came down the channel. Files written and programs run right after a connection.
- First contact. When the host first reached the destination, and what happened just before, such as a download, an email attachment or a meeting.
- Other hosts. Any other host calling the same destination, or calling out on the same rhythm.
To contain a confirmed channel, isolate the host, block the attacker's own domains and addresses at the firewall, proxy and DNS, and revoke the credentials and sessions the host held. Then watch the rest of the fleet for the same process reaching new destinations, since operators can switch an implant to a fallback channel when the main one fails.
Close the paths the channel used:
- Egress control. Restrict outbound traffic to destinations the business needs, where that is feasible, and alert on script interpreters making outbound connections from workstations, as the EtherHiding investigation recommends.
- Unused service categories. Block services with no business use, such as public blockchain services for most staff, with an exception for the teams that need them.
- One DNS path. Send all DNS, encrypted or not, through the enterprise resolver and block other resolvers, as the NSA recommends.
- Approved remote access. Keep a list of approved remote access tools and use application controls to block installation and portable copies of the rest, as CISA recommends.
How Prophet AI Threat Hunter hunts C2
Prophet AI Threat Hunter has expert-curated hunts for C2 beaconing and for hosts still calling dead or sinkholed C2 infrastructure. Custom Hunting Agents turn a team's own hypotheses, such as a tunneling tool named in a new threat report, into standing hunts that run autonomously on the schedule the team sets.
Suspicious leads go to Prophet AI SOC Analyst for a full investigation. Each investigation comes back with the queries it ran, the evidence it found and the reasoning behind its determination, so analysts can check the work instead of redoing it. When an investigation confirms a threat, AI Threat Hunter scopes when the attack started and how far it reached.
Prophet AI Detection Engineer then turns validated findings into backtested, reviewable detections in the team's own stack. When a question about the environment takes minutes to answer instead of days, C2 detection becomes regular work across the SOC.
To see these hunts and investigations run against your own proxy, DNS and endpoint data, request a demo.
C2 detection is the work of finding the channels attackers use to control compromised systems. Most often that means beacons to the attacker's own servers, tunnels through protocols the network allows, and relays through legitimate web services or remote access tools. Hunters look at timing, how rare a destination is and which process makes each connection, because many operators rotate the domains and addresses that indicator lists track.
Group connections by host and destination over a day or more, then look for check-ins at a steady rhythm, similar request sizes, few hosts reaching the destination and a young or rarely seen domain. Many implants add jitter, so expect gaps that cluster around an average rather than exact intervals. Then tie each lead to the process that made the connection, since update agents and telemetry also call home on a schedule.
Anything that runs on a timer can look like a beacon, such as software update checks, security tools' cloud lookups, telemetry clients, monitoring heartbeats and file sync services. These usually come from many hosts and go to their vendor's domains, while a beacon tends to come from one or two hosts and go to a rarely seen destination. Keep a list of the scheduled destinations your fleet calls, and review it as software changes.
Yes, in most cases. Encryption hides what a beacon says, while its timing, request sizes and, in most setups, its destination stay visible. The start of a TLS connection is also sent in the clear, so tools can fingerprint the software making it, and endpoint records show which process made the connection. Decryption adds the content, but timing, rarity and process checks catch many beacons without it.
C2 detection looks for the channel an attacker uses to send commands to a compromised system and get results back. Data exfiltration detection looks for data leaving the organization through any channel, including a C2 channel, cloud storage or DNS tunneling. The two overlap when attackers steal data over their C2 channel, so a confirmed C2 channel is a reason to check what data left through it.
They send commands and results through services the network already allows, such as cloud storage, messaging and collaboration APIs, and paste and code-hosting sites. Some use a service only as a dead drop that holds the address of their real server. The traffic goes to trusted domains, so the better signal is which process makes the call, such as a script interpreter or a system tool, and whether the host has contacted that service before.
Insights
The SOC of 2030: Strategies for Building Agentic Cyber Defense
This Gartner research lays out a framework for rebuilding security operations around AI agents and the milestones for getting there by 2030.



.avif)
