Brute Force Attacks With Image Captcha Bypass Using Bash Script And Ocr
A weak image CAPTCHA on a login form could be read automatically with OCR, allowing a bash script to retry credentials until the CAPTCHA was solved correctly. An attacker could then run a brute-force attack against the login without manually solving each challenge.
CAPTCHA, or Completely Automated Public Turing test to tell Computers and Humans Apart, is a security measure designed to prevent automated scripts and robots from accessing protected systems and applications. This is achieved through a challenge-response mechanism, in which a randomly generated sequence of letters…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the CAPTCHA image used simple, undistorted text that OCR could reliably read, and the server did not otherwise rate-limit or lock out repeated login attempts.
Impact
An attacker could automate credential guessing against the login form, though the author notes OCR is not a robust solution and can be easily defeated by the CAPTCHA provider.
What the attacker needed
A login form protected only by a clear image CAPTCHA; wordlists of usernames and passwords; Tesseract OCR installed; network access to the target
The fix
The CAPTCHA should be made harder for OCR to read, for example with distortion, noise or lines, and the login should also limit repeated attempts.
How it was found
- Fetch the CAPTCHA image from the login page and save it locally.
- Run the Tesseract OCR command on the saved image to extract the text.
- Submit the extracted text together with a username and password guess.
- Read the response status message to see whether the CAPTCHA was accepted or rejected.
- If the CAPTCHA was wrong, retry the same credentials with a fresh CAPTCHA until it is accepted.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A CAPTCHA is a small picture puzzle meant to prove a human is logging in, usually by asking you to type distorted letters. Here the letters were so clear that a free text-recognition tool could read them automatically. That let a script keep guessing usernames and passwords without a person solving the puzzle each time.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.