• Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
AnonyViet - English Version
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
AnonyViet - English Version
No Result
View All Result
Home Tips

How to bypass Google Captcha with python

AnonyViet by AnonyViet
February 23, 2023
in Tips
0
0
SHARES
Share on FacebookShare on Twitter

This article is for those of you who are doing reg tools, registering multiple accounts on the website. Or maybe it’s crawling data and getting caught in captcha without knowing how to solve it. When caught in captcha, you have to spend 3 -5 seconds to solve them. For normal users, it’s okay, but for tool users to create from a few hundred to a few thousand accounts or requests, this is not a solution. So in this article, I will show you how to solve Google captcha with Python super easy.

CAPTCHA stands for Completely Automated Public Turing test to tell Computers and Humans Apart. A CAPTCHA is a tool used to distinguish between real users and computers, such as bots. CAPTCHAs present challenges that are difficult for computers to do but relatively easy for humans. For example, identify letters or choose a traffic light in a hard-to-see photo.

CAPTCHA works by providing information to real users to decode. Traditional CAPTCHAs provide distorted or overlapping letters and numbers for user confirmation. Distorted letters make it difficult for bots to decipher and prevent access until the captcha is verified.

Since CAPTCHA was introduced, bots using machine learning have been developed. These bots are better able to verify traditional CAPTCHAs using algorithms that are trained many times over. As a result of this development, newer CAPTCHA methods based on more complex tests are born. For example, reCAPTCHA requires clicking on a specific area and waiting until the solve is successful.

Get AzCaptcha’s KeyAPI

Step 1: First, you go to AZcaptcha website and register a new account. Each newly created account will be given $0.02, you can solve 10 to 20 times depending on the type of Captcha. Note: I recommend that you use a temporary email to create an account. If you run out of money, just create another new account.

Step 2: On the dashboard page, you will see the keyAPI on the right side, copy that keyAPI.

How to bypass Google Captcha with python 4

How to bypass Google Captcha with python

First, you need to make sure your system has full python, pip. Then install 2 more packages request and bs. I will also use the site reCaptcha demo as an example in this article.

You press F12 search for keywords sitekey equal Ctrl + F.

How to bypass Google Captcha with python 5

As you can see above, the div tag has the class “g-recaptcha” and the data-sitekey is “6Le-wvk……”. In python there is a library that helps us to disassemble the html and get the data-sitekey inside the div tag bs4.

from bs4 import BeautifulSoup
import requests
from time import sleep

URL = 'https://www.google.com/recaptcha/api2/demo'

def get_siteKey(url):
    response = requests.get(url)
    soup = BeautifulSoup(response.text, "html.parser")
    g_recaptcha = soup.find_all('div', {'class' : 'g-recaptcha'})
    sitekey = g_recaptcha[0].get('data-sitekey')
    return sitekey

Next is the solve_Captcha function used to solve the captcha. You replace {keyAPI} with the API you get in the AZcaptcha page. After sending the request to solve the captcha successfully, the server will send the id of your captcha. This ID is used to identify the captcha that you send to the server. You should let the program stop for about 30 seconds for the server to solve the captcha.

def solve_Captcha(REQ_URL, url, keyAPI, sitekey):
    payload = {
        'key': keyAPI,
        'method': 'userrecaptcha',
        'googlekey': sitekey,
        'pageurl': url,
        'here': 'now'
    }
    response = requests.post(REQ_URL, data=payload)
    return response

BASE_URL = 'http://azcaptcha.com'
REQ_URL = BASE_URL + '/in.php'
RES_URL = BASE_URL + '/res.php'
keyAPI = '{keyAPI}'

response = solve_Captcha(REQ_URL, URL, keyAPI, siteKey)
if response.status_code == 200:
    print('Solving captcha...')
    id = response.text.split('|')[1]
    sleep(30)

Next, you use the get_gCaptcha function to check if the captcha has been solved. If done, we will get gCaptcha, and if not done, we continue to call the get_gCaptcha function again to check.

def get_gCaptcha(RES_URL, keyAPI, id):
    payload = {
        'key': keyAPI,
        'action': 'get',
        'id': id,
    }
    response = requests.post(RES_URL, data = payload)
    if response.text == 'CAPCHA_NOT_READY':
        print('CAPTCHA NOT READY. Try again in 30s.')
        sleep(30)
        gCaptcha = get_gCaptcha(RES_URL, keyAPI, id)
        return gCaptcha
    if 'OK' in response.text:
        gCaptcha = response.text.split('|')[1]
        return gCaptcha

Full code:

from bs4 import BeautifulSoup
import requests
from time import sleep

URL = 'https://www.google.com/recaptcha/api2/demo'

