Detecting Cloud Command and Control

Dagmawi Mulugeta (Threat Researcher · Netskope Threat Labs)

Swiss Cyber Storm 2022 · Day 1 · Arena

Overview

In an increasingly cloud-centric world, traditional cybersecurity defenses struggle to identify sophisticated threats that blend seamlessly with legitimate network traffic. Dagmawi Mulugeta, a Threat Researcher at Netskope Threat Labs, tackled this critical challenge at Swiss Cyber Storm with his talk, "Detecting Cloud Command and Control." This presentation delved into the evolving landscape of Command and Control (C2) operations, specifically focusing on how malicious actors are increasingly abusing legitimate cloud applications like Dropbox, GitHub, and Slack to orchestrate their attacks.

Watch on YouTube · Slides

Visual summary for Detecting Cloud Command and Control by Dagmawi Mulugeta
Visual summary for Detecting Cloud Command and Control by Dagmawi Mulugeta

Key moments

  1. 0:00 Introduction and Cloud C2 detection problem statement
  2. 4:10 What is Cloud C2 and why attackers use it
  3. 7:00 Why Cloud C2 is challenging for existing security controls
  4. 10:30 Behavior-based detection approach using five signal categories
  5. 13:40 Analyzing anomalous user agents and authentication methods
  6. 20:00 Demo: Detecting Empire C2 abusing Dropbox
  7. 23:20 Demo: Detecting C3 C2 abusing Slack with unique indicators

Detecting Cloud Command and Control

Speakers: Dagmawi Mulugeta, Threat Researcher, Netskope Threat Labs

Conference: Swiss Cyber Storm

YouTube: https://www.youtube.com/watch?v=lL3umkc2-a0

Overview

In an increasingly cloud-centric world, traditional cybersecurity defenses struggle to identify sophisticated threats that blend seamlessly with legitimate network traffic. Dagmawi Mulugeta, a Threat Researcher at Netskope Threat Labs, tackled this critical challenge at Swiss Cyber Storm with his talk, "Detecting Cloud Command and Control." This presentation delved into the evolving landscape of Command and Control (C2) operations, specifically focusing on how malicious actors are increasingly abusing legitimate cloud applications like Dropbox, GitHub, and Slack to orchestrate their attacks.

Mulugeta's research addresses a significant blind spot for many organizations: the inability to discern malicious C2 traffic from the deluge of encrypted, legitimate cloud application traffic. For corporations with vast networks and hundreds of thousands of clients, the sheer volume and encryption of this traffic make traditional detection methods, such as IP and domain blocklists, obsolete. The talk presented a novel, behavior-based approach to detect these evasive C2 channels, offering actionable insights and a proof-of-concept demonstration for defenders.

The importance of this research cannot be overstated. As organizations accelerate their adoption of cloud services, the attack surface expands, and adversaries adapt quickly. Mulugeta's work provides a crucial framework for identifying the subtle behavioral anomalies that betray a hidden C2 channel, empowering security teams to protect their networks against sophisticated threats that leverage the very tools designed for productivity and collaboration.

Background

▶ Watch: Introduction and Cloud C2 detection problem statement (0:00)

To understand Cloud Command and Control (Cloud C2), it's essential to first grasp the concept of traditional C2 within the broader Cyber Kill Chain. The Cyber Kill Chain outlines the typical steps an attacker follows to compromise a target system. After initial reconnaissance, weaponization, delivery, exploitation, and installation of malware, the C2 stage begins. This involves the installed malware "phoning home" to an attacker-controlled server to pull additional commands, execute them, and return results. Historically, this network communication has occurred over mediums like HTTPS and DNS directly to infrastructure owned or controlled by the attacker. Tools like Cobalt Strike are popular frameworks used to simulate and execute such traditional C2 operations.

While traditional C2 has posed significant detection challenges, the security community has developed robust defenses over time. Threat intelligence feeds, coupled with IP and domain-based blocklists, have become effective at identifying and blocking known attacker infrastructure. When security researchers observe malware communicating with specific IP addresses or domains, this information is quickly disseminated, allowing organizations to prevent connections to these malicious endpoints.

