Cryptojacking in the Cloud: Investigating Attacks on Container Clusters

Adelia Ibragimova (Security Engineer · EPO System)

Cloud Village @ DEF CON 33 · Day 1 · Cloud Village

Overview

Adelia Ibragimova’s workshop, "Cryptojacking in the Cloud: Investigating Attacks on Container Clusters," at Cloud Village, offered attendees a unique, hands-on opportunity to engage with a critical and pervasive threat in modern cloud environments: cryptojacking. Far from a typical lecture, this session was structured as an interactive Capture The Flag (CTF) event, placing participants directly into the role of an incident response team. The core mission was to investigate a simulated, yet realistic, cryptomining incident within a containerized cloud infrastructure, requiring teams to identify compromised resources, analyze forensic logs, and meticulously reconstruct the attacker's sequence of actions.

Watch on YouTube

Visual summary for Cryptojacking in the Cloud: Investigating Attacks on Container Clusters by Adelia Ibragimova
Visual summary for Cryptojacking in the Cloud: Investigating Attacks on Container Clusters by Adelia Ibragimova

Cryptojacking in the Cloud: Investigating Attacks on Container Clusters

Speakers: Adelia Ibragimova, Security Engineer, EPO System

Conference: Cloud Village

YouTube: https://www.youtube.com/watch?v=Q4X0fOd-3kI

Overview

Adelia Ibragimova’s workshop, "Cryptojacking in the Cloud: Investigating Attacks on Container Clusters," at Cloud Village, offered attendees a unique, hands-on opportunity to engage with a critical and pervasive threat in modern cloud environments: cryptojacking. Far from a typical lecture, this session was structured as an interactive Capture The Flag (CTF) event, placing participants directly into the role of an incident response team. The core mission was to investigate a simulated, yet realistic, cryptomining incident within a containerized cloud infrastructure, requiring teams to identify compromised resources, analyze forensic logs, and meticulously reconstruct the attacker's sequence of actions.

The significance of this talk lies in its practical approach to a problem that costs organizations millions annually in unauthorized cloud resource consumption and potential data breaches. Cryptojacking, the unauthorized use of computing resources to mine cryptocurrency, is a stealthy and increasingly sophisticated form of attack that targets various cloud services, including EC2 instances, container clusters, and CI/CD runners. By immersing participants in a simulated real-world scenario, Ibragimova aimed to equip security professionals with the practical skills and analytical mindset necessary to detect, analyze, and respond to such incidents effectively, without explicitly revealing the "solution" upfront.

This workshop underscored the critical need for hands-on experience in cybersecurity. In an era where cloud native architectures dominate, understanding the nuances of how attackers exploit misconfigurations, weak credentials, or vulnerabilities within container ecosystems is paramount. The CTF format provided a safe yet challenging environment for participants to hone their incident response capabilities, fostering a deeper understanding of the attack lifecycle and the investigative techniques required to combat persistent cloud threats.

Background

Cryptojacking has evolved into a significant cybersecurity threat, particularly within cloud environments, due to the ease with which attackers can leverage scalable, on-demand compute resources for illicit cryptocurrency mining. The financial incentive for attackers is clear: by compromising an organization's cloud infrastructure, they can offload the substantial computational and electrical costs associated with mining onto their victims, generating profit with minimal personal outlay.

The problem's prevalence stems from several factors inherent to cloud computing. Firstly, the sheer scale and complexity of cloud environments often lead to misconfigurations or security gaps. Organizations rapidly deploy new services, sometimes overlooking granular security controls, especially within dynamic container clusters or CI/CD pipelines. Secondly, the allure of powerful, readily available compute resources makes cloud platforms prime targets. Attackers often target services like AWS EC2 instances, Kubernetes container clusters, and CI/CD runners because these offer significant processing power, often with high-bandwidth network access, ideal for computationally intensive mining operations.

Prior work in this domain has largely focused on identifying common attack vectors and developing detection mechanisms. Attackers typically gain initial access through various means, including exploiting vulnerabilities in public-facing applications, phishing to obtain IAM credentials, or compromising developer workstations that have access to cloud environments. Once inside, they often deploy a cryptominer (such as XMRig for Monero) and attempt to maintain persistence, escalating privileges to ensure the miner continues to run and to expand their foothold across the cloud estate. The stealthy nature of these operations means miners often run in the background, consuming resources without immediate obvious signs, until resource utilization spikes or unexpected billing charges alert administrators.

