TryHackMe - Capture!
Bypass a captcha using python to Brute-force a login page.
Table of Contents
Reconnaissance
- The first step to brute-force the login page, is enumerating valid users.
- We can use the websites message error for this:
The user 'test' does not exist
- However, when we try too many invalid attempts, the website requests the user to solve a captcha:
- Fortunately, the captcha only requires solving a simple math expression, which we can bypass using Python.
Bypassing Captcha
The way I bypassed the captcha using Python is as follows:
- Send a Post Request.
- Use Regex to grab the captcha’s math expression.
- Use
eval()
function to calculate the math expression. - Send a new Post Request with the captcha’s solution.
After bypassing the captcha, I created a Python script to automatically enumerate a valid username and password. You can read it here: script
Next, I used the credentials I found to login in the website and got the flag:
This post is licensed under CC BY 4.0 by the author.