Pacu
What is Pacu?
Pacu is named after a type of Amazonian fish, symbolizing its role as a lightweight yet effective tool for navigating the AWS cloud environment.
Developed by Rhino Security Labs, Pacu offers modular functionality, meaning users can load different modules to perform specific tasks such as privilege escalation, data exfiltration, or service enumeration.
Key Features of Pacu:
Modular Structure:
Pacu works through modules designed for individual tasks. You can run these modules independently, depending on your goals.
Examples:
IAM privilege escalation checks
Lambda service enumeration
S3 bucket enumeration
Credential Management:
Pacu allows testers to store and switch between AWS credentials to target multiple accounts. This is useful when evaluating security across different environments.
Simulated Exploits:
It can simulate privilege escalation, insecure S3 configurations, and token compromise scenarios.
The tool does not actively exploit vulnerabilities but shows how vulnerabilities can be abused.
Persistence and Attack Automation:
Supports creating persistent backdoors (e.g., rogue IAM users).
It automates common attack paths like escalating permissions or gaining unauthorized access.
Interactive Command-Line Interface (CLI):
Pacu operates from a Python-based interactive CLI where modules can be called, and results are saved in session-based projects for reporting and tracking.
Reporting and Session Persistence:
Sessions allow testers to save progress and generate reports on what vulnerabilities or issues were identified during the testing.
Common Modules in Pacu:
IAM-Related Modules:
iam__enum_users_roles_policies
: Enumerates IAM users, roles, and attached policies.iam__privesc_scan
: Scans for privilege escalation opportunities (like policies withAction: *
).
S3 Storage Modules:
s3__enum_buckets
: Identifies public and private S3 buckets.s3__bucket_takeover
: Simulates bucket takeover scenarios.
Lambda and EC2 Modules:
lambda__enum
: Lists AWS Lambda functions and their permissions.ec2__enum
: Enumerates EC2 instances, security groups, and networking configurations.
Credential Modules:
iam__backdoor_users_keys
: Generates backdoor IAM users with programmatic keys.iam__create_keys
: Creates new access keys for existing IAM users (if allowed by permissions).
Networking Modules:
vpc__enum
: Enumerates VPCs, subnets, and network ACLs.route53__enum_zones
: Lists DNS zones configured in AWS Route 53.
Example Workflow Using Pacu:
Setup and Configuration:
Clone the Pacu repository:
bashCopy codegit clone https://github.com/RhinoSecurityLabs/pacu.git cd pacu pip install -r requirements.txt
Start Pacu:
bashCopy codepython3 pacu.py
Load AWS Credentials:
Use the command to load AWS credentials:
bashCopy codeset_keys
Switch between multiple credentials during the session using:
bashCopy codeuse_profile
Run Modules:
Run an enumeration module (e.g., S3 buckets):
bashCopy coderun s3__enum_buckets
Scan for privilege escalation opportunities:
bashCopy coderun iam__privesc_scan
Review Findings:
List session results using:
bashCopy codelist_sessions
Export results to a JSON or text report.
Use Cases for Pacu in AWS Security Testing:
Identify Misconfigurations:
Misconfigured IAM roles, public S3 buckets, over-permissioned Lambda functions.
Privilege Escalation Testing:
Assess IAM policies to see if attackers can escalate their privileges.
Simulate Insider Threats:
Test how compromised credentials or misconfigured services could be abused.
Evaluate S3 Security Posture:
Ensure no public buckets expose sensitive information.
Validate Security Controls:
Test persistence mechanisms like rogue IAM users and validate if security monitoring tools detect them.
Benefits of Pacu:
Free and open-source: Anyone can use and customize it.
Modular flexibility: Only load the modules you need for a specific test.
Interactive CLI: Provides an easy-to-use interface for beginners and experts.
Reporting features: Useful for compliance and documentation after testing.
Limitations of Pacu:
No Active Exploits: Pacu is designed to simulate attacks but won’t directly exploit AWS services.
AWS API Rate Limits: Since Pacu relies on AWS APIs, it may run into throttling limits during large-scale assessments.
Lacks Active Blue Team Evasion: Unlike other tools, Pacu doesn’t focus heavily on stealth (e.g., bypassing CloudTrail logging).
Last updated