Look, if you had one shot
Last updated
Last updated
Or one opportunity. To guess one mfa code on the website. In one moment. Could you hack it? Or just let it slip?
During a penetration test of Generally Quirky Labs' online websites, you stumbled across their company employee portal. After some recent brute force attacks, the security team got tired of watching hackers knock on the door all day long. So they implemented both MFA and Captcha codes, using some of the latest technologies. Unfortunately for them, they were not aware of one of the technologies' features...Note: DOSing the website by sending web requests is not the way.
Username:
matthew@generallyql.com
Password:
yHfm34P9@v!Ge6
We are given the account credentials, but there is an MFA code that we need to submit. We are told that the code expires in 3 minutes, and there is a CAPTCHA code we need to submit, to prevent bruteforcing the MFA code.
Looking under the hood, we see that there is a login_session_token
that is sent to us.
In the GraphQL query sent to mfa_service.php
, the token is used again. It appears that as long as we use this same login token, we can submit as many attempts as we want, provided we give the correct CAPTCHA code in the GET request parameter.
In GraphQL, we can use batching to send several queries at a time. If the server processes all these queries together using the same CAPTCHA code, this would defeat the purpose of the CAPTCHA.
For instance, we can submit two queries the same HTTP request:
Indeed, both queries were processed! We managed to try two MFA tokens, with the same CAPTCHA code.
Since the MFA token is only 4 digits, we could simply batch thousands of queries together, drastically reducing the number of CAPTCHAs required. Here I batched 3000 queries at a time due to the request length limits.
Eventually, one of our attempts will be successful.
The flag is MetaCTF{if_brute_force_doesnt_work_use_more_brute_forceeeeeeee}