Pacu

Field Detail
Summary Exploit and pivot within AWS
Category AWS exploitation framework
Phase exploitation, post-exploitation
Interface CLI (module framework)
Platform Linux, Windows, macOS
Licence Open source (BSD)
Docs https://github.com/RhinoSecurityLabs/pacu
Related Cloud auditing - ScoutSuite and Prowler, Metasploit, OSINT and recon

Offensive AWS exploitation framework (Rhino Security Labs) — the cloud analogue of Metasploit. Organised around modules that enumerate, escalate privileges, pivot and persist within an AWS account, working from a set of (authorised) credentials you've obtained.

⚠️ Warning — This modifies the account — strict scope Unlike the read-only auditors, many Pacu modules create/modify/delete AWS resources (new users, policies, backdoors). Only against accounts you're explicitly authorised to attack, ideally a dedicated test account. Log every change and clean up (whoami, review created resources) so nothing is left behind.

Start & set keys

pip install pacu     # or run the Docker image
pacu                 # launches the interactive console

# Inside Pacu:
import_keys default              # import from ~/.aws/credentials
set_keys                         # or paste access key / secret / session token manually
whoami                           # show the active key's identity/permissions gathered so far
swap_keys                        # multiple key sets

Pacu keeps everything in a session (SQLite-backed) so enumerated data and loot persist.

Core console commands

ls                     # list modules (by category)
search <term>          # find a module
help <module>          # module detail + required args
run <module> [args]    # execute
data                   # everything enumerated so far (users, roles, buckets, instances...)
services               # which AWS services you have data on
regions                # set/limit regions
exec <module>          # alias for run

Typical module flow

# 1. Enumerate your own permissions (what can this key do?)
run iam__enum_permissions
run iam__bruteforce_permissions        # discover perms by trial when enum is blocked
whoami

# 2. Enumerate the account's resources
run aws__enum_account
run ec2__enum
run s3__enum                           # buckets + access
run iam__enum_users_roles_policies_groups

# 3. Look for privilege-escalation paths
run iam__privesc_scan                  # checks for known IAM privesc (e.g. CreatePolicyVersion,
                                        #   PassRole, AttachUserPolicy, Lambda/Glue abuse...)

# 4. Loot / pivot
run ec2__download_userdata             # creds/secrets in instance user-data
run secrets__enum                      # Secrets Manager / Parameter Store
run ec2__startup_shell_script          # run commands via user-data (modifies instances!)
run lambda__enum

IAM privilege escalation (the heart of AWS attacks)

iam__privesc_scan maps the ~20 known IAM escalation techniques — e.g. iam:CreatePolicyVersion (rewrite a policy you can edit), iam:PassRole+ec2:RunInstances (launch an instance with a privileged role), lambda:CreateFunction+PassRole, iam:AttachUserPolicy (attach AdministratorAccess to yourself). Understand the technique it reports before running the follow-up module.

Persistence (lab/engagement only, and clean up)

run iam__backdoor_users_keys           # add a second access key to a user
run iam__backdoor_assume_role          # trust-policy backdoor on a role

These create attacker-controlled access — only with explicit authorisation and documented for removal.

More Pacu usage

set_regions us-east-1 eu-west-2        # scope regions (faster enum, less noise)
run aws__enum_account
run iam__enum_permissions --all-users
run iam__privesc_scan --offline        # analyse paths WITHOUT changing anything
run ec2__download_userdata             # creds stashed in instance user-data
run secrets__enum                      # Secrets Manager + SSM Parameter Store
run detection__enum_services           # what's logging you (GuardDuty/Config/CloudTrail)
run cloudtrail__download_event_history

data dumps everything enumerated; services lists what you've touched. Run --offline/read-only modules first — anything that creates or modifies AWS resources is in-scope-only and must be documented for cleanup.

Kill-chain usage

Exploitation

run iam__privesc_scan                    # find IAM escalation paths

Post-exploitation

run secrets__enum ; run ec2__download_userdata   # loot creds, pivot

Where it fits

Comes after you have AWS credentials (from OSINT and recon leaks, SSRF to the instance metadata service, a compromised app, or an exposure found by Cloud auditing - ScoutSuite and Prowler). ScoutSuite/Prowler tell you what's misconfigured; Pacu exploits it — enumerate perms, escalate IAM, loot secrets, pivot — the Metasploit of AWS.