[HTB] AbuseHumanDB Writeup
Giới thiệu
Một lab Nodejs khá ngắn để đọc code nhưng khá thú vị khi làm, và khi làm mình lại phát hiện ra sự support cực tốt từ chatGPT để mình có ý tưởng làm lab này
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Sơ lược thì app này sẽ chứa các entries và khi mình nhập url nào đó thì sẽ mở link đó ra phía dưới backend bằng puppeter
Nên là mình sẽ bắt tay đọc code và kiếm thứ hay ho thoi
Mục tiêu và đối tượng
- Mục tiêu
- Entry nằm trong db có chưa flag nhưng chỉ truy cập bằng local
- Đối tượng đáng ngờ
- Mở bất kì web nào phía dưới BE (bot.js)
Những thông tin trên cho mình nghĩ ra một hướng đó là craft một page để gửi request xún phía local của victim để lấy được flag, vì flag chỉ hiện khi truy cập dưới local.
Thực hiện
Nếu mình craft và chỉ gửi request bằng các method thông thường thì sẽ bị dính CORS. Mình có hỏi các cách để bypass thì GPT đã gợi ý cho mình cách JSONP
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Có craft cho mình request mẫu luôn
cho nên mình sẽ craft thử một đoạn script và host nó trên sv máy mình nhé
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Đoạn script sẽ request tới endpoint search với tham số HTB để check xem có entry đó không, vì theo như code đọc thì entry title sẽ là flag nên thường bắt đầu bằng HTB{ và kết thúc bằng }
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Vậy là mình sử dụng JSONP có thể xác nhận được là có entry đó
Đối với JSONP thì mình chỉ có thể gửi request GET và nhận về giá trị load được hoặc lỗi, là true hoặc false ấy, và vì hàm search đó miễn đúng kí tự sẽ trả về true còn khác là false nên mình sẽ bruteforce nó để kiểm tra xem.
Code mình bruteforce:
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Chúng ta nhận được 2 giá trị là 5 và _ vì giá trị _ có nghĩa là sẽ có kí tự hoặc _, mà có số 5 nghĩa là đáp án là 5.
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Thêm số 5 và tiếp tục bruteforce, cứ như vậy ta được flag
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
cứ tiếp tục vậy thôi. Xonggg
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →