AWS - IAM, Identity Center & SSO Enum

Support HackTricks

IAM

You can find a description of IAM in:

AWS - Basic Information

Enumeration

Main permissions needed:

  • iam:ListPolicies, iam:GetPolicy and iam:GetPolicyVersion

  • iam:ListRoles

  • iam:ListUsers

  • iam:ListGroups

  • iam:ListGroupsForUser

  • iam:ListAttachedUserPolicies

  • iam:ListAttachedRolePolicies

  • iam:ListAttachedGroupPolicies

  • iam:ListUserPolicies and iam:GetUserPolicy

  • iam:ListGroupPolicies and iam:GetGroupPolicy

  • iam:ListRolePolicies and iam:GetRolePolicy

# All IAMs
## Retrieves  information about all IAM users, groups, roles, and policies
## in your Amazon Web Services account, including their relationships  to
## one another. Use this operation to obtain a snapshot of the configura-
## tion of IAM permissions (users, groups, roles, and  policies)  in  your
## account.
aws iam get-account-authorization-details

# List users
aws iam get-user #Get current user information
aws iam list-users
aws iam list-ssh-public-keys #User keys for CodeCommit
aws iam get-ssh-public-key --user-name <username> --ssh-public-key-id <id> --encoding SSH #Get public key with metadata
aws iam list-service-specific-credentials #Get special permissions of the IAM user over specific services
aws iam get-user --user-name <username> #Get metadata of user, included permissions boundaries
aws iam list-access-keys #List created access keys
## inline policies
aws iam list-user-policies --user-name <username> #Get inline policies of the user
aws iam get-user-policy --user-name <username> --policy-name <policyname> #Get inline policy details
## attached policies
aws iam list-attached-user-policies --user-name <username> #Get policies of user, it doesn't get inline policies

# List groups
aws iam list-groups #Get groups
aws iam list-groups-for-user --user-name <username> #Get groups of a user
aws iam get-group --group-name <name> #Get group name info
## inline policies
aws iam list-group-policies --group-name <username> #Get inline policies of the group
aws iam get-group-policy --group-name <username> --policy-name <policyname> #Get an inline policy info
## attached policies
aws iam list-attached-group-policies --group-name <name> #Get policies of group, it doesn't get inline policies

# List roles
aws iam list-roles #Get roles
aws iam get-role --role-name <role-name> #Get role
## inline policies
aws iam list-role-policies --role-name <name> #Get inline policies of a role
aws iam get-role-policy --role-name <name> --policy-name <name> #Get inline policy details
## attached policies
aws iam list-attached-role-policies --role-name <role-name> #Get policies of role, it doesn't get inline policies

# List policies
aws iam list-policies [--only-attached] [--scope Local]
aws iam list-policies-granting-service-access --arn <identity> --service-namespaces <svc> # Get list of policies that give access to the user to the service
## Get policy content
aws iam get-policy --policy-arn <policy_arn>
aws iam list-policy-versions --policy-arn <arn>
aws iam get-policy-version --policy-arn <arn:aws:iam::975426262029:policy/list_apigateways> --version-id <VERSION_X>

# Enumerate providers
aws iam list-saml-providers
aws iam get-saml-provider --saml-provider-arn <ARN>
aws iam list-open-id-connect-providers
aws iam get-open-id-connect-provider --open-id-connect-provider-arn <ARN>

# Password Policy
aws iam get-account-password-policy

# MFA
aws iam list-mfa-devices
aws iam list-virtual-mfa-devices

๊ถŒํ•œ ๋ฌด์ฐจ๋ณ„ ๋Œ€์ž…

์ž์‹ ์˜ ๊ถŒํ•œ์— ๊ด€์‹ฌ์ด ์žˆ์ง€๋งŒ IAM์„ ์ฟผ๋ฆฌํ•  ์ˆ˜ ์žˆ๋Š” ์ ‘๊ทผ ๊ถŒํ•œ์ด ์—†๋‹ค๋ฉด, ํ•ญ์ƒ ๋ฌด์ฐจ๋ณ„ ๋Œ€์ž…์„ ์‹œ๋„ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

bf-aws-permissions

