AWS - Cognito Enum

HackTricksをサポートする

Cognito

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

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

  1. ユーザープール:これは、アプリのユーザー向けに設計されたディレクトリで、サインアップおよびサインイン機能を提供します。

  2. アイデンティティプール:これらのプールは、異なるAWSサービスへのユーザーアクセスを認可するのに重要です。サインインやサインアッププロセスには直接関与しませんが、認証後のリソースアクセスにとって重要です。

ユーザープール

Cognitoユーザープールが何であるかを学ぶには、次を確認してください:

アイデンティティプール

Cognitoアイデンティティプールが何であるかを学ぶには、次を確認してください:

列挙

# 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を知っているだけで(通常はソースコードに見つかります)。 ここで確認してください

権限昇格

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

永続性

HackTricksをサポートする

Last updated