Adelia Ibragimova's workshop specifically aimed to focus on host-based and malware-based cryptojacking. Host-based attacks involve the direct compromise of virtual machines or container hosts, where the miner binary is executed. Malware-based attacks refer to the deployment of specific cryptomining software. The challenge for defenders is not only to detect the presence of the miner but also to understand how it got there, what other systems might be compromised, and how to prevent future incursions. This requires a deep understanding of cloud logging, network forensics, and process analysis within ephemeral containerized environments, which the CTF format was designed to facilitate.

Key Findings

As a hands-on workshop structured as a CTF, Adelia Ibragimova's session did not present "key findings" in the traditional sense of research discoveries. Instead, the "findings" were the insights and discoveries made by the participants themselves as they navigated a simulated real-world cryptojacking incident. The core objective, and thus the primary contribution of the workshop, was to guide participants through the process of generating their own findings by actively investigating a complex attack scenario.

The workshop's mission for participants was explicitly defined: "identify and analyze logs and identify each compromised resource and reconstruct the sequence attack." This implies that the "key findings" for attendees would revolve around:

  1. Identification of Compromised Resources: Participants were tasked with pinpointing specific cloud assets that had been breached. This would include identifying infected EC2 instances, compromised Kubernetes pods or nodes, and potentially abused CI/CD runners. The challenge would involve sifting through a large volume of data to isolate the affected components.
  2. Detection of Cryptomining Activity: A central finding would be the presence of unauthorized cryptomining processes. This could manifest as unusual CPU utilization spikes, unexpected outbound network connections to known mining pools, or the discovery of specific cryptominer binaries (e.g., xmrig, minerd) running on compromised hosts or within containers.
  3. Analysis of Log Data: The workshop emphasized log analysis as a primary investigative tool. Participants would uncover critical information by examining various log sources, such as:
  • AWS CloudTrail logs: To identify suspicious API calls related to IAM credential usage, resource creation, or modifications.
  • VPC Flow Logs: To track unusual network traffic patterns, particularly connections to external IP addresses associated with mining pools or command-and-control (C2) infrastructure.
  • Container/Kubernetes logs: To detect abnormal pod activity, container execution logs, or daemonset deployments indicative of compromise.
  • Host-level logs (e.g., auth.log, syslog, auditd): To identify suspicious user logins, privilege escalation attempts, or execution of unusual commands on underlying virtual machines.
  1. Reconstruction of the Attack Sequence: The ultimate "finding" would be a comprehensive understanding of the attacker's methodology. This includes:
  • Initial Access Vector: How the attacker first gained entry (e.g., exploited vulnerability, compromised credentials).
  • Privilege Escalation: How the attacker elevated their permissions within the environment.
  • Lateral Movement: If the attacker moved from one compromised resource to others.
  • Persistence Mechanisms: How the attacker ensured the cryptominer would restart or continue running (e.g., cron jobs, systemd units, Kubernetes DaemonSets).
  • Deployment of the Miner: Details about the specific cryptominer used, its configuration, and how it was deployed.
  • Exfiltration/C2: Communication channels used by the miner to send hashes and receive instructions from mining pools or attacker-controlled infrastructure.

By working through these investigative steps, participants would not only identify the symptoms of cryptojacking but also gain a deep understanding of the underlying attack chain, which is crucial for effective remediation and future prevention. The "key findings" were thus the practical skills and contextual knowledge acquired through this immersive learning experience.

Technical Deep Dive

The workshop, by design, did not present a pre-defined technical deep dive into a specific attack; instead, it guided participants through the technical processes required for an incident response deep dive. This section will outline the types of technical analysis and tools that would be leveraged by an incident response team investigating a cryptojacking incident in a containerized cloud environment, mirroring the challenges presented in the CTF.

A typical cryptojacking incident in the cloud often begins with an initial compromise, which could be anything from exploiting a web application vulnerability to a leaked AWS IAM access key. Once an attacker gains a foothold, their primary objective is to deploy and run cryptomining software while maintaining stealth and persistence. In a containerized environment, this becomes particularly complex due to the ephemeral nature of containers and the orchestration layers like Kubernetes.

