Detect Application Layer Protocol in Elastic Security
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.
MITRE ATT&CK
- Tactic
- Command and Control
- Technique
- T1071 Application Layer Protocol
- Canonical reference
- https://attack.mitre.org/techniques/T1071/
Elastic Detection Query
sequence by process.entity_id with maxspan=24h
[network where event.type in ("connection", "start") and
network.direction == "egress" and
destination.port in (80, 443, 53, 21, 25, 110, 143, 8080, 8443, 1883, 5222) and
not cidrmatch(destination.ip, "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "127.0.0.0/8", "169.254.0.0/16") and
process.name != null
] with runs=10 Detects processes establishing 10 or more repeated outbound connections to public IPs on application layer protocol ports within a 24-hour window. The EQL sequence with runs=10 flags processes exhibiting repeated connection behaviour consistent with C2 beaconing over T1071 protocols. For full interval-based beacon scoring, supplement with an ES|QL aggregation query against the same index pattern.
Data Sources
Required Tables
False Positives & Tuning
- Monitoring agents with fixed heartbeat intervals (Datadog, New Relic, Dynatrace) legitimately connect to cloud endpoints at 60s or 300s intervals, producing high beacon scores against exactly those thresholds
- Browser processes (chrome.exe, firefox.exe, msedge.exe) performing background sync, telemetry reporting, or extension update checks to vendor cloud infrastructure at regular intervals
- Enterprise software update clients and antivirus daemons polling update servers on fixed schedules across ports 80, 443, or 8080 from every managed endpoint simultaneously
Other platforms for T1071
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.
- 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.
- 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.
- 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.
References (6)
- https://attack.mitre.org/techniques/T1071/
- https://arxiv.org/ftp/arxiv/papers/1408/1408.1136.pdf
- https://www.mandiant.com/resources/blog/unc3524-eye-spy-email
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-devicenetworkevents-table
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1071/T1071.md
- https://github.com/SigmaHQ/sigma/tree/master/rules/network
Unlock Pro Content
Get the full detection package for T1071 including response playbook, investigation guide, and atomic red team tests.