T1102.002
Bidirectional Communication
Adversaries may use an existing, legitimate external web service as a means for sending commands to and receiving output from a compromised system. Compromised systems may leverage popular websites and cloud storage platforms (Google Drive, OneDrive, Dropbox, GitHub, Pastebin, Twitter, Google Calendar) to host C2 instructions and receive command output. This technique is particularly evasive because traffic blends with legitimate business use of these services, which are commonly accessed prior to compromise and protected with SSL/TLS encryption.
Microsoft Sentinel / Defender
kusto
let WebServiceDomains = dynamic([
"api.dropboxapi.com", "content.dropboxapi.com", "dropbox.com",
"onedrive.live.com", "graph.microsoft.com", "sharepoint.com",
"drive.google.com", "docs.google.com", "googleapis.com", "calendar.google.com",
"api.github.com", "raw.githubusercontent.com", "gist.github.com",
"pastebin.com", "paste.ee", "ghostbin.com", "hastebin.com",
"api.twitter.com", "twitter.com", "t.co",
"api.telegram.org", "discord.com", "discordapp.com",
"slack.com", "api.slack.com",
"technet.microsoft.com", "notion.so", "trello.com",
"pcloud.com", "box.com", "mediafire.com", "yandex.com",
"sites.google.com", "blogspot.com", "wordpress.com"
]);
let SuspiciousProcesses = dynamic([
"powershell.exe", "pwsh.exe", "cmd.exe", "wscript.exe", "cscript.exe",
"mshta.exe", "rundll32.exe", "regsvr32.exe", "certutil.exe",
"python.exe", "python3.exe", "pythonw.exe",
"curl.exe", "wget.exe", "bitsadmin.exe"
]);
DeviceNetworkEvents
| where Timestamp > ago(24h)
| where RemoteUrl has_any (WebServiceDomains) or RemoteIPType == "Public"
| where InitiatingProcessFileName has_any (SuspiciousProcesses)
| extend IsCloudStorage = RemoteUrl has_any ("dropbox.com", "onedrive.live.com", "drive.google.com", "sharepoint.com", "box.com", "pcloud.com")
| extend IsPasteSite = RemoteUrl has_any ("pastebin.com", "paste.ee", "ghostbin.com", "hastebin.com", "gist.github.com")
| extend IsSocialMedia = RemoteUrl has_any ("twitter.com", "api.twitter.com", "t.co", "blogspot.com", "discord.com")
| extend IsDevPlatform = RemoteUrl has_any ("api.github.com", "raw.githubusercontent.com", "gist.github.com")
| extend IsMessaging = RemoteUrl has_any ("api.telegram.org", "slack.com", "api.slack.com")
| join kind=leftouter (
DeviceProcessEvents
| where Timestamp > ago(24h)
| project ProcessTimestamp=Timestamp, DeviceName, InitiatingProcessId=ProcessId,
ProcessCommandLine, InitiatingProcessCommandLine,
InitiatingProcessParentFileName
) on DeviceName, $left.InitiatingProcessId == $right.InitiatingProcessId
| extend SuspiciousCmdLine = InitiatingProcessCommandLine has_any (
"-enc", "-EncodedCommand", "DownloadString", "Invoke-Expression", "IEX",
"Net.WebClient", "Invoke-WebRequest", "Start-BitsTransfer",
"[Convert]::FromBase64", "frombase64", "base64"
)
| where IsCloudStorage or IsPasteSite or IsSocialMedia or IsDevPlatform or IsMessaging
| project Timestamp, DeviceName, AccountName,
InitiatingProcessFileName, InitiatingProcessCommandLine,
RemoteUrl, RemoteIP, RemotePort,
IsCloudStorage, IsPasteSite, IsSocialMedia, IsDevPlatform, IsMessaging,
SuspiciousCmdLine, InitiatingProcessParentFileName
| sort by Timestamp desc high severity
medium confidence
Data Sources
Network Traffic: Network Connection Creation Process: Process Creation Microsoft Defender for Endpoint
Required Tables
DeviceNetworkEvents DeviceProcessEvents
False Positives
- Legitimate IT automation scripts using PowerShell to interact with OneDrive, SharePoint, or Microsoft Graph API for business purposes
- Developer workstations using curl, Python, or PowerShell to access GitHub APIs, Pastebin, or other development resources
- Backup and sync agents or IT tools that legitimately upload/download files from Dropbox, OneDrive, or Google Drive
- Security tools or monitoring scripts that use Pastebin or GitHub to pull configuration data or threat intelligence feeds
- Collaboration tools (Slack, Teams, Discord) that spawn browser processes or helper utilities to handle webhooks or integrations
Last updated: 2026-04-13 Research depth: deep
References (12)
- https://attack.mitre.org/techniques/T1102/002/
- https://www.welivesecurity.com/2019/05/29/turla-powershell-usage/
- https://research.checkpoint.com/2021/indigozebra-apt-continues-to-target-central-asia-with-evolving-tools/
- https://www.welivesecurity.com/2020/12/02/turla-crutch-keeping-back-door-open/
- https://www.trendmicro.com/en_us/research/20/b/the-operation-drbcontrol-uncovering-a-cyberespionage-campaign-targeting-gambling-companies-in-southeast-asia.html
- https://www.proofpoint.com/us/threat-insight/post/leviathan-espionage-actor-spearphishes-maritime-and-defense-targets
- https://www.mandiant.com/sites/default/files/2022-02/rt-apt1-report.pdf
- https://blog.f-secure.com/wp-content/uploads/2019/10/CozyDuke.pdf
- https://www.microsoft.com/en-us/security/blog/2022/06/02/exposing-polonium-activity-and-infrastructure-targeting-israeli-organizations/
- https://cloud.google.com/blog/topics/threat-intelligence/unc3886-espionage-targets
- https://www.welivesecurity.com/en/eset-research/oilrig-uses-backdoors-downloader-cyberespionage-campaigns-against-israel/
- https://arxiv.org/ftp/arxiv/papers/1408/1408.1136.pdf
Unlock Pro Content
Get the full detection package for T1102.002 including response playbook, investigation guide, and atomic red team tests.
Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance