Nguyen Duong The ViVerified account
29-3-2024
(A7) Identity & Auth Failure - Authentication Bypasses - 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 - 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àmverifyAccount:

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ị secQuestion1 và secQuestion0. 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:

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

- Thay đổi
secQuestion0thànhsecQuestion3,secQuestion1thànhsecQuestion4:

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

Tham khảo:
- Đỗ Tuấn: LINK
Vi