Web Protocols
Adversaries may communicate using application layer protocols associated with web traffic 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. Protocols such as HTTP/S and WebSocket that carry web traffic may be very common in environments. HTTP/S packets have many fields and headers in which data can be concealed. An adversary may abuse these protocols to communicate with systems under their control within a victim network while also mimicking normal, expected traffic.
let TimeWindow = 24h;
let SuspiciousUserAgents = dynamic([
"Mozilla/5.0 (compatible; MSIE 9.0", "Mozilla/4.0 (compatible; MSIE 7.0",
"MALC", "WinHTTP", "Go-http-client", "python-requests",
"Java/1.", "CobaltStrike", "Wget", "curl/7"
]);
// Detect HTTP/HTTPS beaconing and suspicious web protocol C2
DeviceNetworkEvents
| where Timestamp > ago(TimeWindow)
| where RemotePort in (80, 443, 8080, 8443)
| where RemoteIPType == "Public"
| where ActionType == "ConnectionSuccess"
| summarize
ConnectionCount = count(),
BytesSent = sum(SentBytes),
BytesReceived = sum(ReceivedBytes),
UniqueURLs = dcount(RemoteUrl),
FirstSeen = min(Timestamp),
LastSeen = max(Timestamp)
by DeviceName, InitiatingProcessFileName, RemoteIP, RemotePort
| extend Duration = datetime_diff('second', LastSeen, FirstSeen)
| extend AvgInterval = iff(ConnectionCount > 1, Duration / (ConnectionCount - 1), 0)
| where ConnectionCount > 15
| where AvgInterval between (1 .. 900)
| extend SentRecvRatio = iff(BytesReceived > 0, toreal(BytesSent) / toreal(BytesReceived), 999.0)
| extend BeaconConfidence = case(
AvgInterval between (55 .. 65), "high",
AvgInterval between (295 .. 305), "high",
AvgInterval between (895 .. 905), "high",
ConnectionCount > 100 and AvgInterval < 120, "high",
"medium")
| project LastSeen, DeviceName, InitiatingProcessFileName, RemoteIP, RemotePort, ConnectionCount, AvgInterval, BytesSent, BytesReceived, SentRecvRatio, BeaconConfidence
| sort by ConnectionCount desc Data Sources
Required Tables
False Positives
- Browser tabs with auto-refresh or long-polling (e.g., dashboards, social media feeds, stock tickers)
- Cloud sync clients (OneDrive, Dropbox, Google Drive) that poll for changes at regular intervals
- Software update mechanisms (WSUS, SCCM, apt-get) performing periodic HTTP checks
- Monitoring agents and health-check probes sending heartbeats to SaaS management consoles
References (7)
- https://attack.mitre.org/techniques/T1071/001/
- https://arxiv.org/ftp/arxiv/papers/1408/1408.1136.pdf
- http://cdn0.vox-cdn.com/assets/4589853/crowdstrike-intelligence-report-putter-panda.original.pdf
- https://securityintelligence.com/posts/brazking-android-malware-upgraded-targeting-brazilian-banks/
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1071.001/T1071.001.md
- https://github.com/activecm/rita
- https://engineering.salesforce.com/tls-fingerprinting-with-ja3-and-ja3s-247362855967/
Unlock Pro Content
Get the full detection package for T1071.001 including response playbook, investigation guide, and atomic red team tests.