AWS - ECR Unauthenticated Enum

Tip

学んで実践する AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
学んで実践する GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
学んで実践する Az Hacking: 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 Hacking:HackTricks Training AWS Red Team Expert (ARTE)
学んで実践する GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
学んで実践する Az Hacking: HackTricks Training Azure Red Team Expert (AzRTE)

HackTricks をサポートする