Join our Newsletter — 33% off our NHI Course
Home› Guides› T1102 Web Service Defensive Guide: Detecting C2 and…
Guide Attack Techniques & Malware

T1102 Web Service Defensive Guide: Detecting C2 and Exfiltration Over Trusted Cloud Services

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 27 October 2026 13 min read
On this page

When malware talks to OneDrive, Google Drive, GitHub, Telegram or Pastebin instead of an attacker's own server, domain blocklists and reputation feeds see nothing wrong. MITRE ATT&CK tracks this as T1102 Web Service: adversaries use an existing, legitimate external web service to relay data to and from a compromised system. Because the services are popular, already reached by most hosts and encrypted by default, the traffic blends into normal use. This guide explains the three T1102 sub-techniques in ATT&CK v20, where they show up, how to detect them from process and network telemetry, and the controls that actually work: tenant restrictions, per-process egress policy and sanctioned-app allowlists. It is for SOC analysts, detection engineers and network security architects, and it stays defensive throughout. For C2 in general, see the Command and Control (C2) Guide.

Key takeaways

  • The domain is not the indicator. T1102 traffic goes to the same hosts as legitimate work, so detection has to pivot on which process, which account and which tenant is on the other end.
  • Three shapes, three detection angles. Dead drop resolvers fetch a pointer and then move on, bidirectional channels poll and post, and one-way channels only read; each leaves a different footprint.
  • The attacker's account is the weak spot. Most web service C2 depends on an attacker-owned tenant, workspace or bot token, which tenant restrictions and sanctioned-instance controls can refuse.
  • Non-browser processes reaching SaaS APIs are rare. A script host or unsigned binary calling the Microsoft Graph, Dropbox, Discord or Telegram API is a high-value signal on most endpoints.
  • ATT&CK mitigations are thin here. v20 lists only M1021 Restrict Web-Based Content and M1031 Network Intrusion Prevention, so defenders must build the rest from egress architecture and telemetry.

How the attack works

ATT&CK v20 places T1102 in the Command and Control tactic on Windows, Linux, macOS and ESXi. The technique description gives two reasons adversaries choose it: hosts are likely to be talking to the service already before the compromise, and using a web service protects the back-end C2 infrastructure from discovery through malware binary analysis while letting the operator change that infrastructure at will. The service provider supplies the TLS certificate, the uptime and the reputation.

Sub-techniqueWhat the implant doesExamples recorded in ATT&CK v20
T1102.001 Dead Drop ResolverReads content posted on a legitimate site that contains an encoded or obfuscated domain or IP address, then connects to that real C2 serverPlugX storing C2 addresses on Pastebin; APT41 using GitHub, Pastebin and Microsoft TechNet; GlassWorm reading C2 data from the Solana blockchain; AppleJeus using a GitHub repository during the 3CX supply chain attack
T1102.002 Bidirectional CommunicationFetches commands from the service and posts results back to it, for example as a comment, a file update, a commit or a calendar eventLazarus Group pulling payloads from GitHub and committing command output; POLONIUM using OneDrive and Dropbox; the CALENDAR malware using Google Calendar events; ODAgent using the Microsoft Graph API against an attacker-controlled OneDrive
T1102.003 One-Way CommunicationReads instructions from the service but returns output over a different channel, or not at allGamaredon Group using Telegram content to find its C2 address; HAMMERTOSS downloading resources from Twitter; Leviathan reading instructions from profiles on GitHub and TechNet

Two adjacent techniques are often confused with T1102. Using a web service to send stolen data out is T1567 Exfiltration Over Web Service (T1567.002 Exfiltration to Cloud Storage), and downloading tools from it is T1105 Ingress Tool Transfer. Registering the account or bot in advance is Resource Development: T1583.006 Web Services when the adversary creates it, T1584.006 Web Services when they compromise someone else's. The same campaign usually shows several of these together, and the detections overlap.

Why it beats traditional controls

  • Allowlisted destinations: api.dropboxapi.com, graph.microsoft.com, api.telegram.org and raw.githubusercontent.com are often exempted from TLS inspection or categorised as business traffic.
  • Shared infrastructure: blocking an IP or certificate would break the service for everyone, so network indicators have short value.
  • Token-based access: the implant authenticates with an embedded API token or OAuth refresh token for the attacker's account (ATT&CK records BoomBox using a hardcoded Dropbox access token), so there is no failed login to alert on in your own tenant.
  • Disposable channels: a new paste, repository or bot can be created in minutes when one is taken down.

Where it shows up