def get_siteKey(url):
    response = requests.get(url)
    soup = BeautifulSoup(response.text, "html.parser")
    g_recaptcha = soup.find_all('div', {'class' : 'g-recaptcha'})
    sitekey = g_recaptcha[0].get('data-sitekey')
    return sitekey

siteKey = get_siteKey(URL)
print(siteKey)
def solve_Captcha(REQ_URL, url, keyAPI, sitekey):
    payload = {
        'key': keyAPI,
        'method': 'userrecaptcha',
        'googlekey': sitekey,
        'pageurl': url,
        'here': 'now'
    }
    response = requests.post(REQ_URL, data=payload)
    return response
def get_gCaptcha(RES_URL, keyAPI, id):
    payload = {
        'key': keyAPI,
        'action': 'get',
        'id': id,
    }
    response = requests.post(RES_URL, data = payload)
    if response.text == 'CAPCHA_NOT_READY':
        print('CAPTCHA NOT READY. Try again in 30s.')
        sleep(30)
        gCaptcha = get_gCaptcha(RES_URL, keyAPI, id)
        return gCaptcha
    if 'OK' in response.text:
        gCaptcha = response.text.split('|')[1]
        return gCaptcha
    
BASE_URL = 'http://azcaptcha.com'
REQ_URL = BASE_URL + '/in.php'
RES_URL = BASE_URL + '/res.php'
keyAPI = '{keyAPI}'

response = solve_Captcha(REQ_URL, URL, keyAPI, siteKey)
if 'OK' in response.text:
    print('Solving captcha...')
    id = response.text.split('|')[1]
    sleep(30)
    gCaptcha = get_gCaptcha(RES_URL, keyAPI, id)
    print(gCaptcha)
else:
    print(response.text)

You have successfully obtained the gCaptcha code. Next, you just need to replace the gCaptcha code on the page you want to pass the captcha by using the excute javascript command below:

document.getElementById("g-recaptcha-response").innerHTML="{gCaptcha}";

That’s it, then. Good luck.

Tags: BypassCaptchaGooglePython
Previous Post

Instructions to find your Facebook ID

Next Post

Code Create a widget on Facebook – Multi-Function Synthesis

AnonyViet

AnonyViet

Related Posts

[Facebook] Latest TUT Rip
Tips

[Facebook] Latest TUT Rip

March 26, 2023
[Facebook] Summary of Facebook report spells
Tips

[Facebook] Summary of Facebook report spells

March 25, 2023
How to use the Fn key on a laptop keyboard
Tips

How to use the Fn key on a laptop keyboard

March 24, 2023
Unleash your creativity and expand your image with the DALL-E 2
Tips

Unleash your creativity and expand your image with the DALL-E 2

March 24, 2023
How to create USB Boot, USB install Windows with Rufus
Tips

How to create USB Boot, USB install Windows with Rufus

March 23, 2023
5 steps to fix 100% Full Disk error on Windows 8/8.1/10
Tips

5 steps to fix 100% Full Disk error on Windows 8/8.1/10

March 22, 2023
Next Post
Code Create a widget on Facebook – Multi-Function Synthesis

Code Create a widget on Facebook - Multi-Function Synthesis

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent News

[Facebook] Latest TUT Rip

[Facebook] Latest TUT Rip

March 26, 2023
How to unlock the hidden FM Radio feature on your phone

How to unlock the hidden FM Radio feature on your phone

March 26, 2023
[Facebook] Summary of Facebook report spells

[Facebook] Summary of Facebook report spells

March 25, 2023
Tổng hợp các nhóm Hacker APT trên thế giới

Tổng hợp các nhóm Hacker APT trên thế giới

March 25, 2023
[Facebook] Latest TUT Rip

[Facebook] Latest TUT Rip

March 26, 2023
How to unlock the hidden FM Radio feature on your phone

How to unlock the hidden FM Radio feature on your phone

March 26, 2023
[Facebook] Summary of Facebook report spells

[Facebook] Summary of Facebook report spells

March 25, 2023
AnonyViet – English Version

AnonyViet

AnonyViet is a website share knowledge that you have never learned in school!

We are ready to welcome your comments, as well as your articles sent to AnonyViet.

Follow Us

Contact:

Email: anonyviet.com[@]gmail.com

Main Website: https://anonyviet.com

Recent News

[Facebook] Latest TUT Rip

[Facebook] Latest TUT Rip

March 26, 2023
How to unlock the hidden FM Radio feature on your phone

How to unlock the hidden FM Radio feature on your phone

March 26, 2023
No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office

© 2023 JNews - Premium WordPress news & magazine theme by Jegtheme.