performing-cloud-penetration-testing-with-pacu
Teaches your AI agent to test code and catch bugs before users do and ship projects and manage infrastructure.
What it does
Pacu is a tool for testing the security of Amazon Web Services (AWS) cloud accounts. It helps find security weaknesses, like excessive permissions or access to sensitive data, by simulating authorized attacks.
When to use it
- ✓When conducting authorized penetration tests in AWS environments.
- ✓When verifying if permission rules (IAM policies) are working correctly.
- ✓When discovering the impact of compromised AWS credentials.
Example of what to ask your AI
“I want to test the security of my AWS account to see if someone with limited access could gain more permissions or access private data.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
You provide test credentials to Pacu, which then runs various commands to explore your AWS account's configuration. It looks for paths an attacker could use to gain more control or access information.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill performing-cloud-penetration-testing-with-pacuOr download just the file:
curl -L https://raw.githubusercontent.com/mukul975/Anthropic-Cybersecurity-Skills/main/skills/performing-cloud-penetration-testing-with-pacu/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
Performing Cloud Penetration Testing with Pacu
When to Use
- When conducting authorized penetration testing of AWS environments
- When validating the effectiveness of IAM policies, SCPs, and permission boundaries
- When assessing the blast radius of a compromised set of AWS credentials
- When testing detection capabilities of GuardDuty, Security Hub, and custom alerting
- When building red team exercises against AWS cloud infrastructure
Do not use for unauthorized testing of any AWS account, for testing AWS infrastructure itself (covered by shared responsibility), for DDoS or volumetric attacks without AWS approval, or for production account testing without explicit authorization and breakglass procedures.
Prerequisites
- Written authorization from the AWS account owner with defined scope and rules of engagement
- Pacu v1.5+ installed (
pip install pacu) - Test AWS credentials with limited starting permissions (simulates compromised credential scenario)
- CloudTrail logging enabled to capture all Pacu activity for post-engagement review
- GuardDuty enabled to validate detection of Pacu activities
- Emergency contact and rollback procedures documented
Workflow
Step 1: Initialize Pacu Session and Configure Credentials
Set up a Pacu session with the test credentials and define the engagement scope.
# Install Pacu
pip install pacu
# Start Pacu
pacu
# Create a new session for the engagement
Pacu > set_keys --key-alias pentest-target
# Enter Access Key ID: AKIA...
# Enter Secret Access Key: ...
# Verify identity
Pacu > whoami
# Review available modules
Pacu > list
Pacu > search iam
Pacu > search ec2
Pacu > search s3
Step 2: Enumerate IAM Configuration
Run IAM enumeration modules to map users, roles, policies, and group memberships.
# Comprehensive IAM enumeration
Pacu > run iam__enum_users_roles_policies_groups
# Enumerate detailed permissions for the current principal
Pacu > run iam__enum_permissions
# Enumerate account authorization details (requires iam:GetAccountAuthorizationDetails)
Pacu > run iam__get_credential_report
# Enumerate role trust policies for cross-account access
Pacu > run iam__enum_roles
# Check current session data
Pacu > data iam
Step 3: Scan for Privilege Escalation Paths
Use Pacu's privilege escalation scanner to identify all exploitable escalation vectors.
# Run the privilege escalation scanner
Pacu > run iam__privesc_scan
# The scanner tests for 21+ escalation methods:
# Method 1: iam:CreatePolicyVersion
# Method 2: iam:SetDefaultPolicyVersion
# Method 3: iam:PassRole + ec2:RunInstances
# Method 4: iam:PassRole + lambda:CreateFunction + lambda:InvokeFunction
# Method 5: iam:PassRole + lambda:CreateFunction + lambda:CreateEventSourceMapping
# Method 6: iam:PassRole + glue:CreateDevEndpoint
# Method 7: iam:PassRole + cloudformation:CreateStack
# Method 8: iam:PassRole + datapipeline:CreatePipeline
# Method 9: iam:CreateAccessKey
# Method 10: iam:CreateLoginProfile
# Method 11: iam:UpdateLoginProfile
# Method 12: iam:AttachUserPolicy
# Method 13: iam:AttachGroupPolicy
# Method 14: iam:AttachRolePolicy
# Method 15: iam:PutUserPolicy
# Method 16: iam:PutGroupPolicy
# Method 17: iam:PutRolePolicy
# Method 18: iam:AddUserToGroup
# Method 19: iam:UpdateAssumeRolePolicy
# Method 20: sts:AssumeRole
# Method 21: lambda:UpdateFunctionCode
# If escalation paths found, attempt exploitation
Pacu > run iam__privesc_scan --escalate
Step 4: Enumerate and Test Data Access
Discover accessible data stores including S3, DynamoDB, RDS, and Secrets Manager.
# Enumerate S3 buckets
Pacu > run s3__bucket_finder
# Download S3 bucket data for analysis
Pacu > run s3__download_bucket --bucket target-bucket --dl-names
# Enumerate EC2 instances and extract user data
Pacu > run ec2__enum
Pacu > run ec2__download_userdata
# Enumerate Lambda functions and check for secrets in environment variables
Pacu > run lambda__enum
# Enumerate Secrets Manager
Pacu > run secretsmanager__enum
# Enumerate SSM parameters (often contain secrets)
Pacu > run ssm__download_parameters
# Check for exposed EBS snapshots
Pacu > run ebs__enum_snapshots_unauth
Step 5: Test Lateral Movement and Persistence
Evaluate cross-account access, service exploitation, and persistence mechanisms.
# Test cross-account role assumption
Pacu > run sts__assume_role --role-arn arn:aws:iam::TARGET:role/CrossAccountRole
…
FAQ
What is 'penetration testing'?
It's an authorized security test to find vulnerabilities before malicious hackers do.
What are 'AWS credentials'?
They are like a username and password to access Amazon Web Services.
What is 'privilege escalation'?
It's when an attacker with limited access manages to get higher permissions, like a regular employee getting administrator access.
Details
Original description by the author
Run authorized AWS penetration tests with Pacu, the open-source AWS exploitation framework, to enumerate IAM configuration, scan for privilege escalation paths, and test data access and lateral movement using compromised credentials. Use when conducting authorized red-team assessments of AWS environments, validating IAM policies and SCPs, or determining the blast radius of compromised AWS credenti
Popularity
- GitHub stars
- 35k
- Ranking position
- #6042
- License
- Apache-2.0
- Updated
- 8/31/2026
Comments
- …
More skills from this repository
abusing-dpapi-for-credential-access
Gives your AI agent ready-made instructions for a specific task, so it does it better and faster.
mukul975/Anthropic-Cybersecurity-Skills
abusing-shadow-credentials-for-privesc
Teaches your AI agent to write clear, well-structured text.
mukul975/Anthropic-Cybersecurity-Skills
achieving-cmmc-level-2-compliance
Helps your agent prepare an environment for CMMC Level 2 compliance. It implements security requirements and manages necessary documentation.
mukul975/Anthropic-Cybersecurity-Skills
acquiring-disk-image-with-dd-and-dcfldd
Helps your agent create exact copies of hard drives. This is useful for ensuring no information is lost or altered during investigations.
mukul975/Anthropic-Cybersecurity-Skills
Similar skills
cpp-testing
Makes your agent write and improve tests for C++ code. It helps set up testing tools and fix errors.
affaan-m/ECC
csharp-testing
Helps your agent create tests for C# and .NET code. It uses best practices to ensure tests are efficient and reliable.
affaan-m/ECC
django-tdd
Enables your agent to apply testing strategies for Django with pytest-django and TDD. It's useful for writing robust tests and ensuring code quality, especially for DRF APIs.
affaan-m/ECC