AWS - Cognito Enum

Reading time: 6 minutes

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をサポートする

Cognito

Amazon Cognitoは、ウェブおよびモバイルアプリケーションにおける認証、承認、およびユーザー管理に利用されます。ユーザーは、ユーザー名とパスワードを使用して直接サインインするか、Facebook、Amazon、Google、またはAppleなどの第三者を通じて間接的にサインインする柔軟性があります。

Amazon Cognitoの中心には、2つの主要なコンポーネントがあります:

  1. ユーザープール:これは、アプリのユーザーのために設計されたディレクトリで、サインアップおよびサインイン機能を提供します。
  2. アイデンティティプール:これらのプールは、異なるAWSサービスへのアクセスをユーザーに許可するのに重要です。サインインまたはサインアッププロセスには直接関与しませんが、認証後のリソースアクセスにとって重要です。

ユーザープール

Cognitoユーザープールチェックについて学ぶには:

Cognito User Pools

アイデンティティプール

Cognitoアイデンティティプールチェックについて学ぶには:

Cognito Identity Pools

列挙

bash
# List Identity Pools
aws cognito-identity list-identity-pools --max-results 60
aws cognito-identity describe-identity-pool --identity-pool-id "eu-west-2:38b294756-2578-8246-9074-5367fc9f5367"
aws cognito-identity list-identities --identity-pool-id <ident-pool-id> --max-results 60
aws cognito-identity get-identity-pool-roles --identity-pool-id <ident-pool-id>

# Identities Datasets
## Get dataset of identity id (inside identity pool)
aws cognito-sync list-datasets --identity-pool-id <ident-pool-id> --identity-id <ident-id>
## Get info of the dataset
aws cognito-sync describe-dataset --identity-pool-id <value> --identity-id <value> --dataset-name <value>
## Get dataset records
aws cognito-sync list-records --identity-pool-id <value> --identity-id <value> --dataset-name <value>

# User Pools
## Get pools
aws cognito-idp list-user-pools --max-results 60

## Get users
aws cognito-idp list-users --user-pool-id <user-pool-id>

## Get groups
aws cognito-idp list-groups --user-pool-id <user-pool-id>

## Get users in a group
aws cognito-idp list-users-in-group --user-pool-id <user-pool-id> --group-name <group-name>

## List App IDs of a user pool
aws cognito-idp list-user-pool-clients --user-pool-id <user-pool-id>

## List configured identity providers for a user pool
aws cognito-idp list-identity-providers --user-pool-id <user-pool-id>

## List user import jobs
aws cognito-idp list-user-import-jobs --user-pool-id <user-pool-id> --max-results 60

## Get MFA config of a user pool
aws cognito-idp get-user-pool-mfa-config --user-pool-id <user-pool-id>

## Get risk configuration
aws cognito-idp describe-risk-configuration --user-pool-id <user-pool-id>

アイデンティティプール - 認証されていない列挙

単に アイデンティティプールIDを知っているだけで認証されていないユーザーに関連付けられたロールの資格情報を取得できるかもしれません(もしあれば)。 ここで確認してください

ユーザープール - 認証されていない列挙

Cognito内で有効なユーザー名を知らなくても有効なユーザー名を列挙したり、パスワードをブルートフォースしたり、新しいユーザーを登録したりできるかもしれません。これはアプリクライアントIDを知っているだけで(通常はソースコードに見つかります)。 ここで確認してください

権限昇格

AWS - Cognito Privesc

認証されていないアクセス

AWS - Cognito Unauthenticated Enum

永続性

AWS - Cognito Persistence

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をサポートする