Detect Serverless in CrowdStrike LogScale
Adversaries may purchase and configure serverless cloud infrastructure, such as Cloudflare Workers, AWS Lambda functions, or Google Apps Scripts, to use during operations. By routing command-and-control (C2) traffic through serverless platforms, adversaries blend malicious communications with legitimate cloud provider traffic. Traffic from infected endpoints appears to target known cloud provider domains (workers.dev, cloudfunctions.net, lambda-url.amazonaws.com), making it difficult to distinguish from ordinary SaaS or cloud API usage. The serverless runtime proxies requests to adversary-owned infrastructure while the cloud provider absorbs attribution complexity. Detection requires identifying beaconing behavior, non-browser processes connecting to serverless endpoints, and anomalous DNS query patterns to serverless platform domains.
MITRE ATT&CK
- Tactic
- Resource Development
- Technique
- T1583 Acquire Infrastructure
- Sub-technique
- T1583.007 Serverless
- Canonical reference
- https://attack.mitre.org/techniques/T1583/007/
LogScale Detection Query
#event_simpleName=DnsRequest
| regex(field=DomainName, regex="(?i)(\.workers\.dev|\.pages\.dev|\.cloudfunctions\.net|\.execute-api\..*\.amazonaws\.com|\.lambda-url\..*\.amazonaws\.com|\.azurewebsites\.net|\.azurecontainerapps\.io|\.netlify\.app|\.vercel\.app|^script\.google\.com)$")
| regex(field=ImageFileName, regex="(?i)(chrome|firefox|msedge|iexplore|opera|brave|vivaldi)\.exe$", negate=true)
| eval(is_suspicious_process=if(
match(field=ImageFileName, regex="(?i)(powershell|pwsh|cmd|wscript|cscript|mshta|rundll32|regsvr32|msbuild|python.*|node|curl|wget|wmic|bitsadmin)\.exe$"),
"true", "false"
))
| eval(serverless_platform=case(
match(field=DomainName, regex="(?i)(workers\.dev|pages\.dev)"), "Cloudflare Workers",
match(field=DomainName, regex="(?i)cloudfunctions\.net"), "Google Cloud Functions",
match(field=DomainName, regex="(?i)(execute-api|lambda-url).*amazonaws\.com"), "AWS Lambda",
match(field=DomainName, regex="(?i)(azurewebsites\.net|azurecontainerapps\.io)"), "Azure Functions",
match(field=DomainName, regex="(?i)netlify\.app"), "Netlify Functions",
match(field=DomainName, regex="(?i)vercel\.app"), "Vercel Serverless",
match(field=DomainName, regex="(?i)script\.google\.com"), "Google Apps Script",
default="Other Serverless"
))
| table([_time, ComputerName, UserName, ImageFileName, CommandLine, DomainName, serverless_platform, is_suspicious_process])
| sort(field=_time, order=desc) CrowdStrike LogScale (Falcon) detection using DnsRequest events to identify DNS resolutions for serverless platform domains initiated by non-browser processes on Falcon-protected endpoints. The query filters browser processes, classifies the targeted serverless provider, and flags process names associated with C2 loaders and living-off-the-land execution. For correlated connection data, join against NetworkConnectIP4 events on ContextProcessId and ComputerName.
Data Sources
Required Tables
False Positives & Tuning
- Developer endpoints where node.exe or python.exe routinely resolve serverless function domains during application development, serverless framework hot-reload cycles, or npm/pip package installs that phone back to cloud-hosted registries
- Endpoint management and patch orchestration tools that use PowerShell or wmic.exe to query AWS Lambda or Azure Function endpoints for update manifests or agent configuration payloads
- Automated red team tooling or breach-and-attack simulation (BAS) platforms that resolve and connect to operator-controlled serverless C2 simulators during scheduled purple-team exercises
Other platforms for T1583.007
Testing Methodology
Validate this detection against 4 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 1PowerShell Beaconing to Cloudflare Workers Endpoint
Expected signal: Sysmon Event ID 1: powershell.exe spawned with command line containing Invoke-WebRequest and the workers.dev URL. Sysmon Event ID 22: 5 DNS query events for df00tech-sentinel-test.argustest.workers.dev. Sysmon Event ID 3: 5 Network Connection events from powershell.exe to the Cloudflare IP on port 443. PowerShell ScriptBlock Log Event ID 4104 capturing the full loop script.
- Test 2Python Script Polling AWS Lambda Function URL
Expected signal: Sysmon Event ID 1: python.exe (or python3.exe) process created with command line containing lambda-url and amazonaws.com. Sysmon Event ID 22: DNS query events for the Lambda URL subdomain (abcde12345fghij.lambda-url.us-east-1.amazonaws.com). Sysmon Event ID 3: Network connection events from python.exe to AWS IP ranges on port 443. Connections will fail with connection refused but process and DNS events fire.
- Test 3WScript Invoking Google Apps Script Web App (BlackWater Technique)
Expected signal: Sysmon Event ID 1: cmd.exe spawning echo to create the .js file, then wscript.exe executing df00tech_gapps_test.js. Sysmon Event ID 11: File Create event for df00tech_gapps_test.js in %TEMP%. Sysmon Event ID 22: DNS query for script.google.com. Sysmon Event ID 3: Network connection from wscript.exe to Google IP on port 443 with DestinationHostname=script.google.com.
- Test 4cURL Beaconing to Google Cloud Function (Repeated Intervals)
Expected signal: Sysmon Event ID 1: cmd.exe created with the for loop command, then curl.exe spawned 4 times as child processes with the cloudfunctions.net URL as an argument. Sysmon Event ID 22: DNS query events for us-central1-df00tech-argus-test.cloudfunctions.net. Sysmon Event ID 3: 4 Network Connection events from curl.exe to Google Cloud IP on port 443. Connections will return an error but process and DNS events fire regardless.
References (8)
- https://attack.mitre.org/techniques/T1583/007/
- https://www.bleepingcomputer.com/news/security/blackwater-malware-abuses-cloudflare-workers-for-c2-communication/
- https://blog.xpnsec.com/aws-lambda-redirector/
- https://awakesecurity.com/blog/threat-hunting-series-detecting-command-control-in-the-cloud/
- https://www.bleepingcomputer.com/news/security/hackers-abuse-google-apps-script-to-steal-credit-cards-bypass-csp/
- https://developers.cloudflare.com/workers/
- https://docs.aws.amazon.com/lambda/latest/dg/lambda-urls.html
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1583.007/T1583.007.md
Unlock Pro Content
Get the full detection package for T1583.007 including response playbook, investigation guide, and atomic red team tests.