The battle against bots that are responsible for invading spam sites and trying to circumvent the security of each of the web pages has long been hardened. One of the most used tools to try to combat these annoying intruders are the google captcha, especially the version ReCaptcha V2, pero lamentablemente se ha difundido una vulnerabilidad en esta herramienta que permite resolver las captcha de manera automática.
The following article, purely educational, will show us how to bypass the security of reCAPTCHA V2 by exploiting its audio option. This article is inspired by the following post , which explains the vulnerability in detail and provides a script that allows us to solve CAPTCHAs automatically.
What is ReBreakCaptcha?
It is a free application that takes advantage of a vulnerability in ReCaptcha V2 to automatically solve captchas . To do this, it uses the Selenium automation library , the Google Speech Recognition API , and various algorithms.
The tool is quite simple, going through three phases: the first where it solves the popular " I'm not a robot " captcha; then, when the captcha that needs to be solved appears, it chooses the audio option, receives the audio and processes it with the Google Voice Recognition API ; finally, it enters the numbers recognized by the API and puts them into the captcha field.
The Google Speech Recognition Api may fail repeatedly, so ReBreakCaptchaYou try various alternatives until you get the right solution.
Install and configure ReBreakCaptcha
To use ReBreakCaptcha we must follow a few simple steps, as the original script comes patched with paths for Windows.
- First of all, we must install the necessary dependencies for the script to work:
sudo pip install pydub SpeechRecognition selenium
- Next we must clone the repository of the script:
git clone https://github.com/eastee/rebreakcaptcha.git - We go to the cloned desktop and edit the class, with the corresponding paths for Linux.
cd rebreakcaptcha nano nano rebreakcaptcha.py
They should change the following information
# Firefox / Gecko Driver Related FIREFOX_BIN_PATH = r "C: \ Program Files (x86) \ Mozilla Firefox \ firefox.exe" GECKODRIVER_BIN = r "C: \ geckodriver.exe"
By the way in Linux
# Firefox / Gecko Driver Related FIREFOX_BIN_PATH = r "/ usr / bin / firefox" GECKODRIVER_BIN = r "/ usr / bin / geckodriver"
In the same way if you use python3, please replace
xrangebyrange. We must also modify the URL where we want to apply the script (That is, the one we want the Script to solve).
We can do it in the line where the following appears:
RECAPTCHA_PAGE_URL = "https://www.google.com/recaptcha/api2/demo" - Finally we must run ReBreakCaptcha, it will automatically open the browser with the url that has been indicated and carry out the process to resolve the captcha in question.
python3 rebreakcaptcha.py
Conclusions about ReBreakCaptcha
This script can be the basis to use it in various processes and in python with simple steps we can improve it. The use of this tool must be for educational use, and for the community in general it is important to disseminate it as it guarantees that we will soon have a patch that solves this vulnerability.
The vulnerability is still active, so it is recommended that users of ReCaptcha V2 supplement their security with other tools, especially those that detect IP addresses that repeatedly attempt to solve captchas.