๋„๊ตฌ bf-aws-permissions๋Š” ์ง€์ •๋œ ํ”„๋กœํ•„์„ ์‚ฌ์šฉํ•˜์—ฌ list*, describe*, get* ์ž‘์—…์„ ์‹คํ–‰ํ•˜๋Š” bash ์Šคํฌ๋ฆฝํŠธ๋กœ, aws cli ๋„์›€๋ง ๋ฉ”์‹œ์ง€๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ฐพ์„ ์ˆ˜ ์žˆ๋Š” ๋ชจ๋“  ์ž‘์—…์„ ์‹คํ–‰ํ•˜๊ณ  ์„ฑ๊ณต์ ์ธ ์‹คํ–‰ ๊ฒฐ๊ณผ๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.

# Bruteforce permissions
bash bf-aws-permissions.sh -p default > /tmp/bf-permissions-verbose.txt

bf-aws-perms-simulate

๋„๊ตฌ bf-aws-perms-simulate๋Š” iam:SimulatePrincipalPolicy ๊ถŒํ•œ์ด ์žˆ๋Š” ๊ฒฝ์šฐ ํ˜„์žฌ ๊ถŒํ•œ(๋˜๋Š” ๋‹ค๋ฅธ ์ฃผ์ฒด์˜ ๊ถŒํ•œ)์„ ์ฐพ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

# Ask for permissions
python3 aws_permissions_checker.py --profile <AWS_PROFILE> [--arn <USER_ARN>]

Perms2ManagedPolicies

๋งŒ์•ฝ ์‚ฌ์šฉ์ž๊ฐ€ ๊ฐ€์ง„ ์ผ๋ถ€ ๊ถŒํ•œ์„ ๋ฐœ๊ฒฌํ–ˆ๊ณ , ๊ทธ๊ฒƒ์ด ๊ด€๋ฆฌํ˜• AWS ์—ญํ• ์— ์˜ํ•ด ๋ถ€์—ฌ๋œ ๊ฒƒ์ด๋ผ๊ณ  ์ƒ๊ฐํ•œ๋‹ค๋ฉด (์‚ฌ์šฉ์ž ์ •์˜ ์—ญํ• ์ด ์•„๋‹˜). ๋„๊ตฌ aws-Perms2ManagedRoles๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋‹น์‹ ์ด ๋ฐœ๊ฒฌํ•œ ๊ถŒํ•œ์„ ๋ถ€์—ฌํ•˜๋Š” ๋ชจ๋“  AWS ๊ด€๋ฆฌํ˜• ์—ญํ• ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

# Run example with my profile
python3 aws-Perms2ManagedPolicies.py --profile myadmin --permissions-file example-permissions.txt

AWS ๊ด€๋ฆฌ ์—ญํ• ์— ์˜ํ•ด ๋ถ€์—ฌ๋œ ๊ถŒํ•œ์ด ์žˆ๋Š”์ง€ "์•Œ ์ˆ˜ ์žˆ๋Š”" ๋ฐฉ๋ฒ•์€ ์‚ฌ์šฉ๋˜์ง€ ์•Š๋Š” ์„œ๋น„์Šค์— ๋Œ€ํ•œ ๊ถŒํ•œ์ด ์žˆ๋Š” ๊ฒฝ์šฐ์™€ ๊ฐ™์€ ์˜ˆ๋ฅผ ํ†ตํ•ด ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Cloudtrail2IAM

CloudTrail2IAM์€ ๋ชจ๋“  ์‚ฌ์šฉ์ž ๋˜๋Š” ํŠน์ • ์‚ฌ์šฉ์ž ๋˜๋Š” ์—ญํ• ์— ์˜ํ•ด ์ˆ˜ํ–‰๋œ ์ž‘์—…์„ ์ถ”์ถœํ•˜๊ณ  ์š”์•ฝํ•˜๊ธฐ ์œ„ํ•ด AWS CloudTrail ๋กœ๊ทธ๋ฅผ ๋ถ„์„ํ•˜๋Š” Python ๋„๊ตฌ์ž…๋‹ˆ๋‹ค. ์ด ๋„๊ตฌ๋Š” ์ง€์ •๋œ ๋ฒ„ํ‚ท์˜ ๋ชจ๋“  CloudTrail ๋กœ๊ทธ๋ฅผ ํŒŒ์‹ฑํ•ฉ๋‹ˆ๋‹ค.

