# AWS - Cognito Enum {{#include ../../../../banners/hacktricks-training.md}} ## Cognito Amazon Cognitoは、ウェブおよびモバイルアプリケーションにおける**認証、承認、およびユーザー管理**に利用されます。ユーザーは、**ユーザー名とパスワード**を使用して直接サインインするか、Facebook、Amazon、Google、またはAppleなどの**第三者**を通じて間接的にサインインする柔軟性があります。 Amazon Cognitoの中心には、2つの主要なコンポーネントがあります: 1. **ユーザープール**:これは、アプリのユーザーのために設計されたディレクトリで、**サインアップおよびサインイン機能**を提供します。 2. **アイデンティティプール**:これらのプールは、**異なるAWSサービスへのアクセスをユーザーに許可する**のに重要です。サインインまたはサインアッププロセスには直接関与しませんが、認証後のリソースアクセスにとって重要です。 ### **ユーザープール** **Cognitoユーザープールチェック**について学ぶには: {{#ref}} cognito-user-pools.md {{#endref}} ### **アイデンティティプール** **Cognitoアイデンティティプールチェック**について学ぶには: {{#ref}} cognito-identity-pools.md {{#endref}} ## 列挙 ```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 --max-results 60 aws cognito-identity get-identity-pool-roles --identity-pool-id # Identities Datasets ## Get dataset of identity id (inside identity pool) aws cognito-sync list-datasets --identity-pool-id --identity-id ## Get info of the dataset aws cognito-sync describe-dataset --identity-pool-id --identity-id --dataset-name ## Get dataset records aws cognito-sync list-records --identity-pool-id --identity-id --dataset-name # User Pools ## Get pools aws cognito-idp list-user-pools --max-results 60 ## Get users aws cognito-idp list-users --user-pool-id ## Get groups aws cognito-idp list-groups --user-pool-id ## Get users in a group aws cognito-idp list-users-in-group --user-pool-id --group-name ## List App IDs of a user pool aws cognito-idp list-user-pool-clients --user-pool-id ## List configured identity providers for a user pool aws cognito-idp list-identity-providers --user-pool-id ## List user import jobs aws cognito-idp list-user-import-jobs --user-pool-id --max-results 60 ## Get MFA config of a user pool aws cognito-idp get-user-pool-mfa-config --user-pool-id ## Get risk configuration aws cognito-idp describe-risk-configuration --user-pool-id ``` ### アイデンティティプール - 認証されていない列挙 単に **アイデンティティプールIDを知っているだけで**、**認証されていない**ユーザーに関連付けられた**ロールの資格情報を取得できるかもしれません**(もしあれば)。 [**ここで確認してください**](cognito-identity-pools.md#accessing-iam-roles)。 ### ユーザープール - 認証されていない列挙 Cognito内で**有効なユーザー名を知らなくても**、**有効なユーザー名を列挙**したり、**パスワードをブルートフォース**したり、**新しいユーザーを登録**したりできるかもしれません。これは**アプリクライアントIDを知っているだけで**(通常はソースコードに見つかります)。 [**ここで確認してください**](cognito-user-pools.md#registration)**。** ## 権限昇格 {{#ref}} ../../aws-privilege-escalation/aws-cognito-privesc/README.md {{#endref}} ## 認証されていないアクセス {{#ref}} ../../aws-unauthenticated-enum-access/aws-cognito-unauthenticated-enum/README.md {{#endref}} ## 永続性 {{#ref}} ../../aws-persistence/aws-cognito-persistence/README.md {{#endref}} {{#include ../../../../banners/hacktricks-training.md}}