Web Service
Adversaries may use an existing, legitimate external web service as a means for relaying data to/from a compromised system. Popular websites and cloud services such as Google Drive, OneDrive, Dropbox, Pastebin, GitHub, and Discord may act as C2 channels due to the high likelihood that hosts within a network already communicate with them. This provides cover in expected noise and takes advantage of SSL/TLS encryption offered by these providers. Use of web services also protects back-end C2 infrastructure from discovery through malware binary analysis while enabling operational resiliency through dynamic infrastructure changes.
let LegitBrowsers = dynamic(["chrome.exe", "firefox.exe", "msedge.exe", "iexplore.exe", "safari.exe", "opera.exe", "brave.exe"]);
let WebServiceDomains = dynamic([
"pastebin.com", "paste.ee", "ghostbin.co",
"api.github.com", "raw.githubusercontent.com", "gist.github.com",
"graph.microsoft.com", "onedrive.live.com", "api.onedrive.com",
"www.googleapis.com", "drive.google.com", "storage.googleapis.com",
"api.dropboxapi.com", "content.dropboxapi.com",
"discord.com", "discordapp.com", "cdn.discordapp.com",
"api.telegram.org",
"slack.com", "api.slack.com",
"firebaseio.com", "firebase.googleapis.com",
"api.notion.so",
"gitee.com",
"top4top.io"
]);
DeviceNetworkEvents
| where Timestamp > ago(24h)
| where RemoteUrl has_any (WebServiceDomains) or RemoteIPType == "Public"
| join kind=inner (
DeviceProcessEvents
| where Timestamp > ago(24h)
| project DeviceId, ProcessId=tolong(ProcessId), FileName, ProcessCommandLine, InitiatingProcessFileName, AccountName, SHA256
) on DeviceId
| where RemoteUrl has_any (WebServiceDomains)
| where not(InitiatingProcessFileName has_any (LegitBrowsers))
| where not(FileName has_any (LegitBrowsers))
| where FileName !in~ ("OneDriveSetup.exe", "OneDrive.exe", "googledrivesync.exe", "dropbox.exe", "slack.exe", "teams.exe", "discord.exe")
| extend SuspiciousProcess = FileName in~ ("powershell.exe", "pwsh.exe", "cmd.exe", "wscript.exe", "cscript.exe", "mshta.exe", "rundll32.exe", "regsvr32.exe", "certutil.exe", "bitsadmin.exe", "curl.exe", "wget.exe")
| extend ScriptingProcess = FileName in~ ("python.exe", "python3.exe", "ruby.exe", "perl.exe", "node.exe", "wscript.exe", "cscript.exe")
| extend UnusualParent = InitiatingProcessFileName in~ ("winword.exe", "excel.exe", "powerpnt.exe", "outlook.exe", "acrobat.exe", "acrord32.exe")
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
InitiatingProcessFileName, RemoteUrl, RemoteIP, RemotePort,
SuspiciousProcess, ScriptingProcess, UnusualParent, SHA256
| sort by Timestamp desc Data Sources
Required Tables
False Positives
- Legitimate developer tools or CI/CD pipelines making API calls to GitHub, Firebase, or Google APIs
- IT management tools and monitoring agents that poll cloud APIs for configuration or telemetry upload
- Custom line-of-business applications built on cloud storage APIs (OneDrive, Google Drive SDK integrations)
- PowerShell scripts used legitimately by administrators to upload logs or reports to cloud storage
- Antivirus or endpoint agents uploading telemetry to cloud-hosted collection endpoints
References (10)
- https://attack.mitre.org/techniques/T1102/
- https://www.broadcom.com/support/security-center/protection-bulletin/birdyclient-malware-leverages-microsoft-graph-api-for-c-c-communication
- https://www.welivesecurity.com/en/eset-research/evasivepanda-apt-group-uses-update-channels-of-legitimate-applications-for-cyberespionage/
- https://symantec-enterprise-blogs.security.com/threat-intelligence/daggerfly-apt-actor-macos
- https://unit42.paloaltonetworks.com/latrodectus-cybercrime-affiliate-activity/
- https://www.microsoft.com/en-us/security/blog/2021/05/28/breaking-down-nobelium-latest-early-stage-toolset/
- https://www.cybereason.com/blog/molerats-in-the-cloud-new-malware-arsenal-abuses-cloud-platforms-in-middle-east-espionage-campaign
- https://blog.talosintelligence.com/2018/08/rocke-champion-of-monero-miners.html
- https://hp.com/h20195/v2/getpdf.aspx/a00127091enw.pdf
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1102/T1102.md
Unlock Pro Content
Get the full detection package for T1102 including response playbook, investigation guide, and atomic red team tests.