git clone https://github.com/carlospolop/Cloudtrail2IAM
cd Cloudtrail2IAM
pip install -r requirements.txt
python3 cloudtrail2IAM.py --prefix PREFIX --bucket_name BUCKET_NAME --profile PROFILE [--filter-name FILTER_NAME] [--threads THREADS]

.tfstate (Terraform ์ƒํƒœ ํŒŒ์ผ) ๋˜๋Š” CloudFormation ํŒŒ์ผ(์ด ํŒŒ์ผ๋“ค์€ ์ผ๋ฐ˜์ ์œผ๋กœ cf-templates ์ ‘๋‘์‚ฌ๊ฐ€ ์žˆ๋Š” ๋ฒ„ํ‚ท ๋‚ด์˜ yaml ํŒŒ์ผ)์— ๋Œ€ํ•ด ์ฐพ์œผ๋ฉด, ์ด๋ฅผ ์ฝ์–ด aws ๊ตฌ์„ฑ๊ณผ ์–ด๋–ค ๊ถŒํ•œ์ด ๋ˆ„๊ตฌ์—๊ฒŒ ํ• ๋‹น๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

enumerate-iam

https://github.com/andresriancho/enumerate-iam ๋„๊ตฌ๋ฅผ ์‚ฌ์šฉํ•˜๋ ค๋ฉด ๋จผ์ € ๋ชจ๋“  API AWS ์—”๋“œํฌ์ธํŠธ๋ฅผ ๋‹ค์šด๋กœ๋“œํ•ด์•ผ ํ•˜๋ฉฐ, ๊ทธ ์ค‘์—์„œ ์Šคํฌ๋ฆฝํŠธ **generate_bruteforce_tests.py**๊ฐ€ ๋ชจ๋“  "list_", "describe_", ๋ฐ "get_" ์—”๋“œํฌ์ธํŠธ๋ฅผ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค. ๋งˆ์ง€๋ง‰์œผ๋กœ, ์ฃผ์–ด์ง„ ์ž๊ฒฉ ์ฆ๋ช…์œผ๋กœ ์ ‘๊ทผ์„ ์‹œ๋„ํ•˜๊ณ  ์ž‘๋™ํ–ˆ๋Š”์ง€ ์—ฌ๋ถ€๋ฅผ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.

(๋‚ด ๊ฒฝํ—˜์ƒ ๋„๊ตฌ๊ฐ€ ์–ด๋Š ์‹œ์ ์—์„œ ๋ฉˆ์ถ”๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค, ์ด ์ˆ˜์ • ์‚ฌํ•ญ์„ ํ™•์ธํ•˜์„ธ์š” ์ด ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด ์‹œ๋„ํ•ด ๋ณด์„ธ์š”).

๋‚ด ๊ฒฝํ—˜์ƒ ์ด ๋„๊ตฌ๋Š” ์ด์ „ ๋„๊ตฌ์™€ ๋น„์Šทํ•˜์ง€๋งŒ ๋” ๋‚˜์˜๊ฒŒ ์ž‘๋™ํ•˜๊ณ  ๊ถŒํ•œ์„ ๋œ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

# Install tool
git clone git@github.com:andresriancho/enumerate-iam.git
cd enumerate-iam/
pip install -r requirements.txt

# Download API endpoints
cd enumerate_iam/
git clone https://github.com/aws/aws-sdk-js.git
python3 generate_bruteforce_tests.py
rm -rf aws-sdk-js
cd ..

# Enumerate permissions
python3 enumerate-iam.py --access-key ACCESS_KEY --secret-key SECRET_KEY [--session-token SESSION_TOKEN] [--region REGION]

weirdAAL

๋‹น์‹ ์€ ๋˜ํ•œ ๋„๊ตฌ weirdAAL๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ๋„๊ตฌ๋Š” ์—ฌ๋Ÿฌ ์ผ๋ฐ˜ ์„œ๋น„์Šค์—์„œ ์—ฌ๋Ÿฌ ์ผ๋ฐ˜ ์ž‘์—…์„ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค (์ผ๋ถ€ ์—ด๊ฑฐ ๊ถŒํ•œ๊ณผ ์ผ๋ถ€ ๊ถŒํ•œ ์ƒ์Šน ๊ถŒํ•œ์„ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค). ๊ทธ๋Ÿฌ๋‚˜ ์ฝ”๋”ฉ๋œ ๊ฒ€์‚ฌ๋งŒ ํ™•์ธํ•˜๋ฉฐ (๋” ๋งŽ์€ ๊ฒƒ์„ ํ™•์ธํ•˜๋Š” ์œ ์ผํ•œ ๋ฐฉ๋ฒ•์€ ๋” ๋งŽ์€ ํ…Œ์ŠคํŠธ๋ฅผ ์ฝ”๋”ฉํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค).

