T1071

Application Layer Protocol

Command and Control Last updated:

Adversaries may communicate using OSI application layer protocols to avoid detection/network filtering by blending in with existing traffic. Commands to the remote system, and often the results of those commands, will be embedded within the protocol traffic between the client and server. Adversaries may utilize many different protocols, including those used for web browsing, transferring files, electronic mail, DNS, or publishing/subscribing. For connections that occur internally within an enclave (such as those between a proxy or pivot node and other nodes), commonly used protocols are SMB, SSH, or RDP.

What is T1071 Application Layer Protocol?

Application Layer Protocol (T1071) maps to the Command and Control tactic — the adversary is trying to communicate with compromised systems to control them in MITRE ATT&CK.

This page provides production-ready detection logic for Application Layer Protocol, covering the data sources and telemetry it touches: Network Traffic: Network Connection Creation, Network Traffic: Network Traffic Flow, Microsoft Defender for Endpoint. The queries below are rated medium severity at medium confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.

MITRE ATT&CK

Tactic
Command and Control
Technique
T1071 Application Layer Protocol
Canonical reference
https://attack.mitre.org/techniques/T1071/
Microsoft Sentinel / Defender
kusto
let TimeWindow = 24h;
let BeaconThreshold = 10;
let EntropyThreshold = 4.5;
// Detect anomalous outbound connections with beaconing patterns
DeviceNetworkEvents
| where Timestamp > ago(TimeWindow)
| where RemoteIPType == "Public"
| where ActionType == "ConnectionSuccess"
| where RemotePort in (80, 443, 53, 21, 25, 110, 143, 8080, 8443, 1883, 5222)
| summarize
    ConnectionCount = count(),
    UniqueRemoteIPs = dcount(RemoteIP),
    UniquePorts = dcount(RemotePort),
    Ports = make_set(RemotePort),
    FirstSeen = min(Timestamp),
    LastSeen = max(Timestamp),
    AvgTimeBetween = datetime_diff('second', max(Timestamp), min(Timestamp)) / count()
    by DeviceName, InitiatingProcessFileName, InitiatingProcessId
| where ConnectionCount > BeaconThreshold
| where AvgTimeBetween between (1 .. 3600)
| extend BeaconScore = iff(AvgTimeBetween between (55 .. 65) or AvgTimeBetween between (295 .. 305) or AvgTimeBetween between (895 .. 905), "high", "medium")
| project Timestamp=LastSeen, DeviceName, InitiatingProcessFileName, ConnectionCount, UniqueRemoteIPs, Ports, AvgTimeBetween, BeaconScore, FirstSeen, LastSeen
| sort by ConnectionCount desc

Detects anomalous outbound network connections across common application layer protocol ports that exhibit beaconing behavior. Identifies processes making repeated connections at regular intervals to public IPs — a hallmark of C2 communication using application layer protocols (HTTP, DNS, FTP, SMTP, MQTT). Calculates average time between connections to detect periodic beaconing patterns typical of malware callbacks.

medium severity medium confidence

Data Sources

Network Traffic: Network Connection Creation Network Traffic: Network Traffic Flow Microsoft Defender for Endpoint

Required Tables

DeviceNetworkEvents

False Positives

  • Legitimate software performing periodic update checks (Windows Update, antivirus definitions, NTP)
  • Monitoring and heartbeat agents that maintain persistent connections to cloud management platforms
  • Chat and collaboration applications (Slack, Teams, Zoom) with long-lived WebSocket or polling connections
  • IoT devices communicating via MQTT to cloud brokers on regular intervals

Sigma rule & cross-platform mapping

The detection logic for Application Layer Protocol (T1071) above is provided in a vendor-neutral form so you can deploy it on any SIEM. The same logic is shipped here as native KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the following logsource:

logsource:
  category: network_connection
  product: windows

Browse the community-maintained Sigma rules for this technique:


Testing Methodology

Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1Multi-Protocol Beaconing Simulation

    Expected signal: Sysmon for Linux Event ID 3 (Network Connection) showing curl processes connecting to 127.0.0.1 on ports 80, 443, 53. Firewall logs showing outbound connection attempts.

  2. Test 2IRC C2 Channel Simulation

    Expected signal: Sysmon Event ID 3: Network Connection to port 6667 (IRC). Process creation event for nc/netcat with IRC protocol commands in arguments.

  3. Test 3HTTP Beaconing with Cobalt Strike User-Agent

    Expected signal: Sysmon Event ID 3: Network Connection from powershell.exe to 127.0.0.1:80. Proxy logs showing repeated requests to /pixel.gif with suspicious User-Agent. Sysmon Event ID 1: PowerShell process creation for each iteration.


