Skip to content

Free ReCaptcha v2 and v3 breaker

rastarrrastarr Thailand
Caveats First: 
    - The only coding I've done is assembly language on a Z80 Amstrad a great many years ago
    - I've never touched Python or used FastAPI
    - I was prompted to do this when some Facebook guy said he'd integrated Recaptcha into GSA CaptchaBreaker, said he'd give it away and then didn't
    - I'm also a Mac user but have GSA SER & CB etc running on my MacMini to try and get some juice for my sites. I'm no Windows expert but I can get around

1. install Python from https://www.python.org/downloads/
click the box on the installer to 'Add python.exe to PATH'
at the end of the installation, also click the 'Disable path length limit'
then close button

2. Now to install ffmpeg via the command line


Scroll down to the 'Install Using Windows Cmd Shell' section. Paste in the command you see there

3. next run 'choco install ffmpeg' and when prompted, type 'yes' to accept all further install prompts

4. also run ' pip install fastapi playwright playwright-recaptcha python-multipart uvicorn ' - this installs the wrapper which will act as an internal webserver as well as the GitHub code that does the captcha solving

5. also ' pip install msvc-runtime ' which I found early on is needed to avoid some missing code

6. from Windows command line, ' playwright install ' - this preps and installs the needed web browsers so captcha solving can run in the background

7. To avoid Windows permission problems, I chose my user directory and Documents to store stuff.

Make a 'recaptcha' directory, and then 1 inside this one - used _capv2v3 since I prefer directories to be listed at the top. These names can be anything that makes better sense for you. They can be anything you like.

Unzip the attachment from this post and copy the attached _capv2v3.py into the '_capv2v3' directory

NOTE: You will need edit the _capv2v3.py file to fill in rotating proxy details into the top solve_captcha2 function. I've been told ReCaptchav2 solving has a higher success rate with proxies but no idea really. Mine are currently webshare proxies.

8. This script/FastAPI webserver will create small txt files that I have used to update the captcha's status and final result. It creates lots of these files so I have an internal function inside it that deletes any .txt file that is older than 30 minutes. Be aware to not store anything else inside these 2 directories, with a .txt extension.

Caveat: There is room for improvement to use some lightweight database obviously but that's too complicated for me, at this stage. 

9. Open a Windows CMD shell (run as Administrator) and navigate to the '_capv2v3' directory.

In the Windows CMD shell, run this command 'uvicorn _capv2v3:app --port 8000 --workers 8' - adjust number of workers to your system.

The Windows CMD shell should now be running a webserver awaiting input for captcha solving

10. Now it is time to activate them into GSA SER. You can add this to GSA CaptchaBreaker if it is running in webserver mode too.

11. Click GSA SER options, and the left 'Captcha' tab.

Click add and choose 2Captcha API With IP from the top of the list

Host - 127.0.0.1:8000
API-Key - GSA (or anything else but fill something in)
Usage types - tick both ReCaptchav2 and ReCaptchav3
Other options are up to your situation and choice.



12. Click OK and you should soon see activity in the Windows CMD shell.

13. Be very careful when editing the .ph Python file too. Python is not tolerate with incorrect code formatting. Keep the formatting as it is in the original file and you should be OK.

14. My experience with XEvil was an awful lot of failures, timeouts etc. It was very heavy on my MacMini, crashed a lot, it's developers were always price-gouging for upgrades and they never reply to any emails, leaving me without access to their forums for help. Plus their hidden monthly subscription fee.

Anyway, I hope I've covered the installation. I've spent a bit of time optimising as best I can with my experience and all seems to be OK.

Big thanks go out to the guy/s at https://github.com/Xewdy444/Playwright-reCAPTCHA and special thanks to ChatGPT who I chatted with for many long hours in Python help :)

Comments welcome and certainly if you have any Python skills then don't be afraid to jump in on improvements.


Edit: script updated Mar 3, 2023 and threads set to 0 for testing
Tagged:
«1

