Serverless
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.
let ServerlessDomains = dynamic([
"workers.dev", "pages.dev",
"cloudfunctions.net",
"lambda-url",
"execute-api",
"azurewebsites.net",
"azurecontainerapps.io",
"netlify.app",
"vercel.app",
"script.google.com"
]);
let SuspiciousProcesses = dynamic([
"powershell.exe", "pwsh.exe", "cmd.exe",
"wscript.exe", "cscript.exe", "mshta.exe",
"rundll32.exe", "regsvr32.exe", "msbuild.exe",
"python.exe", "python3.exe", "node.exe",
"curl.exe", "wget.exe", "wmic.exe", "bitsadmin.exe"
]);
let BrowserProcesses = dynamic([
"chrome.exe", "firefox.exe", "msedge.exe",
"iexplore.exe", "opera.exe", "brave.exe", "vivaldi.exe"
]);
DeviceNetworkEvents
| where Timestamp > ago(24h)
| where RemoteUrl has_any (ServerlessDomains)
| where InitiatingProcessFileName !in~ (BrowserProcesses)
| extend IsSuspiciousProcess = InitiatingProcessFileName in~ (SuspiciousProcesses)
| extend ServerlessPlatform = case(
RemoteUrl has "workers.dev" or RemoteUrl has "pages.dev", "Cloudflare Workers",
RemoteUrl has "cloudfunctions.net", "Google Cloud Functions",
RemoteUrl has "lambda-url" or RemoteUrl has "execute-api", "AWS Lambda/API Gateway",
RemoteUrl has "azurewebsites.net" or RemoteUrl has "azurecontainerapps.io", "Azure Functions",
RemoteUrl has "netlify.app", "Netlify Functions",
RemoteUrl has "vercel.app", "Vercel Serverless",
RemoteUrl has "script.google.com", "Google Apps Script",
"Other Serverless"
)
| project Timestamp, DeviceName, AccountName,
InitiatingProcessFileName, InitiatingProcessCommandLine,
InitiatingProcessParentFileName,
RemoteUrl, RemoteIP, RemotePort,
ServerlessPlatform, IsSuspiciousProcess
| sort by Timestamp desc Data Sources
Required Tables
False Positives
- Developer workstations running CI/CD scripts (Node.js, Python) that legitimately invoke AWS Lambda or Azure Functions APIs as part of build and test pipelines
- IT automation tools using PowerShell or curl to call serverless-hosted webhook endpoints, monitoring heartbeats, or deployment triggers
- Security scanning and vulnerability assessment tools probing cloud service APIs
- Build agents and deployment pipeline runners (Jenkins agents, GitHub Actions self-hosted runners) making legitimate Lambda or Cloud Function calls
- Monitoring agents and observability tools calling serverless-hosted status pages or synthetic monitoring endpoints
- RPA (Robotic Process Automation) tools that interact with web services hosted on serverless platforms
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.