Response Playbook

Triage

  1. Identify the process initiating the connections — is it a known system binary, legitimate application, or suspicious/unknown executable?
  2. Examine the connection pattern — are connections regular (fixed intervals) or jittered? C2 frameworks often add jitter to avoid detection
  3. Check the remote IP reputation using threat intelligence feeds (VirusTotal, AbuseIPDB, OTX) and geolocation data
  4. Review the protocol and port combination — is the traffic on expected ports for that protocol? Look for protocol misuse (e.g., HTTP tunneling over port 53)
  5. Check if the process has a valid digital signature and whether its parent process chain is legitimate
  6. Correlate with DNS logs to identify the domain associated with the remote IP

Containment

  1. If confirmed C2: immediately isolate the endpoint using EDR network isolation or VLAN quarantine
  2. Block the identified C2 IP addresses and domains at the firewall and DNS level
  3. If lateral movement is suspected: isolate all potentially compromised hosts and reset affected credentials
  4. Disable any compromised service accounts and revoke OAuth/API tokens
  5. Create temporary firewall rules to block the specific port/protocol combination used by the C2 channel

Evidence Collection

  1. Full PCAP of the suspicious network connections for protocol-level analysis
  2. Process memory dump of the initiating process for malware analysis
  3. Sysmon Event ID 3 (Network Connection) logs with full process context
  4. DNS query logs correlated with connection timestamps
  5. Proxy/firewall logs showing full URL paths and HTTP headers if applicable
  6. Endpoint process tree showing parent-child relationships of the suspicious process

Escalation Criteria

  • ! Beaconing pattern matches known C2 framework signatures (e.g., 60s Cobalt Strike default sleep)
  • ! Multiple endpoints beaconing to the same external IP or domain
  • ! Process associated with the connections is unsigned, recently dropped, or has been tampered with
  • ! Evidence of data exfiltration (large outbound data volumes during beacon windows)
  • ! The connection uses non-standard protocol/port combinations (e.g., DNS traffic not to port 53, or HTTP to high ports)

Investigation Guide

Forensic Artifacts

  • > Network flow records (NetFlow/IPFIX) showing connection metadata
  • > Sysmon Event ID 3 — Network connection events with process context
  • > Windows Security Event ID 5156 — Windows Filtering Platform (WFP) permitted connections
  • > Proxy logs with full URL, User-Agent, and response codes
  • > DNS query logs showing domain resolution preceding network connections
  • > Firewall logs with action, bytes transferred, and session duration

Tuning Guidance

Start by baselining legitimate application layer protocol usage across your environment. Identify known update services, monitoring agents, and IoT devices that communicate on regular intervals. Create allowlists based on (source process + destination IP/domain + port) tuples rather than broad port exclusions. Adjust the beacon interval thresholds based on your environment's noise floor — environments with many IoT devices may need higher thresholds. Consider deploying JA3/JA3S fingerprinting for TLS connections to identify known C2 framework handshakes even when traffic is encrypted.


Hunting Queries

Hunt for processes making high volumes of outbound connections across multiple ports and IPs. Multi-protocol C2 frameworks often use fallback channels, switching between HTTP, DNS, and other protocols when one is blocked.

Hunting — KQL
kql
DeviceNetworkEvents
| where Timestamp > ago(7d)
| where RemoteIPType == "Public"
| where ActionType == "ConnectionSuccess"
| summarize ConnectionCount=count(), UniqueIPs=dcount(RemoteIP), Ports=make_set(RemotePort) by DeviceName, InitiatingProcessFileName
| where ConnectionCount > 50
| where array_length(Ports) > 2
| sort by ConnectionCount desc
Hunting — SPL
spl
index=proxy OR index=firewall sourcetype IN ("stream:tcp", "pan:traffic") action=allowed NOT (dest_ip="10.*" OR dest_ip="172.16.*" OR dest_ip="192.168.*")
| stats count as ConnectionCount, dc(dest_ip) as UniqueIPs, values(dest_port) as Ports by src_ip, process_name
| where ConnectionCount > 50 AND mvcount(Ports) > 2
| sort - ConnectionCount

Hunt for connections to uncommon application layer protocol ports (MQTT 1883, XMPP 5222, AMQP 5672, STOMP 61613). These pub/sub and messaging protocols are increasingly abused for C2 due to low detection coverage in most environments.