1. Initial Access and Privilege Escalation:

The first step in any investigation is understanding initial access. This involves scrutinizing AWS CloudTrail logs for unusual API calls. For instance, CreateUser, AttachUserPolicy, UpdateAccessKey, or RunInstances calls originating from an unfamiliar IP address or at an unusual time could indicate a compromised IAM user. Within Kubernetes, initial access might come from an exposed dashboard, a vulnerable API endpoint, or a compromised CI/CD pipeline that deploys malicious containers. Investigating Kubernetes audit logs can reveal unauthorized kubectl commands, suspicious pod creations, or RoleBinding modifications.

2. Identifying Malicious Processes and Resource Consumption:

Once initial access is established, attackers deploy the miner. This often results in a significant spike in CPU utilization on the compromised host or within specific containers. Incident responders would use cloud monitoring tools like Amazon CloudWatch to identify abnormal resource consumption across EC2 instances, Fargate tasks, or Kubernetes nodes.

On the compromised host, tools like top, htop, ps aux, or lsof would be used to identify suspicious processes. For containers, docker stats, kubectl top pods, or crictl ps would be essential. The presence of binaries like xmrig, minerd, or custom-compiled mining software, often disguised with innocuous names, is a strong indicator. These binaries often reside in temporary directories (/tmp), user home directories, or are downloaded from external sources.

3. Network Forensics:

Cryptominers need to communicate with mining pools to submit hashes and receive rewards. This generates distinct network traffic patterns. Investigators would analyze VPC Flow Logs to identify outbound connections from compromised instances or pods to known mining pool IP addresses or domains. Tools like netstat -tuln or ss -tuln on the host, or kubectl exec into a container to run netstat (if available), can reveal active network connections. Analyzing DNS query logs can also expose lookups for suspicious domains. Attackers might use Tor or other proxy services to obscure their C2 traffic, which would appear as connections to unusual ports or IP ranges.

4. Persistence Mechanisms:

Attackers strive for persistence. In traditional Linux environments, this might involve modifying crontab, systemd units, or /etc/rc.local. In container clusters, persistence can be more sophisticated:

  • Kubernetes DaemonSets: An attacker could deploy a malicious DaemonSet that ensures a cryptomining pod runs on every node in the cluster, even if nodes are restarted.
  • Mutating Admission Webhooks: A compromised webhook could inject a sidecar container with a miner into every new pod created.
  • Compromised Container Images: Malicious code could be baked into a container image, which is then deployed across the cluster. Investigating container image registries (e.g., ECR) for unauthorized or modified images is crucial.
  • Host-level persistence: If the underlying node is compromised, persistence mechanisms might be implemented directly on the host OS, affecting all containers running on it.

5. Log Analysis and Correlation:

The cornerstone of any deep dive is comprehensive log analysis. This includes:

  • CloudTrail: For control plane activity.
  • VPC Flow Logs: For network traffic.
  • CloudWatch Logs/Container Insights: For application and container logs, including stdout/stderr from pods.
  • Kubernetes Audit Logs: For API server interactions.
  • Host-level logs: auth.log, syslog, auditd, bash history.
  • Security Hub/GuardDuty findings: These services can provide initial alerts and context.

Correlating timestamps across these diverse log sources is critical to reconstruct the full attack timeline. For example, a CloudTrail event showing AssumeRole followed by a Kubernetes audit log showing a new DaemonSet creation, and then a VPC Flow Log showing outbound connections to a mining pool, paints a clear picture.

6. Malware Analysis (if applicable):

If a cryptominer binary is recovered, basic static analysis (e.g., strings, file, readelf) can reveal its type, configuration parameters (e.g., mining pool address, wallet ID), and dependencies. Dynamic analysis in a sandboxed environment can observe its runtime behavior, network connections, and resource consumption without risking further compromise.

The CTF would have required participants to navigate these technical domains, piecing together evidence from disparate sources to understand the full scope and mechanics of the cryptojacking operation.

Demo / Proof of Concept

The entire workshop served as a comprehensive "Demo" or "Proof of Concept" in the form of an interactive Capture The Flag (CTF) event. Adelia Ibragimova designed the session as a "hands-up workshop" focused on a "real crypto mining incident investigation." Rather than demonstrating a specific exploit or attack chain herself, the speaker created an environment where participants would actively uncover and demonstrate the proof of concept of a cryptojacking attack by investigating its remnants.

The core of the demo was a simulated cloud environment (likely AWS, given the speaker's mention of EC2 instances and IAM credentials in the background theory) that had been compromised with a cryptominer. Participants were organized into teams and provided access to a dedicated CTF platform. This platform presumably offered an interface to the simulated environment, providing access to various log sources and potentially command-line access to compromised resources, mirroring a real-world incident response scenario.

The objective for each team was clear:

  • Identify and analyze logs: Participants had to sift through a variety of logs, which would include typical cloud logs (e.g., CloudTrail, VPC Flow Logs), container logs, and potentially host-level operating system logs.
  • Identify each compromised resource: This involved pinpointing the specific EC2 instances, Kubernetes pods, or other cloud services that were infected or misused by the attacker.
  • Reconstruct the sequence of attack: The ultimate goal was to build a coherent timeline of the attacker's actions, from initial access to miner deployment and persistence.

The speaker explicitly stated, "I will not be revealing how the tech work. You will need to come up with your own ideas and work as a real incident response team." This highlights the experiential nature of the demo. Participants were challenged to apply their knowledge of cloud security, incident response methodologies, and forensic analysis to solve "guided challenges." The mention of "download Docker Desktop" and "analyze CV on the platform" suggests that the CTF environment might have involved local Docker instances for some analysis or provided a web-based interface for interacting with a simulated container cluster.

The CTF format, where "each solved challenge earn burn points," gamified the learning process, encouraging active participation and problem-solving under time pressure. This practical, problem-based learning approach served as a powerful proof of concept for how cryptojacking attacks manifest in cloud environments and, critically, how security professionals can effectively investigate and respond to them in a hands-on, simulated setting. It allowed attendees to gain invaluable practical experience without the risks associated with analyzing live production incidents.

Defensive Implications

The hands-on investigation of a cryptojacking incident, as facilitated by Adelia Ibragimova's workshop, provides critical insights into robust defensive strategies for cloud and containerized environments. Effective defense against cryptojacking requires a multi-layered approach encompassing proactive prevention, vigilant detection, and a well-defined incident response plan.

1. Proactive Prevention:

  • Strong IAM Hygiene: Implement the principle of least privilege for all IAM users and roles. Regularly audit IAM policies for overly permissive permissions. Enforce Multi-Factor Authentication (MFA) for all accounts, especially administrative ones. Rotate access keys frequently and use temporary credentials where possible.
  • Network Segmentation and Security Groups: Isolate container clusters and critical resources using VPC network segmentation and restrictive security group rules. Limit inbound and outbound traffic to only what is absolutely necessary. Block outbound connections to known mining pool IP ranges and suspicious ports.
  • Container Security Best Practices:
  • Image Scanning: Integrate automated container image scanning (e.g., Clair, Trivy, AWS ECR image scanning) into CI/CD pipelines to detect vulnerabilities and malicious components before deployment.
  • Runtime Protection: Utilize Container Network Policy in Kubernetes to restrict pod-to-pod communication. Employ runtime security tools (e.g., Falco, Sysdig Secure) to monitor container behavior for suspicious activities like unusual process execution or outbound connections.
  • Least Privilege for Pods: Configure Kubernetes Pod Security Standards (PSS) or Pod Security Policies (PSP) (deprecated in favor of PSS) to enforce security contexts that limit container capabilities, prevent privileged escalation, and restrict access to host resources.
  • Regular Patching: Keep container hosts, Kubernetes components, and application dependencies regularly patched to mitigate known vulnerabilities that attackers might exploit for initial access.
  • Secure CI/CD Pipelines: Harden CI/CD runners and ensure they operate with minimal necessary permissions. Protect credentials used within pipelines and scan artifacts for malicious code.

2. Vigilant Detection:

  • Comprehensive Logging: Enable and centralize logs from all critical cloud services. This includes:
  • AWS CloudTrail: For all API activity.
  • VPC Flow Logs: For network traffic visibility.
  • CloudWatch Logs/Container Insights: For application, host, and container logs.
  • Kubernetes Audit Logs: For API server requests.
  • Host-level logs: auditd, syslog, process logs.
  • DNS query logs: To detect lookups for suspicious domains.
  • Anomaly Detection: Implement monitoring and alerting for unusual resource utilization spikes (CPU, memory, network egress), especially outside of normal operating hours. Leverage cloud-native services like Amazon GuardDuty or third-party Cloud Security Posture Management (CSPM) and Cloud Workload Protection Platform (CWPP) solutions that can detect cryptomining patterns and suspicious activity.
  • Threat Intelligence Integration: Integrate threat intelligence feeds containing known cryptomining pool IP addresses, domains, and malware signatures into security tools (e.g., WAFs, IDS/IPS, SIEMs) to proactively block or detect malicious communications.

3. Robust Incident Response:

  • Defined Incident Response Plan: Have a clear, tested incident response plan specifically for cloud and container incidents. This plan should cover identification, containment, eradication, recovery, and post-incident analysis.
  • Isolation Capabilities: Be prepared to rapidly isolate compromised instances or pods from the network to prevent lateral movement and further resource abuse.
  • Forensic Readiness: Ensure logging is sufficient for forensic analysis. Practice forensic data collection techniques for ephemeral containers and cloud instances.
  • Automated Response: Where possible, leverage automation (e.g., AWS Lambda functions triggered by CloudWatch alarms) to automatically quarantine or terminate compromised resources.

By integrating these defensive measures, organizations can significantly reduce their attack surface, improve their detection capabilities, and enhance their resilience against cryptojacking attacks in the dynamic landscape of cloud and containerized environments.

Key Takeaways

  • Hands-on Experience is Paramount: Investigating real-world cryptojacking incidents requires practical skills in log analysis, resource identification, and attack reconstruction, best learned through immersive exercises like CTFs.
  • Cryptojacking is a Persistent Cloud Threat: Attackers continually target cloud resources like EC2, container clusters, and CI/CD runners for unauthorized cryptocurrency mining, leading to significant financial costs and security risks for organizations.
  • Comprehensive Logging is Non-Negotiable: Effective incident response hinges on collecting and analyzing diverse log sources, including CloudTrail, VPC Flow Logs, Kubernetes audit logs, and host-level logs, to piece together the attack timeline.
  • Container Security Requires Specialized Focus: The ephemeral and orchestrated nature of container environments necessitates specific defensive strategies, including robust image scanning, runtime protection, and careful management of Kubernetes security policies and DaemonSets.
  • Multi-Layered Defense is Essential: A combination of strong IAM hygiene, network segmentation, anomaly detection, and a well-practiced incident response plan forms the most effective defense against sophisticated cloud attacks.
  • Focus on the "How" and "Why": Beyond merely detecting a cryptominer, understanding the initial access vector, privilege escalation, persistence mechanisms, and lateral movement tactics is crucial for complete eradication and future prevention.

About the Speaker(s)

Adelia Ibragimova is a dedicated Security Engineer with specialized expertise in cloud detection engineering and security automation. She currently contributes her skills to EPO System, a global entity focused on product development. Her professional background highlights a strong practical orientation towards identifying and mitigating threats within complex cloud infrastructures, making her well-suited to lead a hands-on workshop on investigating cryptojacking attacks.

Reviews

Dr. Zero (Offensive Security Researcher) — SOLID

A well-structured CTF workshop on cloud cryptojacking IR that delivers genuine hands-on value for practitioners who need reps in cloud forensics. Nothing here is novel research — it's competent pedagogy on a known threat class — but the format is honest about what it is, and the scenario design sounds solid.

Heather Calloway (CISO) — WEAK

A competent CTF workshop on cloud cryptojacking with solid technical scaffolding, but it produces no transferable findings, no governance signal, and no institutional takeaway. The hands-on format is appropriate for skill-building but leaves nothing on the table for security leaders or program owners.

→ Top-rated talks at Cloud Village @ DEF CON 33

All talks from Cloud Village @ DEF CON 33