(A7) Identity & Auth Failure - Authentication Bypasses - Webgoat

1. 2FA Password Reset

  • Chúng ta vào source code của WebGoat ( LINK) và tìm đến File AccountVerificationHelper.java. Ta có thể thấy một hàm dùng để kiểm tra là hàm verifyAccount:

alt

public boolean verifyAccount(Integer userId, HashMap<String, String> submittedQuestions) {
    // short circuit if no questions are submitted
    if (submittedQuestions.entrySet().size() != secQuestionStore.get(verifyUserId).size()) {
      return false;
    }

    if (submittedQuestions.containsKey("secQuestion0")
        && !submittedQuestions
            .get("secQuestion0")
            .equals(secQuestionStore.get(verifyUserId).get("secQuestion0"))) {
      return false;
    }

    if (submittedQuestions.containsKey("secQuestion1")
        && !submittedQuestions
            .get("secQuestion1")
            .equals(secQuestionStore.get(verifyUserId).get("secQuestion1"))) {
      return false;
    }

    // else
    return true;
}

Trong hàm này hệ thống sẽ kiểm tra giá trị secQuestion1secQuestion0. Ta chỉ cần đổi tên 2 trường này thì sẽ hoàn thành bài này.

  • Khởi động Brup Suite và mở WebGoat trên trình duyệt của Brup Suite:

alt

  • Bật Intercept trên Brup Suite, và nhập các thông tin trên WebGoat nhấn Submit. Ta sẽ thấy được một Request trên Brup Suite như sau:

alt

  • Thay đổi secQuestion0 thành secQuestion3, secQuestion1 thành secQuestion4:

alt

  • Nhấn Forward. Webgoat tự động cập nhật đã hoàn thành bài này:

alt

Tham khảo:

  1. Đỗ Tuấn: LINK

Cảm ơn bạn đã đọc bài viết ! 🥰 🥰 🥰

Hãy nêu ý kiến của mình ở phần bình luận phía dưới nhé !

✨ Bài viết liên quan

(A7) Identity & Auth Failure - Insecure Login - Webgoat 🐐 Bài viết này mình sẽ hướng dẫn các bạn làm phần (A7) Identity & Auth Failure - Insecure Login

Made by @thevi31415

© 2024 Nguyen Duong The Vi. All Rights Reserved.