跳到正文
Skillpedia
安全35k · #8191

performing-aws-privilege-escalation-assessment

它能做什么

这个工具可以帮你检查 AWS 账户中的某个用户或“角色”是否拥有过多权限,从而可能被利用,获得超出预期的权限。它会查找允许这种情况发生的错误配置。

适用场景

  • ✓在获得授权的前提下,测试 AWS 账户权限的安全性时。
  • ✓验证权限是否遵循“最小权限”原则时。
  • ✓评估 AWS 账户被攻陷后的风险时。

技能链接

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-aws-privilege-escalation-assessment/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-aws-privilege-escalation-assessment/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“检查我的 AWS 账户中是否存在权限过大的情况。”

每周 5 个新技能,1 分钟读完。

工作原理

它借助 Pacu、CloudFox 和 Principal Mapper 等工具分析 AWS 权限设置。这些工具会查找用户或角色获得超出其应有权限的已知方法。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Performing AWS Privilege Escalation Assessment

When to Use

  • When conducting authorized penetration testing of AWS IAM configurations
  • When validating that IAM policies follow the principle of least privilege
  • When assessing the blast radius of a compromised AWS credential
  • When building security reviews for IAM role and policy changes in CI/CD pipelines
  • When evaluating cross-account trust relationships for privilege escalation risks

Do not use for unauthorized testing against AWS accounts, for assessing non-IAM attack vectors (SSRF, application vulnerabilities), or as a substitute for comprehensive cloud penetration testing. Always obtain written authorization before testing.

Prerequisites

  • Written authorization for privilege escalation testing in the target AWS account
  • Test IAM user or role with limited permissions as the starting point
  • Pacu installed (pip install pacu)
  • CloudFox installed (go install github.com/BishopFox/cloudfox@latest)
  • PMapper (Principal Mapper) installed (pip install principalmapper)
  • AWS CLI configured with test credentials and CloudTrail logging enabled for audit trail

Workflow

Step 1: Enumerate Starting Permissions

Establish the baseline permissions of the test principal before attempting escalation.

# Get current identity
aws sts get-caller-identity

# Enumerate inline and attached policies for the current user
aws iam list-user-policies --user-name test-user
aws iam list-attached-user-policies --user-name test-user

# Get group memberships and group policies
aws iam list-groups-for-user --user-name test-user
for group in $(aws iam list-groups-for-user --user-name test-user --query 'Groups[*].GroupName' --output text); do
  echo "=== Group: $group ==="
  aws iam list-group-policies --group-name "$group"
  aws iam list-attached-group-policies --group-name "$group"
done

# Simulate specific API calls to map effective permissions
aws iam simulate-principal-policy \
  --policy-source-arn arn:aws:iam::ACCOUNT:user/test-user \
  --action-names iam:CreateUser iam:AttachUserPolicy iam:PassRole \
    lambda:CreateFunction ec2:RunInstances sts:AssumeRole \
  --query 'EvaluationResults[*].[EvalActionName,EvalDecision]' --output table

Step 2: Scan for Privilege Escalation Paths with Pacu

Use Pacu's privilege escalation scanner to identify known IAM escalation techniques.

# Start Pacu session
pacu

# Create session and set credentials
Pacu (new:session) > set_keys --key-alias privesc-test

# Enumerate IAM configuration
Pacu > run iam__enum_users_roles_policies_groups
Pacu > run iam__enum_permissions

# Run privilege escalation scanner
Pacu > run iam__privesc_scan

# The scanner checks for 21+ known escalation methods including:
# - iam:CreatePolicyVersion (create admin policy version)
# - iam:SetDefaultPolicyVersion (revert to permissive older version)
# - iam:AttachUserPolicy / iam:AttachRolePolicy (attach admin policy)
# - iam:PutUserPolicy / iam:PutRolePolicy (create inline admin policy)
# - iam:PassRole + lambda:CreateFunction (Lambda with admin role)
# - iam:PassRole + ec2:RunInstances (EC2 with admin instance profile)
# - iam:CreateLoginProfile / iam:UpdateLoginProfile (set console password)
# - iam:CreateAccessKey (create keys for other users)
# - sts:AssumeRole (assume more privileged roles)
# - glue:CreateDevEndpoint + iam:PassRole (Glue with admin role)

Step 3: Map Privilege Escalation Graphs with PMapper

Use Principal Mapper to build a graph of all IAM principals and identify escalation edges.

# Collect IAM data for graph construction
pmapper graph create --account ACCOUNT_ID

# Query for paths to admin
pmapper query 'who can do iam:AttachUserPolicy with * on *'
pmapper query 'who can do sts:AssumeRole with arn:aws:iam::ACCOUNT:role/AdminRole'

# Find all principals that can escalate to admin
pmapper analysis

# Visualize the privilege escalation graph
pmapper visualize --filetype png

# Check specific escalation paths
pmapper query 'can arn:aws:iam::ACCOUNT:user/test-user do iam:CreatePolicyVersion with *'
pmapper query 'can arn:aws:iam::ACCOUNT:user/test-user do sts:AssumeRole with arn:aws:iam::ACCOUNT:role/*'

Step 4: Test Cross-Account Role Assumption

Evaluate cross-account trust policies for misconfigured role assumptions that allow unauthorized escalation.

# List all roles and their trust policies

…
常见问题

什么是“权限提升”?

指权限有限的用户或程序设法获得更高权限,例如管理员权限。

使用这个工具需要许可吗?

需要。在对 AWS 账户进行任何安全测试之前,必须获得书面授权。

用到了哪些工具?

主要工具有 Pacu、CloudFox 和 Principal Mapper,同时还会用到 AWS CLI 命令。

详情

作者的原始描述

Performing authorized privilege escalation assessments in AWS environments to identify IAM misconfigurations that allow users or roles to elevate their permissions using Pacu, CloudFox, Principal Mapper, and manual IAM policy analysis techniques. '

repo: mukul975/Anthropic-Cybersecurity-Skills

热度

GitHub 星标
35k
排名
#8191
许可证
Apache-2.0
更新时间
2026/8/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能