AmazonTask | AWS WAF Captcha and Challenge
Solving CAPTCHA and challenge in AWS WAF
This task will be performed using our proxy servers.
Possible captcha variants
Request parameters
type
<string>requiredAmazonTaskProxyless
websiteURL
<string>requiredThe address of the main page where the captcha is solved.
challengeScript
<string>requiredLink to challenge.js (see description below)
captchaScript
<string>requiredLink to captcha.js (see description below)
websiteKey
<string>requiredA string that can be retrieved from an html page with a captcha or with javascript by executing the window.gokuProps.key
context
<string>requiredA string that can be retrieved from an html page with a captcha or with javascript by executing the window.gokuProps.context
iv
<string>requiredA string that can be retrieved from an html page with a captcha or with javascript by executing the window.gokuProps.iv
cookieSolution
<boolean>optionalBy default false. If you need to use cookies "aws-waf-token", specify the value true. Otherwise, what you will get in return is "captcha_voucher" and "existing_token".
How to get websiteKey, context, iv and challengeScript parameters
When you go to a website, you get a 405 response and an html page with a captcha. It is from this page that you can get all the parameters:
Create task method
https://api.capmonster.cloud/createTask
Request
{
"clientKey": "API_KEY",
"task": {
"type": "AmazonTaskProxyless",
"websiteURL": "https://efw47fpad9.execute-api.us-east-1.amazonaws.com/latest",
"challengeScript": "https://41bcdd4fb3cb.610cd090.us-east-1.token.awswaf.com/41bcdd4fb3cb/0d21de737ccb/cd77baa6c832/challenge.js",
"captchaScript": "https://41bcdd4fb3cb.610cd090.us-east-1.captcha.awswaf.com/41bcdd4fb3cb/0d21de737ccb/cd77baa6c832/captcha.js",
"websiteKey": "AQIDA...wZwdADFLWk7XOA==",
"context": "qoJYgnKsc...aormh/dYYK+Y=",
"iv": "CgAAXFFFFSAAABVk",
"cookieSolution": true
}
}
Response
{
"errorId":0,
"taskId":407533072
}
Get task result method
Use the getTaskResult method to get the AmazonTask solution.
https://api.capmonster.cloud/getTaskResult
Request
{
"clientKey":"API_KEY",
"taskId": 407533072
}
Response
{
"errorId":0,
"status":"ready",
"solution": {
"cookies": {
"aws-waf-token": "10115f5b-ebd8-45c7-851e-cfd4f6a82e3e:EAoAua1QezAhAAAA:dp7sp2rXIRcnJcmpWOC1vIu+yq/A3EbR6b6K7c67P49usNF1f1bt/Af5pNcZ7TKZlW+jIZ7QfNs8zjjqiu8C9XQq50Pmv2DxUlyFtfPZkGwk0d27Ocznk18/IOOa49Rydx+/XkGA7xoGLNaUelzNX34PlyXjoOtL0rzYBxMAQy0D1tn+Q5u97kJBjs5Mytqu9tXPIPCTSn4dfXv5llSkv9pxBEnnhwz6HEdmdJMdfur+YRW1MgCX7i3L2Y0/CNL8kd8CEhTMzwyoXekrzBM="
},
"userAgent": "userAgentPlaceholder"
}
}
Use SDK Library
- Python
- C#
# https://github.com/ZennoLab/capmonstercloud-client-python
import asyncio
from capmonstercloudclient import CapMonsterClient, ClientOptions
from capmonstercloudclient.requests import AmazonWafProxylessRequest
client_options = ClientOptions(api_key="your_api_key") # Replace with your CapMonster Cloud API key
cap_monster_client = CapMonsterClient(options=client_options)
amazon_waf_request = AmazonWafProxylessRequest(
websiteUrl="https://example.com", # URL с CAPTCHA
challengeScript="https://example.com/path/to/challenge.js",
captchaScript="https://example.com/path/to/captcha.js",
websiteKey="your_website_key",
context="your_context_value",
iv="your_iv_value",
cookieSolution=False
)
async def solve_captcha():
return await cap_monster_client.solve_captcha(amazon_waf_request)
responses = asyncio.run(solve_captcha())
print(responses)
// https://github.com/ZennoLab/capmonstercloud-client-dotnet
using Zennolab.CapMonsterCloud.Requests;
using Zennolab.CapMonsterCloud;
class Program
{
static async Task Main(string[] args)
{
var clientOptions = new ClientOptions
{
ClientKey = "your_api_key" // Replace with your CapMonster Cloud API key
};
var cmCloudClient = CapMonsterCloudClientFactory.Create(clientOptions);
var amazonWafRequest = new AmazonWafProxylessRequest
{
WebsiteUrl = "https://example.com", // URL with the captcha
ChallengeScript = "URL_of_challenge.js",
CaptchaScript = "URL_of_captcha.js",
WebsiteKey = "website_key",
Context = "context_value",
Iv = "iv_value",
CookieSolution = false
};
var solveResult = await cmCloudClient.SolveAsync(amazonWafRequest);
Console.WriteLine("ExistingToken: " + solveResult.Solution.ExistingToken); // Adjust based on your expected solution format
Console.WriteLine("CaptchaVoucher: " + solveResult.Solution.CaptchaVoucher);
}
}