Python으로 hCaptcha 우회
5519 단어 captchapythonjavascripthcaptcha
Cloudflare happily announced that they are moving from Google ReCaptcha to Intuition Machines's hCaptcha. The move helped big time with data confidentiality concerns and captcha flexibility. Now attack protection is even more adaptive. This will affect all Cloudflare customers.
또한, hCaptcha
훌륭하지 않나요? 그러나 Cloudflare에서 hCaptcha를 우회하는 것은 어떻습니까?
빠른 hCaptcha 자동화를 위해 2captcha-python 모듈을 사용합니다. Python 3.x가 필요하며 pip로 설치할 수 있습니다.
pip3 install 2captcha-python
또는 저장소를 복제할 수 있지만 미리 요청 모듈을 설치하는 것을 잊지 마십시오.
git clone https://github.com/2captcha/2captcha-python.git
준비
API 키를 보내는 2Captcha 클래스의 새 인스턴스를 만들어야 합니다.
from 2captcha import 2Captcha #module import
solver = 2Captcha('YOUR_API_KEY') #your 2captcha API key
보안 문자 해상도
이제 보안 문자 해결 알고리즘을 만들어 보겠습니다.
result = solver.hcaptcha(sitekey='10000000-ffff-ffff-ffff-000000000001',
url='https://www.site.com/page/',
proxy={
'type': 'HTTPS',
'uri': 'username:[email protected]:1234'
})
Cloudflare는 hCaptcha 토큰 확인 중에 IP 주소를 확인합니다. 이제 보안 문자는 제출한 동일한 IP 주소에서 해결되어야 합니다. Cloudflare에서 hCaptcha를 성공적으로 우회하려면 다른 보안 문자 매개변수와 함께 프록시를 보내야 합니다.
이 호출은 보안 문자를 우회하는 토큰을 반환합니다.
{'captchaId': '64793693810', 'code': 'P0_eyJ0eXAiOiJKV1QiLCJhbGciOiJIUz...'}
솔루션 사용
그런 다음 코드의 토큰이 h-captcha-response 및 g-recaptcha-response 필드의 웹사이트에 제출됩니다. 가장 쉬운 방법은 브라우저를 사용하는 경우 JavaScript를 사용하는 것입니다. 그렇지 않으면 적절한 HTTP 요청에서 토큰을 보냅니다.
let submitToken = (token) => {
document.querySelector('[name=g-recaptcha-response]').innerText = token
document.querySelector('[name=h-captcha-response]').innerText = token
document.querySelector('.challenge-form').submit()
}
submitToken('TOKEN_STRING')
시간을 할애할 가치가 있습니까? 우리의 의견으로는 절대적으로 그렇습니다. 몇 줄의 코드로 많은 시간을 절약할 수 있습니다. 그리고 자체 호스팅 솔루션을 실행하기로 결정했다면 2captcha가 훨씬 더 많은 수익을 올릴 것입니다.
Reference
이 문제에 관하여(Python으로 hCaptcha 우회), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/kentavr009/bypassing-hcaptcha-with-python-4ghh텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)