# Install
git clone https://github.com/carnal0wnage/weirdAAL.git
cd weirdAAL
python3 -m venv weirdAAL
source weirdAAL/bin/activate
pip3 install -r requirements.txt

# Create a .env file with aws credentials such as
[default]
aws_access_key_id = <insert key id>
aws_secret_access_key = <insert secret key>

# Setup DB
python3 create_dbs.py

# Invoke it
python3 weirdAAL.py -m ec2_describe_instances -t ec2test # Just some ec2 tests
python3 weirdAAL.py -m recon_all -t MyTarget # Check all permissions
# You will see output such as:
# [+] elbv2 Actions allowed are [+]
# ['DescribeLoadBalancers', 'DescribeAccountLimits', 'DescribeTargetGroups']

๊ถŒํ•œ์„ BFํ•˜๋Š” ๋„๊ตฌ ๊ฐ•ํ™”

# Export env variables
./index.js --console=text --config ./config.js --json /tmp/out-cloudsploit.json

# Filter results removing unknown
jq 'map(select(.status | contains("UNKNOWN") | not))' /tmp/out-cloudsploit.json | jq 'map(select(.resource | contains("N/A") | not))' > /tmp/out-cloudsploit-filt.json

# Get services by regions
jq 'group_by(.region) | map({(.[0].region): ([map((.resource | split(":"))[2]) | unique])})' ~/Desktop/pentests/cere/greybox/core-dev-dev-cloudsploit-filtered.json

<YourTool>

์ด์ „ ๋„๊ตฌ ์ค‘ ์–ด๋Š ๊ฒƒ๋„ ๋ชจ๋“  ๊ถŒํ•œ์„ ํ™•์ธํ•  ์ˆ˜ ์—†์œผ๋ฏ€๋กœ, ๋” ๋‚˜์€ ๋„๊ตฌ๋ฅผ ์•Œ๊ณ  ์žˆ๋‹ค๋ฉด PR์„ ๋ณด๋‚ด์ฃผ์„ธ์š”!

์ธ์ฆ๋˜์ง€ ์•Š์€ ์ ‘๊ทผ

AWS - IAM & STS Unauthenticated Enum

๊ถŒํ•œ ์ƒ์Šน

๋‹ค์Œ ํŽ˜์ด์ง€์—์„œ IAM ๊ถŒํ•œ์„ ๋‚จ์šฉํ•˜์—ฌ ๊ถŒํ•œ์„ ์ƒ์Šน์‹œํ‚ค๋Š” ๋ฐฉ๋ฒ•์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:

AWS - IAM Privesc

IAM ํฌ์ŠคํŠธ ์ต์Šคํ”Œ๋กœ์ž‡

AWS - IAM Post Exploitation

IAM ์ง€์†์„ฑ

AWS - IAM Persistence

IAM ์•„์ด๋ดํ‹ฐํ‹ฐ ์„ผํ„ฐ

๋‹ค์Œ์—์„œ IAM ์•„์ด๋ดํ‹ฐํ‹ฐ ์„ผํ„ฐ์— ๋Œ€ํ•œ ์„ค๋ช…์„ ์ฐพ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:

AWS - Basic Information

CLI๋ฅผ ํ†ตํ•œ SSO ์—ฐ๊ฒฐ

# Connect with sso via CLI aws configure sso
aws configure sso

[profile profile_name]
sso_start_url = https://subdomain.awsapps.com/start/
sso_account_id = <account_numbre>
sso_role_name = AdministratorAccess
sso_region = us-east-1

Enumeration

Identity Center์˜ ์ฃผ์š” ์š”์†Œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค:

  • ์‚ฌ์šฉ์ž ๋ฐ ๊ทธ๋ฃน

  • ๊ถŒํ•œ ์„ธํŠธ: ์ •์ฑ…์ด ์—ฐ๊ฒฐ๋˜์–ด ์žˆ์Œ

  • AWS ๊ณ„์ •

