- Joined
- Feb 23, 2018
- Messages
- 225
- Reaction score
- 35
- Achievement
Hi, since 9Hits Viewer 2.3.2, 2Captcha API has been integrated. To use 2Captcha, firstly you have to create an account at 2Captcha
Ref for daniel
None ref
Thumb up our application on 2Captcha
The bypass captcha would be available for VIP members only, but currently it's also available for PREMIUM members. The viewer has now support 3 functions to work with 2Captcha:
GetImageByXpath: returned an image in base64 formart. xpath is the xpath of the target image, and frameUrlRegex is the url regular expression of target frame. leave null if the image was in main frame.
_2CaptchaSolve function has 2 arguments
- params: The 2Captcha API params
- timeout: Set timeout for the action
=> Examples of usage:
Image Captcha:
+ method must be 'base64'
+ json must be 1
+ key and body are required
ReCaptcha v2:
+ method must be 'userrecaptcha'
+ json must be 1
+ key and googlekey and pageurl are required
Other captcha type?: Hmm, I just have tested with image and recaptcha, with other type of captcha that supported by 2Captcha, just try to grab the input for API, and call _2CaptchaSolve function with appropriate parameters.
Return result: The _2CaptchaSolve will return an object like this
if failed
or if success
Base on the returned result, you can now use other macros functions to continue your process (filling the answer, submit form, etc). If you can determined that the answer from 2Captcha was incorrect, you may call _2CaptchaReportBad to tell them that the captcha answer was incorrect. Please careful when use this function because if you report too much correct answers as incorrect, your account may got trouble with them.
Ok, now is the show time:
Demo for Image captcha
Demo for Recaptcha v2
It's hard for you ? do not hesitate to ask help from me. I'm always ready to help you for free !
- Daniel -
Ref for daniel
None ref
Thumb up our application on 2Captcha
The bypass captcha would be available for VIP members only, but currently it's also available for PREMIUM members. The viewer has now support 3 functions to work with 2Captcha:
- GetImageByXpath(xpath, frameUrlRegex)
- _2CaptchaSolve(params, timeout)
- _2CaptchaReportBad(key, captchaId)
GetImageByXpath: returned an image in base64 formart. xpath is the xpath of the target image, and frameUrlRegex is the url regular expression of target frame. leave null if the image was in main frame.
_2CaptchaSolve function has 2 arguments
- params: The 2Captcha API params
- timeout: Set timeout for the action
=> Examples of usage:
Image Captcha:
+ method must be 'base64'
+ json must be 1
+ key and body are required
JavaScript:
//Get the image in base64 encoded
var capt = await GetImageByXpath('//*[@id="CAPTCHA"]');
//Call 2Captcha API and wait for result
var result = await _2CaptchaSolve({
'key' : 'YOUR_OWN_2CAPTCHA_APY_KEY',
'method' : 'base64',
'json' : 1,
'body': capt
});
ReCaptcha v2:
+ method must be 'userrecaptcha'
+ json must be 1
+ key and googlekey and pageurl are required
JavaScript:
//Get recaptcha data from the target website (assuming we are in main frame)
var sitekey = await GetAttribute('//*[@class=\"g-recaptcha\"]', 'data-sitekey');
var pageUrl = await EvaluateScript('window.location.href');
var result = await _2CaptchaSolve({
'key' : 'YOUR_OWN_2CAPTCHA_APY_KEY',
'method' : 'userrecaptcha',
'json' : 1,
'googlekey': sitekey,
'pageurl' : pageUrl
}, 300);
Return result: The _2CaptchaSolve will return an object like this
if failed
JSON:
{status:0, request:'Some Error Message'}
JSON:
{status:1, request:'Answer From 2Captcha', captchaId:123456789}
Ok, now is the show time:
Demo for Image captcha
JavaScript:
await Delay(15000);
var capt = await GetImageByXpath('//*[@id="CAPTCHA"]');
var result = await _2CaptchaSolve({
'key' : 'YOUR_OWN_2CAPTCHA_APY_KEY',
'method' : 'base64',
'json' : 1,
'body': capt
});
//Alert(JSON.stringify(result));
await Delay(10000);
SetById("securityCode", "value", result.request);
await Delay(1000);
ClickById("Submit Form");
await Delay(10000);
var incorect = await EvaluateScript('document.getElementsByClassName("title")[0].innerText.startsWith("Incor")');
if(incorect && result && result.captchaId)
{
_2CaptchaReportBad('YOUR_OWN_2CAPTCHA_APY_KEY', result.captchaId);
}
JavaScript:
await Delay(5000);
var sitekey = await GetAttribute('//*[@class=\"g-recaptcha\"]', 'data-sitekey');
var pageUrl = await EvaluateScript('window.location.href');
var result = await _2CaptchaSolve({
'key' : 'YOUR_OWN_2CAPTCHA_APY_KEY',
'method' : 'userrecaptcha',
'json' : 1,
'googlekey': sitekey,
'pageurl' : pageUrl
}, 300);
//Alert(JSON.stringify(result));
SetById("g-recaptcha-response", "text", result.request);
await Delay(1000);
ClickById("recaptcha-demo-submit");
await Delay(5000);
var incorect = await EvaluateScript('document.getElementsByClassName("recaptcha-error").length>0');
if(incorect && result && result.captchaId)
{
_2CaptchaReportBad('YOUR_OWN_2CAPTCHA_APY_KEY', result.captchaId);
}
- Daniel -
Last edited: