liveBook · Manning

Cryptojacking

As explained in Cyber Threat Hunting

Cryptojacking is the unauthorized use of computing resources to mine cryptocurrency for an attacker.

Cryptojacking is the unauthorized use of computing power to mine cryptocurrency. In a Kubernetes environment, it can turn a compromised workload into a launch point for mining deployments, consuming cluster capacity and extending an intrusion beyond the original container. section 5.1.3

Investigate suspected cryptojacking as an intrusion chain, not only a resource-use anomaly:

  • Correlate runtime alerts for a Kubernetes client executed inside a container with unexpected connections from that container to the Kubernetes API server. section 5.1.3
  • Identify deployment commands and images associated with mining; a command creating web-front from miningcontainers/xmrig is direct evidence of a mining workload. section 5.1.3
  • List pods across namespaces and inspect newly created or abnormal workloads, including repeated evicted pods bearing the deployment name. section 5.1.3
  • Preserve findings and hand the case to incident response for containment and coordination, while providing detection and prevention recommendations. section 5.1.3

Container escape to mining deployment

A compromised portal container runs kubectl, contacts the API server, and creates a web-front deployment using an XMRig mining image. The resulting web-front pods across the cluster confirm the cryptojacking hypothesis alongside unauthorized Kubernetes access. section 5.1.3

Listing 5.20 Falco event 1
10:51:03.656093989: Warning Docker or kubernetes client executed in
container (user=root user_loginuid=-1 k8s.ns=chapter5 
k8s.pod=portal-5647ffc5d7-bd9pv container=b362c11601d6 parent=bash 
cmdline=kubectl create deployment web-front --image=miningcontainers/xmrig 
-n chapter5 image=docker.io/dvyakimov/vuln-wheezy:latest) 
k8s.ns=chapter5 k8s.pod=portal-5647ffc5d7-bd9pv container=b362c11601d6

This alert records the mining deployment command, the affected portal pod, and the mining image, linking container activity directly to cryptojacking. section 5.1.3

How Cyber Threat Hunting covers it

How deep it goes
Explains cryptojacking through correlated runtime alerts, deployment commands, and pod inventory, then defers containment to incident response.
Examples
Uses a portal container that creates web-front pods from a miningcontainers/xmrig image, followed by evicted-pod inventory results.
What it assumes
Assumes familiarity with Kubernetes containers, pods, namespaces, kubectl, and incident-response roles.
What you can do after
Diagnose/debug with it by correlating container alerts, Kubernetes API activity, mining deployment commands, and pod listings.
How it connects
Connects container escape, Kubernetes API server access, Falco, service accounts, RoleBinding, and incident response.

This explainer was generated by Manning's knowledge graph from the text of Cyber Threat Hunting. The section links point to the parts of the book it draws on.