AWS - ECR Unauthenticated Enum

Tip

AWSハッキングを学び、実践する:HackTricks Training AWS Red Team Expert (ARTE)
GCPハッキングを学び、実践する:HackTricks Training GCP Red Team Expert (GRTE) Azureハッキングを学び、実践する:HackTricks Training Azure Red Team Expert (AzRTE)

HackTricksをサポートする

ECR

For more information check:

AWS - ECR Enum

パブリックレジストリのリポジトリ(イメージ)

As mentioned in the ECS Enum section, a public registry is accessible by anyone uses the format public.ecr.aws/<random>/<name>. If a public repository URL is located by an attacker he could download the image and search for sensitive information in the metadata and content of the image.

aws ecr describe-repositories --query 'repositories[?repositoryUriPublic == `true`].repositoryName' --output text

Warning

これは プライベートレジストリ においても、レジストリポリシーやリポジトリポリシーが 例えば "AWS": "*" にアクセスを許可している 場合に発生する可能性があります。誰でもAWSアカウントを持っていればそのrepoにアクセスできる可能性があります。

プライベートRepoの列挙

ツール skopeocrane を使って、プライベートレジストリ内のアクセス可能なリポジトリを一覧することができます。

# Get image names
skopeo list-tags docker://<PRIVATE_REGISTRY_URL> | grep -oP '(?<=^Name: ).+'
crane ls <PRIVATE_REGISTRY_URL> | sed 's/ .*//'

Tip

AWSハッキングを学び、実践する:HackTricks Training AWS Red Team Expert (ARTE)
GCPハッキングを学び、実践する:HackTricks Training GCP Red Team Expert (GRTE) Azureハッキングを学び、実践する:HackTricks Training Azure Red Team Expert (AzRTE)

HackTricksをサポートする