Hunting — KQL
kql
DeviceNetworkEvents
| where Timestamp > ago(7d)
| where RemoteIPType == "Public"
| where RemotePort in (1883, 5222, 5672, 61613)
| summarize ConnectionCount=count(), UniqueIPs=dcount(RemoteIP) by DeviceName, InitiatingProcessFileName, RemotePort
| sort by ConnectionCount desc
Hunting — SPL
spl
index=network sourcetype IN ("stream:tcp", "pan:traffic") dest_port IN (1883, 5222, 5672, 61613) action=allowed NOT (dest_ip="10.*" OR dest_ip="172.16.*" OR dest_ip="192.168.*")
| stats count as ConnectionCount, dc(dest_ip) as UniqueIPs by src_ip, process_name, dest_port
| sort - ConnectionCount

Hunt for extremely consistent connection patterns — processes making a nearly identical number of connections per hour over multiple days. A very low standard deviation in hourly connection counts indicates automated, programmatic communication typical of C2 rather than human-driven activity.

Hunting — KQL
kql
DeviceNetworkEvents
| where Timestamp > ago(7d)
| where RemoteIPType == "Public"
| where ActionType == "ConnectionSuccess"
| summarize Connections=count() by DeviceName, InitiatingProcessFileName, bin(Timestamp, 1h)
| summarize HourlyAvg=avg(Connections), HourlyStdDev=stdev(Connections), TotalHours=count() by DeviceName, InitiatingProcessFileName
| where HourlyStdDev < 2 and TotalHours > 24
| sort by TotalHours desc
Hunting — SPL
spl
index=proxy OR index=firewall sourcetype IN ("stream:tcp", "pan:traffic") action=allowed NOT (dest_ip="10.*" OR dest_ip="172.16.*" OR dest_ip="192.168.*")
| bin _time span=1h
| stats count as Connections by src_ip, process_name, _time
| stats avg(Connections) as HourlyAvg, stdev(Connections) as HourlyStdDev, count as TotalHours by src_ip, process_name
| where HourlyStdDev < 2 AND TotalHours > 24
| sort - TotalHours

Atomic Red Team Tests

Test 1 Multi-Protocol Beaconing Simulation
linux

Simulates C2 beaconing across multiple application layer protocols by making periodic outbound connections to localhost on common C2 ports (HTTP 80, HTTPS 443, DNS 53). This mimics the multi-protocol fallback behavior of advanced C2 frameworks like Cobalt Strike and Sliver.

Command

bash
for port in 80 443 53; do for i in $(seq 1 5); do curl -s -o /dev/null --connect-timeout 2 http://127.0.0.1:$port/ 2>/dev/null; sleep 2; done; done

Expected Telemetry

Sysmon for Linux Event ID 3 (Network Connection) showing curl processes connecting to 127.0.0.1 on ports 80, 443, 53. Firewall logs showing outbound connection attempts.

Expected Detection

Alert fires on repeated connections at regular intervals across multiple ports from the same source process. BeaconScore should trigger based on consistent 2-second intervals.

Test 2 IRC C2 Channel Simulation
linux

Simulates malware connecting to an IRC server for C2 communications, as used by Hildegard, Magic Hound, Siloscape, and TeamTNT. Uses netcat to attempt a connection to a non-existent IRC server on the standard port.

Command

bash
echo -e 'NICK testbot\nUSER testbot 0 * :test\nJOIN #c2channel\nPRIVMSG #c2channel :beacon' | nc -w 3 127.0.0.1 6667 2>/dev/null || true

Expected Telemetry

Sysmon Event ID 3: Network Connection to port 6667 (IRC). Process creation event for nc/netcat with IRC protocol commands in arguments.

Expected Detection

Network monitoring should flag outbound IRC connections (port 6667/6697) as anomalous. Alert fires on connection to known IRC port from a non-IRC client process.

Test 3 HTTP Beaconing with Cobalt Strike User-Agent
windows

Simulates HTTP-based C2 beaconing using a User-Agent string commonly associated with Cobalt Strike default malleable profiles. Makes 10 periodic HTTP GET requests at 5-second intervals to localhost.

Command

powershell
for /L %i in (1,1,10) do (
  powershell -Command "Invoke-WebRequest -Uri 'http://127.0.0.1/pixel.gif' -UserAgent 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; MALC)' -ErrorAction SilentlyContinue" 2>nul
  timeout /t 5 /nobreak >nul
)

Expected Telemetry

Sysmon Event ID 3: Network Connection from powershell.exe to 127.0.0.1:80. Proxy logs showing repeated requests to /pixel.gif with suspicious User-Agent. Sysmon Event ID 1: PowerShell process creation for each iteration.

Expected Detection

Alert fires on regular-interval HTTP connections from PowerShell. Proxy-based detections should flag the anomalous User-Agent string. BeaconScore=high due to consistent 5-second interval.

Related Detections