Service classTypical abuseWhat makes it hard
Corporate cloud storage and mail (OneDrive, SharePoint, Google Drive, Microsoft Graph, Exchange Web Services)Tasking files, result uploads and staging in an attacker tenantSame hostnames as your own tenant; Symantec reported in August 2024 that GoGra, Grager, Onedrivetools and BirdyClient all used the Graph API this way
Code hosting (GitHub, GitLab, Gitee)Dead drops in READMEs or issues, commands in files, output in commitsDevelopers and build agents reach these hosts constantly
Paste and blog sites (Pastebin, Blogspot, WordPress, forums)Encoded C2 addresses in posts or commentsLow-volume reads that look like browsing
Messaging bots (Telegram, Discord, Slack)Bot API used as a command queue and result sinkBot tokens work from anywhere; webhooks need no interactive login
Social media and video sitesDead drop resolvers in profiles, video descriptions or postsRead-only access, often from browsers
Edge and tunnel services (Cloudflare Workers, trycloudflare subdomains, Firebase)Redirectors and hosted payloads under a trusted parent domainParent domain reputation is high; see the T1572 Protocol Tunnelling Defensive Guide
Public blockchainsC2 addresses written into transactions or smart contracts (GlassWorm, Tsundere Botnet)The record cannot be taken down

ATT&CK v20 also records APT41 DUST using compromised Google Workspace accounts for C2, which is the harder variant: the account belongs to a real organisation, so reputation and tenant checks alone will not catch it.

Impact

  • Long dwell time: a channel that looks like business SaaS can persist for months, and dead drop resolvers let the operator rotate real C2 servers without touching the implant.
  • Data loss without an obvious destination: bidirectional channels double as exfiltration paths. Symantec describes the Firefly tool uploading documents, email folders and accounting data to Google Drive.
  • Incident scoping gaps: logs in your own tenant do not show activity in the attacker's tenant. Microsoft states that Graph activity logs cover only the tenant where they are enabled.
  • Collateral blocking pressure: once found, the tempting response is to block a whole service the business depends on; plan the narrower controls below before that decision is forced.

Detection

ATT&CK v20 detection strategies for T1102 all correlate a process with its network activity: an uncommon or non-interactive process opening TLS to a web service, followed by unusual upload volume, automated posting or periodic polling. The data sources it names are Sysmon Event ID 1 (process creation), 3 (network connection) and 22 (DNS query) on Windows, auditd connect and execve on Linux, the unified log and osquery socket events on macOS, and Zeek-style conn and ssl logs on the network.

SignalTelemetrySub-techniqueTuning note
Script host, Office child process or unsigned binary resolving or connecting to SaaS API hosts (graph.microsoft.com, api.dropboxapi.com, api.telegram.org, discord.com/api, api.github.com)EDR or Sysmon 1, 3 and 22 joined on process GUID.002, .003Baseline the legitimate clients (OneDrive.exe, Teams, browsers, git) per host role and alert on the rest
Fixed-interval requests to the same API path from one hostProxy or SWG logs, Zeek conn.log.002, .003Jitter hides exact intervals; score on regularity over hours, not single gaps
Read of a paste, profile or repository followed within seconds by a connection to a rare domain or raw IPProxy logs plus DNS logs.001The second hop is often the easier catch; see the ATT&CK Detection Strategies and Analytics Guide
Sign-in or API use against a tenant, workspace or organisation that is not yoursProxy logs with tenant identifiers, TRv2 block events, CASB instance detectionAllThe strongest single signal when TLS inspection covers the sign-in hosts
Upload-heavy sessions to storage or messaging APIs from serversFlow logs, proxy byte counts.002Servers rarely upload to consumer storage at all
ESXi host or management agent sending HTTPS to external services without a patching or backup reasonESXi vmkernel and vpxd logs, firewall outbound logsAllATT&CK v20 added ESXi analytics for this technique

In Microsoft 365, the MicrosoftGraphActivityLogs table records every Graph request with AppId, ServicePrincipalId, IPAddress, UserAgent and RequestUri. It needs Entra ID P1 or P2, events can take up to two hours to arrive, and it will not show calls to an attacker's own tenant, so pair it with endpoint and proxy data.

Measuring the detection programme

  • Coverage: percentage of endpoints and servers whose process-to-network events reach the SIEM (target above 95% of servers).
  • Inspection scope: share of outbound TLS to sanctioned SaaS that passes through a control able to see the tenant or instance.
  • Unknown API clients: count of distinct non-allowlisted processes reaching SaaS API hosts per week, trending down as baselines mature.
  • Foreign tenant blocks: monthly TRv2 or equivalent blocks, each triaged; a sudden rise warrants a hunt.
  • Time to contain: hours from alert to host isolation and token report to the provider, measured in exercises.

Prevention and hardening