However, attackers have evolved, increasingly abusing legitimate cloud applications as a medium for their C2 communications. Instead of setting up their own dedicated infrastructure, they leverage platforms such like Dropbox, Google Drive, Slack, Amazon S3 buckets, Microsoft OneDrive, GitHub, Twitter, Tumblr, Blogspot, Google Docs, Pastebin, Telegram, and Microsoft Teams. The motivation behind this shift is compelling:

  • Minimal Setup: Cloud applications offer quick and easy setup, often requiring just an account.
  • Cost Efficiency: Many cloud services provide free tiers, allowing attackers to operate at little to no cost.
  • Blending with Legitimate Traffic: Perhaps most critically, C2 traffic routed through widely used cloud services like Google Drive or Microsoft 365 blends seamlessly with the legitimate traffic generated by employees within an organization. This makes it incredibly difficult to distinguish malicious activity from benign user behavior.

The prevalence of Cloud C2 is not theoretical; it is a well-documented and active threat. Mulugeta highlighted numerous malware samples known to abuse cloud platforms: Boxcon, Nimble Mamba, and Crutch have abused Dropbox; Graphite and Blue Light have abused OneDrive. The list extends to nearly every major cloud platform, underscoring the speaker's assertion that "no Cloud app is immune" and that organizations using any cloud service are potential targets. The extensive list of abused cloud applications is also detailed on MITRE's page, confirming this is a current and significant issue.

The fundamental problem with detecting Cloud C2 using existing controls lies in the destination of the traffic. As Mulugeta demonstrated with a Fiddler screenshot, both legitimate traffic from a native GitHub desktop app and malicious C2 traffic from a tool like C3 (a Cloud Command and Control framework) communicate with the exact same domain: api.github.com. This domain is a valid cloud provider domain, and the traffic is encrypted using the cloud provider's legitimate SSL/TLS certificate. Consequently, IP and domain-based blocklists are ineffective; blocking api.github.com would cripple an organization's ability to function. This necessitates a "new way" of detecting this sophisticated form of C2.

Key Findings

▶ Watch: Why Cloud C2 is challenging for existing security controls (7:00)

The central revelation of Dagmawi Mulugeta's research is that despite the inherent difficulty in distinguishing malicious Cloud C2 from legitimate cloud traffic, a behavior-based detection approach can effectively identify these hidden threats. The talk introduced a novel methodology that shifts the focus from blocking known bad infrastructure to analyzing subtle, yet distinct, behavioral anomalies within seemingly legitimate cloud communications.

Mulugeta's key finding is that by extracting and correlating a specific set of signals across five distinct categories – beaconing, anomalies, content, strange host access patterns, and sequences – defenders can build a robust detection mechanism. While no single signal is inherently malicious on its own, their collective presence and specific characteristics can strongly indicate C2 activity. This approach is powerful because it does not rely on static indicators (like IP addresses or domains) that attackers can easily change or hide behind legitimate services. Instead, it identifies the patterns of abuse that are difficult for attackers to mask without disrupting the functionality of their C2 channel.

The research culminated in a threshold-based test proof of concept, demonstrating that even a relatively simple aggregation of these signals can accurately flag Cloud C2 communications across different C2 frameworks (Empire, C3) and various cloud applications (Dropbox, GitHub, Slack). This highlights that detecting Cloud C2 is not an insurmountable problem, but rather one that requires a paradigm shift in how security teams approach network traffic analysis, moving towards a deeper understanding of application and user behavior.

Technical Deep Dive

▶ Watch: Behavior-based detection approach using five signal categories (10:30)

Mulugeta's detection approach for Cloud C2 is rooted in a detailed analysis of network traffic patterns, contrasting benign user activity with malicious C2 behavior within cloud applications. The research began by establishing a controlled lab environment designed to generate both legitimate and malicious cloud traffic.

The primary tools utilized for this research included:

  • Empire: An open-source, PowerShell and Python 3 post-exploitation framework. Empire is widely used for simulating traditional C2 activities and was adapted in this research to demonstrate cloud C2.
  • C3 (Cloud Command and Control): A specialized tool developed by F-Secure, C3 focuses on providing a wide array of cloud applications (over 10) that can be abused for C2. It integrates with other popular frameworks like Cobalt Strike and Covenant, making it a versatile platform for cloud C2 simulation.
  • Fiddler: A web debugging proxy. Fiddler was instrumental in the defensive aspect of the research, allowing for the decryption and logging of all HTTPS traffic originating from the lab machines, providing deep insight into network requests.

