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

Cognito

For more information, access:

AWS - Cognito Enum

ユーザー永続化

Cognito は、unauthenticated および authenticated users に roles を付与し、ユーザーのディレクトリを管理するサービスです。永続性を維持するために変更できる設定はいくつかあり、例えば:

  • Adding a User Pool をユーザーが制御する形で Identity Pool に追加する
  • unauthenticated Identity Pool に IAM role を付与し、Basic auth flow を許可する
  • あるいは攻撃者がログイン可能な場合は authenticated Identity Pool に対して同様の操作を行う
  • または与えられたロールの permissions を向上 させる
  • Create, verify & privesc を、属性を制御する既存ユーザーや User Pool の新規ユーザー経由で行う
  • Allowing external Identity Providers からのログインを User Pool または Identity Pool に対して許可する

これらの操作のやり方は以下を参照してください

AWS - Cognito Privesc

cognito-idp:SetRiskConfiguration

この権限を持つ攻撃者は、リスク設定を変更して Cognito ユーザーとしてログインできるようにし、アラームが発生しないようにすることが可能です。 Check out the cli to check all the options:

aws cognito-idp set-risk-configuration --user-pool-id <pool-id> --compromised-credentials-risk-configuration EventFilter=SIGN_UP,Actions={EventAction=NO_ACTION}

デフォルトではこれは無効になっています:

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