The ATT&CK mitigations are M1021 Restrict Web-Based Content, where web proxies enforce a policy that prevents use of unauthorised external services, and M1031 Network Intrusion Prevention, which uses signatures for specific malware. In practice the controls that change the outcome sit around the attacker's account and the calling process.

  1. Inventory sanctioned services: list the storage, code hosting, messaging and paste services the business actually uses and which tenants or organisations are yours. See the Shadow SaaS and Unsanctioned App Discovery Guide.
  2. Block what you do not use: Symantec's first recommendation after its 2024 Graph API research was to block cloud services the organisation does not use. Paste sites, consumer file lockers and bot APIs are common candidates. Use category and application controls on the Secure Web Gateway and Web Filtering Guide pattern.
  3. Restrict tenants, not domains: for Microsoft, Tenant Restrictions v2 inserts sec-Restrict-Tenant-Access-Policy: <TenantId>:<policyGuid> on requests to login.microsoftonline.com, login.microsoft.com, login.live.com and login.windows.net, blocking sign-in with foreign or consumer accounts. The proxy method covers the authentication plane only; Microsoft notes anonymous consumer OneDrive access is not covered and suggests blocking onedrive.live.com. For Google, the proxy adds X-GoogApps-Allowed-Domains with your domains, and omitting consumer_accounts blocks personal Gmail accounts. Both need TLS inspection of the sign-in hosts. A CASB can apply the same idea to other SaaS; see the CASB Guide.
  4. Bind egress to processes: only named clients should reach SaaS API hosts. Use EDR network rules, host firewall rules or application control so that script interpreters and unsigned binaries cannot. Symantec also recommends blocking non-browser processes from connecting to cloud services.
  5. Deny by default on servers: servers, hypervisors and OT gateways should reach only named update, backup and telemetry endpoints through a proxy (NIST SP 800-53 SC-7(5) Deny by Default, Allow by Exception).
  6. Close inspection gaps: review TLS inspection bypass lists. Exempting all of a large SaaS provider for performance hands T1102 operators a blind spot.

Rolling it out safely

  1. Run tenant restriction and process egress rules in log-only mode for two to four weeks and review what would have been blocked.
  2. Pilot on a security team ring, then a business unit, keeping a break-glass bypass group with an expiry date.
  3. Expect breakage: Microsoft documents that service principals are blocked by TRv2 with error AADSTS5000211 unless the policy allows them, and partner collaboration may need explicit allowances.
  4. Roll back by removing the header insertion rule or policy assignment; keep the change in your proxy configuration management so it can be reverted in minutes.

Small organisations without TLS inspection can still get most of the value from Universal TRv2 through Microsoft Global Secure Access or a cloud SWG, EDR process network rules and blocking paste and bot APIs. Large organisations should combine tenant controls with per-role egress baselines and route all server egress through an authenticating proxy.

Where identity fits

T1102 is an identity problem on both sides of the wire. On the attacker's side, the channel runs on an account, OAuth app or bot token, and providers can revoke it quickly if you report it with the token, account or repository name you recovered. On your side, APT41 DUST shows that compromised legitimate Workspace accounts can carry C2, so monitor service accounts and integration tokens for API use from unusual hosts. Treat any API token you find in a sample as evidence: preserve it, report it to the provider, and do not use it yourself. See the SaaS API Token Security Guide and the Slack Tokens Security Guide.

Framework mapping

FrameworkReferenceHow it applies to T1102
ATT&CK v20 mitigationsM1021 Restrict Web-Based Content; M1031 Network Intrusion Prevention; M1037 Filter Network TrafficProxy policy for unauthorised services, malware signatures, host and network egress filtering
MITRE D3FENDD3-OTF Outbound Traffic Filtering; D3-PMAD Protocol Metadata Anomaly Detection; D3-PHDURA Per Host Download-Upload Ratio Analysis; D3-EAL Executable AllowlistingEgress allowlists, beacon and metadata analysis, upload-heavy hosts, stopping unknown binaries that make the calls
NIST SP 800-53 Rev. 5SC-7 and SC-7(5); AC-4 Information Flow Enforcement; SI-4 and SI-4(4) Inbound and Outbound Communications Traffic; CM-7 Least FunctionalityBoundary and flow policy, monitoring outbound traffic, removing unneeded services
NIST CSF 2.0PR.IR-01; DE.CM-01; DE.AE-02Protect networks from unauthorised use, monitor network services, analyse adverse events

Practitioner checklist

  • List sanctioned storage, code, messaging and paste services and the tenants or organisations that belong to you.
  • Block unused paste sites, file lockers and bot APIs at the SWG.
  • Deploy Tenant Restrictions v2 and the Google allowed-domains header, in log mode first, with service principal exceptions planned.
  • Restrict SaaS API hosts to named client processes using EDR or host firewall rules.
  • Route server and ESXi egress through a deny-by-default proxy.
  • Join Sysmon 1, 3 and 22 (or EDR equivalents) and alert on non-baseline processes reaching SaaS APIs.
  • Hunt for paste or repository reads followed by connections to rare domains.
  • Enable Microsoft Graph activity logs and correlate with sign-in logs.
  • Write a provider reporting step into the C2 playbook so attacker accounts and tokens are taken down.
  • Track the five metrics above monthly.

Standards and references

Related NHI Mgmt Group resources: Command and Control (C2) Guide · T1090 Proxy Defensive Guide · Data Exfiltration Guide · CASB Guide · MITRE ATT&CK Guide for Defenders

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 27 October 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.