The lab machine setup was meticulously designed to mimic a real-world corporate environment while generating targeted malicious traffic. Each lab machine ran three categories of processes:

  1. Normal Browsing: Web browsers like Chrome and Firefox were used to visit various cloud applications, generating typical, benign user traffic.
  2. Native Cloud Applications: Sync clients such as the GitHub desktop app, the Slack app, and the Google Drive app were installed and actively used, contributing to the baseline of legitimate cloud traffic.
  3. Malicious Processes: Empire and C3 payloads were executed to generate the malicious Cloud C2 traffic, simulating real-world attacks.

All this traffic, both benign and malicious (collectively referred to as inline traffic), was routed through Fiddler. Fiddler decrypted the HTTPS communications, logged all requests and responses, and then exported this data as .ACC files for subsequent analysis. This comprehensive data collection was crucial for identifying the subtle differences between legitimate and malicious cloud interactions.

The core of Mulugeta's detection approach is to extract a set of specific signals from this inline traffic and use them to make an informed decision. These signals are categorized into five groups:

  1. Beaconing Signals: C2 communication often exhibits a characteristic "beaconing" pattern, where the compromised device periodically checks in with the C2 server. Signals here include:
  • Frequent checks to the same URL: Repeated requests to specific API endpoints.
  • Repeated request/response patterns: For example, a 409 (Conflict) on a GET request followed by a 200 (OK) on another GET request, signifying a command retrieval cycle.
  • Unusual process making requests: The requests originate from a non-browser or non-native application process.
  • Minimal deviation in data: The content or size of data sent/received remains largely consistent, indicating routine check-ins rather than varied user interaction.
  1. Anomaly Signals: These identify deviations from established user or organizational norms:
  • Unusual Cloud Entities: Use of Slack channels, GitHub repositories, or Dropbox folders that are atypical for the user or the organization. For instance, a user suddenly accessing a newly created, obscure GitHub repo.
  • Unusual User-Agents: Malware payloads often hardcode popular user agents (e.g., a specific browser version) to blend in. However, this might not align with the actual user agent profile of the compromised machine or user.
  • Unusual Usernames: Login attempts or activity associated with usernames not typically used by a corporate user, beyond their primary corporate email or a few known aliases.
  • Unusual Authentication Methods: Many large organizations enforce SSO (Single Sign-On) or IDP (Identity Provider) for cloud access. If traffic is observed using a bearer token directly in the header, it could be anomalous.
  1. Content Signals: Focus on the nature of the data being transmitted:
  • Encrypted or encoded content: C2 traffic frequently encrypts or encodes commands and exfiltrated data (e.g., Base64, AES) to evade detection. If data being sent or received is not human-legible ASCII text, it's a strong indicator.
  1. Strange Host Access Patterns: Some insights in this category were credited to F-Secure, the developers of C3:
  • Communication to unused cloud providers: If an organization doesn't use Slack, any traffic to slack.com should be flagged.
  • Lack of Referer header: Human browsing typically involves navigating between pages, resulting in Referer headers. Malware often makes direct requests, lacking this header.
  • Number of domains contacted: Legitimate native cloud applications (e.g., Slack) interact with numerous domains (CDNs, avatars, gifts, etc.) to function fully. Malware payloads, however, typically contact only a very limited set of domains (e.g., slack.com and files.slack.com).
  1. Sequence Signals: These detect robotic, non-human interaction patterns:
  • Spike in known hard-coded API endpoints: Malware often targets a specific, limited set of API endpoints for its operations. A sudden increase in traffic to these specific endpoints is suspicious.
  • Repeated command sequences: Robotic behavior might include a repetitive sequence like "download followed by delete followed by upload," which is highly unusual for human interaction.

Mulugeta emphasized that no single signal is definitively malicious on its own. The power of this approach lies in the correlation of multiple signals. For the proof of concept (POC) demonstration, a select set of these signals was chosen for simplicity: a low number of domains contacted, low referred traffic, a spike in known C2 domains/endpoints, encrypted/encoded data, low deviation in request intervals, and unusual authentication methods, user agents, repos, usernames, Slack channels, bots, or apps.

The threshold-based test for the POC was straightforward: if more than five of these selected signals were present for any given process-domain pair, the traffic was flagged as "likely malicious Cloud C2." Mulugeta acknowledged that a real-world implementation would benefit from more sophisticated methods like decision trees or robust statistical analysis, but the threshold-based test effectively illustrated the concept. This systematic approach, combining detailed data collection with behavioral signal analysis, forms the backbone of detecting evasive Cloud C2.

Demo / Proof of Concept

▶ Watch: Demo: Detecting Empire C2 abusing Dropbox (20:00)