๊ทธ๋Ÿฐ ๋‹ค์Œ, ์‚ฌ์šฉ์ž/๊ทธ๋ฃน์ด AWS ๊ณ„์ •์— ๋Œ€ํ•œ ๊ถŒํ•œ ์„ธํŠธ๋ฅผ ๊ฐ€์ง€๋„๋ก ๊ด€๊ณ„๊ฐ€ ์ƒ์„ฑ๋ฉ๋‹ˆ๋‹ค.

๊ถŒํ•œ ์„ธํŠธ์— ์ •์ฑ…์„ ์—ฐ๊ฒฐํ•˜๋Š” ๋ฐฉ๋ฒ•์€ 3๊ฐ€์ง€๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. AWS ๊ด€๋ฆฌํ˜• ์ •์ฑ…, ๊ณ ๊ฐ ๊ด€๋ฆฌํ˜• ์ •์ฑ…(์ด ์ •์ฑ…์€ ๊ถŒํ•œ ์„ธํŠธ๊ฐ€ ์˜ํ–ฅ์„ ๋ฏธ์น˜๋Š” ๋ชจ๋“  ๊ณ„์ •์—์„œ ์ƒ์„ฑ๋˜์–ด์•ผ ํ•จ), ์ธ๋ผ์ธ ์ •์ฑ…(์—ฌ๊ธฐ์—์„œ ์ •์˜๋จ).

# Check if IAM Identity Center is used
aws sso-admin list-instances

# Get Permissions sets. These are the policies that can be assigned
aws sso-admin list-permission-sets --instance-arn <instance-arn>
aws sso-admin describe-permission-set --instance-arn <instance-arn> --permission-set-arn <perm-set-arn>

## Get managed policies of a permission set
aws sso-admin list-managed-policies-in-permission-set --instance-arn <instance-arn> --permission-set-arn <perm-set-arn>
## Get inline policies of a permission set
aws sso-admin get-inline-policy-for-permission-set --instance-arn <instance-arn> --permission-set-arn <perm-set-arn>
## Get customer managed policies of a permission set
aws sso-admin list-customer-managed-policy-references-in-permission-set --instance-arn <instance-arn> --permission-set-arn <perm-set-arn>
## Get boundaries of a permission set
aws sso-admin get-permissions-boundary-for-permission-set --instance-arn <instance-arn> --permission-set-arn <perm-set-arn>

## List accounts a permission set is affecting
aws sso-admin list-accounts-for-provisioned-permission-set --instance-arn <instance-arn> --permission-set-arn <perm-set-arn>
## List principals given a permission set in an account
aws sso-admin list-account-assignments --instance-arn <instance-arn> --permission-set-arn <perm-set-arn> --account-id <account_id>

# Get permissions sets affecting an account
aws sso-admin list-permission-sets-provisioned-to-account --instance-arn <instance-arn> --account-id <account_id>

# List users & groups from the identity store
aws identitystore list-users --identity-store-id <store-id>
aws identitystore list-groups --identity-store-id <store-id>
## Get members of groups
aws identitystore list-group-memberships --identity-store-id <store-id> --group-id <group-id>
## Get memberships or a user or a group
aws identitystore list-group-memberships-for-member --identity-store-id <store-id> --member-id <member-id>

Local Enumeration

$HOME/.aws ํด๋” ์•ˆ์— SSO๋ฅผ ํ†ตํ•ด ์ ‘๊ทผํ•  ์ˆ˜ ์žˆ๋Š” ํ”„๋กœํ•„์„ ๊ตฌ์„ฑํ•˜๊ธฐ ์œ„ํ•œ config ํŒŒ์ผ์„ ์ƒ์„ฑํ•˜๋Š” ๊ฒƒ์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด:

[default]
region = us-west-2
output = json

[profile my-sso-profile]
sso_start_url = https://my-sso-portal.awsapps.com/start
sso_region = us-west-2
sso_account_id = 123456789012
sso_role_name = MySSORole
region = us-west-2
output = json

[profile dependent-profile]
role_arn = arn:aws:iam::<acc-id>:role/ReadOnlyRole
source_profile = Hacktricks-Admin