Comments

  • Awesome, thanks for sharing.
    Why not add this natively @Sven
  • Awesome, thanks for sharing.
    Why not add this natively @Sven
    This is a first working draft. it would be prudent to shake the cobwebs out, over time. Sven can add a special engine down the track to support it more too.
    Let's not get ahead of ourselves - it works for me. no idea about others and what my 64 year old brain has forgotten :)
  • SvenSven www.GSA-Online.de
    Indeed this is a fantastic work from @rastarr ! We will try to pack it to a separate setup for others to enjoy. It might not get an official part of GSA as it is open source and maybe not allowed to add with commercial software.
    I know others captcha apps ignore this rule (not mentioning names here), but we in GSA play fair.
    Thanked by 2rastarr Deeeeeeee
  • this looks fantastic. cant wait to try this out. and @Sven , if you can package it it up as a setup that would be amazing. Hats off @rastarr you have nailed something that other current developers didn't touch.  
  • SvenSven www.GSA-Online.de
    I try my best but haven't found time adding this together.
  • understandable @Sven but please add it to your never ending todo list  :)
  • edited March 2023
    hey @rastarr

    I just implemented this and its working great. Thanks for sharing this. 

    I'm however seeing a lot of errors mainly saying Error solving v2 captcha: 'PlainTextResponse' object has no attribute 'startswith'
    So my solving ratio is at 3%. Have you faced this? any ideas mate?

  • rastarrrastarr Thailand
    edited March 2023
    dp001 said:
    hey @rastarr

    I just implemented this and its working great. Thanks for sharing this. 

    I'm however seeing a lot of errors mainly saying Error solving v2 captcha: 'PlainTextResponse' object has no attribute 'startswith'
    So my solving ratio is at 3%. Have you faced this? any ideas mate?

    It's some print formatting thing which does not have anything to do with the solving process. I'll need to sit down and think of a better way to handle the error for display.

    Run the CMD shell as Administrator too, I think there's a heap of webserver traffic which seems to halt a response back to GSA. or something like that.

    Yeah, solving success is going to be low.

    When I was using Xevil, I so a great many sites where their Captcha did not function or some key issue.

    Also, bear in mind, the solving ration is way way wrong. The success may be right but that high number of failed seems to be each GET request to poll the status. That polling happens about every 5 or so seconds and, I think, each time it gets a CAPCHA_NOT_READY message that it's counting as a failure.

    I'm running my 2capv2v3 solving instance with 40 workers on my more powerful iMac actually and connecting from my Windows 10 Mac Mini machine. Running more threads may help too. Still early days yet.

    Personally, I think I'll be dropping Recap v2 v3 solving - very low returns which don't appear to be worth the effort.

    I've also added an updated .py file (zipped) so I'm running Firefox in headless mode for an improvement in speed and memory usage

    And a big thanks for giving it a try-out too.
  • Wow, sounds amazing, thanks @rastarr

    Does your recaptcha solver need proxies ?
  • rastarrrastarr Thailand
    chaiavi said:
    Wow, sounds amazing, thanks @rastarr

    Does your recaptcha solver need proxies ?
    Yes, read in Step 7 of my instructions:

    NOTE: You will need edit the _capv2v3.py file to fill in rotating proxy details into the top solve_captcha2 function. I've been told ReCaptchav2 solving has a higher success rate with proxies but no idea really. Mine are currently webshare proxies.
    Thanked by 1chaiavi
  • @rastarr
    Great stuff, thx! I salute you. 
    Did your LpM increase significantly?

    Could you tell me more about your proxies experiences with Webshare proxies. I've checked their pricing and it's quite confusing. I use 50 private proxies from BuyProxies.org and they pretty bad for GSA (works well on Scrapebox though...)
    I'd like get it for GSA 2-3 projects with 50 threads running. Any recommendations on Webshare packages?
    Thanked by 1rastarr
  • rastarrrastarr Thailand
    themercen said:
    @rastarr
    Great stuff, thx! I salute you. 
    Did your LpM increase significantly?

    Could you tell me more about your proxies experiences with Webshare proxies. I've checked their pricing and it's quite confusing. I use 50 private proxies from BuyProxies.org and they pretty bad for GSA (works well on Scrapebox though...)
    I'd like get it for GSA 2-3 projects with 50 threads running. Any recommendations on Webshare packages?
    No, I didn't see any increase in LpM/VpM when running my tests, using 260 threads.
    I'm not the right person to talk to about Webshare since my proxy experiences are limited, sorry.
    I think there would be better options but I chose Webshare simply as a starting point.

    Until I start seeing some benefit from using GSA SER, I'm on a limited budget/expenditure. Hopefully I'll start seeing something soon though.
  • Thank you rastarr for your share !

    Sven if you can package this tool it will be great !!
  • royalmiceroyalmice WEBSITE: ---> https://asiavirtualsolutions.com | SKYPE:---> asiavirtualsolutions

    Hi @rastarr


    Thank you for sharing your detailed instructions on how to create a free ReCaptcha v2 and v3 breaker. Your post is incredibly helpful and informative for those who want to use ReCaptcha without incurring additional costs.

    As you noted in your post, the script could benefit from the use of a lightweight database to improve its functionality. Therefore, I would suggest exploring the use of SQLite, a self-contained, serverless, zero-configuration, transactional SQL database engine. It is a perfect choice for small to medium-sized web applications, and it can easily be integrated into Python code.

    Moreover, to enhance the script's performance, it could be helpful to consider the use of multi-threading. Multi-threading will allow the script to execute multiple tasks simultaneously, thereby reducing the time it takes to solve the captchas.

    Overall, your post is informative and helpful, and your efforts are commendable. I hope my suggestions will help improve the functionality of your script and make it even more user-friendly.


    The below can help with the Multithreading:


  • rastarrrastarr Thailand
    royalmice said:

    Hi @rastarr


    Thank you for sharing your detailed instructions on how to create a free ReCaptcha v2 and v3 breaker. Your post is incredibly helpful and informative for those who want to use ReCaptcha without incurring additional costs.

    As you noted in your post, the script could benefit from the use of a lightweight database to improve its functionality. Therefore, I would suggest exploring the use of SQLite, a self-contained, serverless, zero-configuration, transactional SQL database engine. It is a perfect choice for small to medium-sized web applications, and it can easily be integrated into Python code.

    Moreover, to enhance the script's performance, it could be helpful to consider the use of multi-threading. Multi-threading will allow the script to execute multiple tasks simultaneously, thereby reducing the time it takes to solve the captchas.

    Overall, your post is informative and helpful, and your efforts are commendable. I hope my suggestions will help improve the functionality of your script and make it even more user-friendly.


    The below can help with the Multithreading:


    The script is already async and multithreading.
    And from all my research, SQLite is a poor choice for instances of multiple transactions. I'd have to think along the lines of mySQL or similar
    Thanked by 1royalmice
  • royalmiceroyalmice WEBSITE: ---> https://asiavirtualsolutions.com | SKYPE:---> asiavirtualsolutions
    @rastarr
    Thanks, you are absolutely correct . 
    While SQLite supports transaction management, it uses a locking mechanism to ensure data integrity, which can lead to performance issues in cases of concurrent transactions. As a result, if your application requires high levels of concurrency or heavy write operations, using a more robust database management system such as MySQL or PostgreSQL may be a better choice.

    Thanks for correcting me.
  • Hi, I was wondering if you could help out. I've gotten as far as installing everything, I can run the python server instances, and I've set up in GSA Captcha Breaker to connect on 127.0.0.1:8000
     When I do a test "check balance" it works and says 100. But when I try to test a recaptcha2 or 3 it gives error :
    Missing data for Next-URL (Internal Server Error)
    can you help? Maybe you've seen this before and know what it is. I don't really have a clue at this point.
    I put a proxy url and port in the py script, it doesn't have a username or password so I left those empty, I'm not sure if that affects it.
    Thanks so much in advance!
    Hugh
  • Update: I got everything to work without errors, the solution to the problem above was pip install python-multipart

    But I'm now getting the same error that was mentioned by dp001 or similar -

    Error solving v2 captcha: 'PlainTextResponse' object has no attribute 'startswith'
    Error solving v3 captcha: 'PlainTextResponse' object has no attribute 'startswith'

    that shows in the command line. In the GUI it says CAPTCHA UNSOLVABLE.

    This is happening when I do the recaptcha test in GSA Captcha Breaker for v2 and v3 recaptcha. It seems like those should be easily solved since they're the basic demos. It also seems like everything else is running perfectly so this is perplexing.

    Any ideas? Many thanks in advance
  • rastarrrastarr Thailand
    Update: I got everything to work without errors, the solution to the problem above was pip install python-multipart

    But I'm now getting the same error that was mentioned by dp001 or similar -

    Error solving v2 captcha: 'PlainTextResponse' object has no attribute 'startswith'
    Error solving v3 captcha: 'PlainTextResponse' object has no attribute 'startswith'

    that shows in the command line. In the GUI it says CAPTCHA UNSOLVABLE.

    This is happening when I do the recaptcha test in GSA Captcha Breaker for v2 and v3 recaptcha. It seems like those should be easily solved since they're the basic demos. It also seems like everything else is running perfectly so this is perplexing.

    Any ideas? Many thanks in advance
    The 'PlainTextResponse' thing is a string manipulation issue but has no bearing on actual captcha solving so don't worry about it.
    For a v3 test, use https://antcpt.com/score_detector/ as the URL which usually worked for me
    v2 I was testing with https://recaptcha-demo.appspot.com/recaptcha-v2-checkbox.php
    The site key is irrelevant as the script does it's own thing and doesn't need these parameters to be passed.
    Apologies as my internet is limited at the moment 
  • {"detail":"Not Found"}
    
    http://127.0.0.1:8000
    
    16:05:25: [-] 233/497 captcha service 2Captcha API With IP is not responding/can`t solve
    
    
    
  • 16:22:41: [-] 401/520 ReCaptcha solving failed - 2Captcha API With IP: missing data for Next-URL (Internal Server Error)
  • rastarrrastarr Thailand
    Turkwebs said:
    {"detail":"Not Found"}
    
    http://127.0.0.1:8000
    
    16:05:25: [-] 233/497 captcha service 2Captcha API With IP is not responding/can`t solve
    
    
    
    Did you try pip install python-multipart mentioned in the message just before your message?
    I've updated my install instructions too - must have missed that dependency
  • If I give teamwiewer captchas that do not solve the captchas can you connect and install from my computer?
  • rastarrrastarr Thailand
    Turkwebs said:
    If I give teamwiewer captchas that do not solve the captchas can you connect and install from my computer?
    Umm no, I won't be doing that, sorry
  • rastarr said:
    Update: I got everything to work without errors, the solution to the problem above was pip install python-multipart

    But I'm now getting the same error that was mentioned by dp001 or similar -

    Error solving v2 captcha: 'PlainTextResponse' object has no attribute 'startswith'
    Error solving v3 captcha: 'PlainTextResponse' object has no attribute 'startswith'

    that shows in the command line. In the GUI it says CAPTCHA UNSOLVABLE.

    This is happening when I do the recaptcha test in GSA Captcha Breaker for v2 and v3 recaptcha. It seems like those should be easily solved since they're the basic demos. It also seems like everything else is running perfectly so this is perplexing.

    Any ideas? Many thanks in advance
    The 'PlainTextResponse' thing is a string manipulation issue but has no bearing on actual captcha solving so don't worry about it.
    For a v3 test, use https://antcpt.com/score_detector/ as the URL which usually worked for me
    v2 I was testing with https://recaptcha-demo.appspot.com/recaptcha-v2-checkbox.php
    The site key is irrelevant as the script does it's own thing and doesn't need these parameters to be passed.
    Apologies as my internet is limited at the moment 
    Thanks much Rastarr, ok it seems to be running well now. I've had it running for two days and cracking captchas (not all but it is working to some extent)
  • rastarr said:
    Turkwebs said:
    {"detail":"Not Found"}
    
    http://127.0.0.1:8000
    
    16:05:25: [-] 233/497 captcha service 2Captcha API With IP is not responding/can`t solve
    
    
    
    Did you try pip install python-multipart mentioned in the message just before your message?
    I've updated my install instructions too - must have missed that dependency
    Yes indeed. Actually that wasn't the only one I had to install separately, I also had to install uvicorn separately as it did not come with the recommended bundle.
    Thanked by 1rastarr
  • rastarr said:
    Turkwebs said:
    {"detail":"Not Found"}
    
    http://127.0.0.1:8000
    
    16:05:25: [-] 233/497 captcha service 2Captcha API With IP is not responding/can`t solve
    
    
    
    Did you try pip install python-multipart mentioned in the message just before your message?
    I've updated my install instructions too - must have missed that dependency
    Yes indeed. Actually that wasn't the only one I had to install separately, I also had to install uvicorn separately as it did not come with the recommended bundle.
    teacher teamwiewer if I give you my computer you can also install it I could not establish a help to me
  • rastarrrastarr Thailand
    Turkwebs said:

    teacher teamwiewer if I give you my computer you can also install it I could not establish a help to me
    I've updated the install instructions, since I missed a few pip dependencies. Perhaps read and try the install again might be best for you
  • http://127.0.0.1:8000 not installing modules here error
    {"detail":"Not Found"}
    
    If anyone can connect with teamwiewer and install it, throw it or write it on the thread
    
  • DeeeeeeeeDeeeeeeee the Americas
    edited March 2023
    Hi. This is an interesting development. Thank you, @rastarr!!

    I've followed the installation directions here. I am unsure about one part:

    I see "server": "ht tp://p.webshare.io:80",
                "username": "PROXY-USERNAME",
                "password": "PROXY-PASSWORD"

    I use proxies for solving Recaptcha2 and 3 from Asia Virtual Solutions with Xevil.  Must I get proxies from webshare or a service like it? @royalmice, is there a way to use the ones that you provide?

    I'm guessing that the webshare service is a gateway with rotating proxies?

    Thanks ahead of time for any help...

    Without changing the proxy info, CB gets this "Error solving v3 captcha: 'PlainTextResponse' object has no attribute 'startswith'" in response to testing Recaptcha3 with the default test details provided with GSA CB.
Sign In or Register to comment.