Dagmawi Mulugeta provided a compelling demonstration using a Python script that implemented the threshold-based detection logic. The script processed thousands of network sessions, showcasing its ability to accurately identify Cloud C2 traffic across various scenarios.

Example 1: Empire Abusing Dropbox

The first scenario involved an Empire server uploading commands to Dropbox, with a victim machine pulling these commands, executing them, and uploading results back to Dropbox. The Python script analyzed approximately 4,000 processed-to-domain communications over a day.

The script successfully flagged one particular session as "likely Cloud C2." Upon inspection, the indicators for this session were:

  • Process: PowerShell process communicating with a Dropbox endpoint.
  • Request Volume & Domains: Sent over 860 requests to only two domains.
  • Referral: None of the traffic was referred (lacked a Referer header).
  • Authentication: Used a bearer token for authentication, which was unusual.
  • Content: The content being transmitted was encrypted.
  • Intervals: The time interval between requests was consistently two seconds with almost no deviation, indicating beaconing.
  • User Agent: An unusual user agent for the user was detected.
  • Endpoints: Requests were sent to two endpoints known to be associated with Cloud C2.

Example 2: C3 Abusing GitHub

The second demonstration featured C3 abusing GitHub. In this setup, C3 pushed commands to a GitHub repository, the victim pulled them down, executed them, and uploaded results back.

The script flagged two sessions as "likely Cloud C2."

  • First Session (api.github.com):
  • Request Volume & Domains: Over 600 requests to only two domains.
  • Referral: No referred traffic.
  • Content: The content was Base64 encoded.
  • Intervals: The request interval was approximately five seconds with a standard deviation of about two seconds, still indicative of a robotic pattern.
  • Repos: Communication involved unusual repositories, specifically a "slew of new repositories" that were not previously seen within the organization.
  • Username: An unusual username, "Insider threat 648," was used, which was unknown in the organization.
  • Second Session (raw.githubusercontent.com): This session was flagged for a similar set of reasons, indicating that the C3 payload was abusing multiple GitHub domains.

Example 3: C3 Abusing Slack

The final demonstration focused on C3 abusing Slack, showcasing the tool's adaptability across different cloud platforms.

Again, the script successfully identified a session as "likely Cloud C2" with the following indicators:

  • Request Volume & Domains: Over 1,000 requests to only two domains.
  • Referral: No referred traffic.
  • Authentication: Used a bearer token.
  • Content: The content was encrypted and encoded.
  • Intervals: Request intervals were around five seconds with a two-second deviation.
  • Usernames: Unusual usernames (represented by IDs in Slack) were observed.
  • Channels: Communication involved unusual channels, specifically a "hacking Channel" and other suspicious ones.
  • Apps/Bots: Unusual apps and bots were detected.
  • Endpoints: Requests were sent to seven known domains associated with Cloud C2.

Across all three distinct scenarios, the Python script, leveraging a simple threshold-based test on the identified behavioral signals, accurately detected the malicious Cloud C2 communication. This practical demonstration strongly validated Mulugeta's research, proving the viability of a behavior-based detection strategy.

Defensive Implications

▶ Watch: Demo: Detecting C3 C2 abusing Slack with unique indicators (23:20)

The insights from Dagmawi Mulugeta's talk are critical for security defenders grappling with the complexities of Cloud C2. The primary implication is a necessary shift in defensive strategy: move beyond static IP/domain blocklists to dynamic, behavior-based analysis of cloud traffic.

