Files
hacktricks-cloud/src/pentesting-cloud/aws-security/aws-services/aws-cognito-enum

AWS - Cognito Enum

{{#include ../../../../banners/hacktricks-training.md}}

Cognito

Amazon Cognito word gebruik vir authentisering, magtiging, en gebruikersbestuur in web- en mobiele toepassings. Dit bied gebruikers die buigsaamheid om direk in te teken met 'n gebruikersnaam en wagwoord of indirek deur 'n derde party, insluitend Facebook, Amazon, Google, of Apple.

Sentraal tot Amazon Cognito is twee primêre komponente:

  1. Gebruikerspoele: Dit is gidse wat ontwerp is vir jou app-gebruikers, wat aanmeld- en registrasiefunksies bied.
  2. Identiteitspoele: Hierdie poele is noodsaaklik vir magtiging van gebruikers om toegang tot verskillende AWS-dienste te verkry. Hulle is nie direk betrokke by die aanmeld- of registrasieproses nie, maar is van kardinale belang vir hulpbron toegang na authentisering.

Gebruikerspoele

Om te leer wat 'n Cognito Gebruikerspoel is:

{{#ref}} cognito-user-pools.md {{#endref}}

Identiteitspoele

Om te leer wat 'n Cognito Identiteitspoel is:

{{#ref}} cognito-identity-pools.md {{#endref}}

Enumerasie

# 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>

Identiteitspoele - Ongeauthentiseerde Enumerasie

Net om die Identiteitspoel-ID te weet, mag jy in staat wees om credentials van die rol geassosieer met ongeauthentiseerde gebruikers te kry (indien enige). Kyk hoe hier.

Gebruikerspoele - Ongeauthentiseerde Enumerasie

Selfs as jy nie 'n geldige gebruikersnaam binne Cognito weet nie, mag jy in staat wees om geldige gebruikersname te enumerate, BF die wagwoorde of selfs 'n nuwe gebruiker te registreer net om die App kliënt-ID te weet (wat gewoonlik in die bronkode gevind word). Kyk hoe hier.

Privesc

{{#ref}} ../../aws-privilege-escalation/aws-cognito-privesc.md {{#endref}}

Ongeauthentiseerde Toegang

{{#ref}} ../../aws-unauthenticated-enum-access/aws-cognito-unauthenticated-enum.md {{#endref}}

Volharding

{{#ref}} ../../aws-persistence/aws-cognito-persistence.md {{#endref}}

{{#include ../../../../banners/hacktricks-training.md}}