์ด ๊ตฌ์„ฑ์€ ๋‹ค์Œ ๋ช…๋ น์–ด์™€ ํ•จ๊ป˜ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:

# Login in ms-sso-profile
aws sso login --profile my-sso-profile
# Use dependent-profile
aws s3 ls --profile dependent-profile

When a profile from SSO is used to access some information, the credentials are cached in a file inside the folder $HOME/.aws/sso/cache. Therefore they can be read and used from there.

๋˜ํ•œ, ๋” ๋งŽ์€ ์ž๊ฒฉ ์ฆ๋ช…์€ ํด๋” **$HOME/.aws/cli/cache**์— ์ €์žฅ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ์บ์‹œ ๋””๋ ‰ํ† ๋ฆฌ๋Š” ์ฃผ๋กœ IAM ์‚ฌ์šฉ์ž ์ž๊ฒฉ ์ฆ๋ช…์„ ์‚ฌ์šฉํ•˜๊ฑฐ๋‚˜ IAM์„ ํ†ตํ•ด ์—ญํ• ์„ ๊ฐ€์ •ํ•  ๋•Œ AWS CLI ํ”„๋กœํ•„๋กœ ์ž‘์—…ํ•  ๋•Œ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค(SSO ์—†์ด). ๊ตฌ์„ฑ ์˜ˆ:

[profile crossaccountrole]
role_arn = arn:aws:iam::234567890123:role/SomeRole
source_profile = default
mfa_serial = arn:aws:iam::123456789012:mfa/saanvi
external_id = 123456

์ธ์ฆ๋˜์ง€ ์•Š์€ ์ ‘๊ทผ

AWS - Identity Center & SSO Unauthenticated Enum

๊ถŒํ•œ ์ƒ์Šน

AWS - SSO & identitystore Privesc

ํฌ์ŠคํŠธ ์ต์Šคํ”Œ๋กœ์ž‡

AWS - SSO & identitystore Post Exploitation

์ง€์†์„ฑ

์‚ฌ์šฉ์ž๋ฅผ ์ƒ์„ฑํ•˜๊ณ  ๊ถŒํ•œ์„ ํ• ๋‹นํ•ฉ๋‹ˆ๋‹ค

# Create user identitystore:CreateUser
aws identitystore create-user --identity-store-id <store-id> --user-name privesc --display-name privesc --emails Value=sdkabflvwsljyclpma@tmmbt.net,Type=Work,Primary=True --name Formatted=privesc,FamilyName=privesc,GivenName=privesc
## After creating it try to login in the console using the selected username, you will receive an email with the code and then you will be able to select a password
  • ๊ทธ๋ฃน์„ ์ƒ์„ฑํ•˜๊ณ  ๊ถŒํ•œ์„ ํ• ๋‹นํ•˜๋ฉฐ ์ œ์–ด๋œ ์‚ฌ์šฉ์ž๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.

  • ์ œ์–ด๋œ ์‚ฌ์šฉ์ž ๋˜๋Š” ๊ทธ๋ฃน์— ์ถ”๊ฐ€ ๊ถŒํ•œ์„ ๋ถ€์—ฌํ•ฉ๋‹ˆ๋‹ค.

  • ๊ธฐ๋ณธ์ ์œผ๋กœ, ๊ด€๋ฆฌ ๊ณ„์ •์˜ ๊ถŒํ•œ์ด ์žˆ๋Š” ์‚ฌ์šฉ์ž๋งŒ IAM Identity Center์— ์ ‘๊ทผํ•˜๊ณ  ์ œ์–ดํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๊ทธ๋Ÿฌ๋‚˜ Delegate Administrator๋ฅผ ํ†ตํ•ด ๋‹ค๋ฅธ ๊ณ„์ •์˜ ์‚ฌ์šฉ์ž๊ฐ€ ์ด๋ฅผ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๋„๋ก ํ—ˆ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋“ค์€ ์ •ํ™•ํžˆ ๋™์ผํ•œ ๊ถŒํ•œ์„ ๊ฐ€์ง€์ง€๋Š” ์•Š์ง€๋งŒ, ๊ด€๋ฆฌ ํ™œ๋™์„ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

HackTricks ์ง€์›ํ•˜๊ธฐ

Last updated