Here's what defenders should do with this information:

  1. Implement Comprehensive Network Traffic Monitoring: Organizations must have visibility into all network traffic, especially encrypted traffic destined for cloud services. This often requires deploying Cloud Access Security Brokers (CASBs) or similar proxy solutions that can decrypt and inspect HTTPS traffic in a controlled and compliant manner.
  2. Focus on Behavioral Analytics: Invest in security tools and platforms capable of analyzing traffic patterns for the specific signals identified in this research:
  • Beaconing Detection: Monitor for frequent, repetitive requests to the same cloud service endpoints from non-browser processes, especially with consistent time intervals and minimal data deviation.
  • Anomaly Detection in Cloud Entities: Track and baseline typical usage of cloud entities (e.g., GitHub repos, Slack channels, Dropbox folders) by users and processes. Flag access to newly created, unusual, or previously unseen entities, particularly if they are not part of legitimate workflows.
  • User-Agent and Username Anomaly Monitoring: Baseline standard user agents for corporate applications and user accounts. Alert on deviations, such as a process using an outdated or generic user agent, or activity from an unknown username.
  • Authentication Method Scrutiny: Pay close attention to authentication methods. While bearer tokens are legitimate, their presence in contexts typically governed by SSO/IDP, or from unusual processes, warrants investigation.
  • Content Inspection (where feasible and legal): If allowed by policy and regulation, inspect encrypted traffic content for patterns of encryption or encoding (e.g., Base64) that are not part of standard application protocols.
  • Referer Header and Domain Contact Analysis: Monitor for a lack of Referer headers in cloud traffic, especially when combined with a very limited number of contacted domains for a given process, as this is indicative of robotic behavior.
  • API Endpoint and Sequence Monitoring: Track API calls to cloud services. A sudden spike in usage of specific, potentially hard-coded API endpoints, or repetitive sequences of actions (e.g., download-delete-upload), should raise alerts.
  1. Integrate Threat Intelligence on Cloud Abuse: While blocking entire cloud domains is not feasible, threat intelligence can still be valuable for specific known C2 endpoints within legitimate cloud services. For example, knowing specific file paths or repository names used by malware can enhance detection rules.
  2. Baseline Normal Cloud Usage: Establish a comprehensive baseline of what "normal" cloud application usage looks like for different user groups and applications within the organization. This baseline is crucial for accurately identifying anomalies.
  3. Educate Users and Enforce Policies: Reinforce policies around cloud application usage. While technical controls are paramount, user education about suspicious links, files, or unexpected cloud interactions can act as an additional layer of defense.
  4. Leverage Sandbox Environments: Use sandbox environments to analyze suspicious files or URLs that point to cloud services, observing their communication patterns for the behavioral indicators discussed.

By adopting these proactive and behavior-focused defensive strategies, organizations can significantly enhance their ability to detect and mitigate the evolving threat of Cloud C2, protecting their sensitive data and systems from sophisticated adversaries.

Key Takeaways

  • Cloud C2 is a prevalent and sophisticated threat: Attackers are actively abusing legitimate cloud applications like Dropbox, GitHub, and Slack for Command and Control, making traditional detection methods obsolete.
  • Traditional security controls are ineffective: IP and domain-based blocklists fail against Cloud C2 because malicious traffic blends with legitimate communications to valid cloud provider domains, encrypted with their certificates.
  • Behavioral analysis is the key to detection: Identifying specific behavioral signals within cloud traffic, rather than relying on static indicators, is a viable and effective strategy for detecting Cloud C2.
  • Multiple signals, not single indicators, matter: No single signal is inherently malicious; true detection power comes from correlating a combination of signals across categories like beaconing, anomalies, content, host access patterns, and sequences.
  • Practical implementation is achievable: Even a relatively simple threshold-based test, using a select set of behavioral signals, can accurately identify Cloud C2 traffic from various C2 frameworks and cloud applications.
  • Defenders must adapt their strategies: Organizations need to shift focus to comprehensive network traffic monitoring, leveraging behavioral analytics, and baselining normal cloud usage to counter this evolving threat effectively.

About the Speaker(s)

Dagmawi Mulugeta is a Threat Researcher at Netskope Threat Labs. His work focuses on understanding and defending against emerging cyber threats, particularly those leveraging cloud environments. As highlighted in the introduction, Mulugeta has a strong background in cybersecurity, previously exploring the "attack side" of security. This experience provides him with a unique perspective, enabling him to develop effective defensive strategies by understanding the adversary's mindset and techniques. His presentation at Swiss Cyber Storm underscored his commitment to researching complex problems like Cloud C2 and delivering actionable solutions to the security community.

Reviews

Dr. Zero (Offensive Security Researcher) — WEAK

This is a SOC analyst onboarding module pitched as novel research. The core finding is that you can catch Empire or C3 beaconing to Slack by looking for consistent polling intervals and missing Referer headers, which the industry has known for years. It's basic heuristic analysis masquerading as a breakthrough.

Heather Calloway (CISO) — STRONG ACCEPT

Mulugeta proves what we have known for a while: legacy egress filtering is dead because attackers are hiding in our approved SaaS tenants. The detection logic is solid, but the unspoken prerequisite is pervasive SSL decryption, which is a major enterprise lift. Worth your detection engineering team's time, and a necessary reality check for network architects still relying on domain blocklists.

→ Top-rated talks at Swiss Cyber Storm 2022

All talks from Swiss Cyber Storm 2022