What is the AWS WAF captcha?
AWS WAF is the web firewall that Amazon Web Services offers to the sites it hosts. A site owner can tell it to show a captcha when traffic looks automated, or when someone sends too many requests. Instead of the page you wanted, you get a screen asking you to confirm you are human, usually with a picture puzzle, sometimes with audio.
When you pass, the site sets a cookie called aws-waf-token. Your browser sends that cookie with every request after that, and the firewall lets those requests through. You’ll run into this on shops, travel sites, account pages, sign-ups, and anywhere a site on AWS wants to slow down bots.
A script that doesn’t have the cookie keeps getting the captcha page. DraxonCloud gets you the cookie value, so your script can carry on like a visitor who passed.
How to solve the AWS WAF captcha with DraxonCloud
- Copy the address of the page that shows the AWS WAF captcha.
- Send it to our API with the type
aws_waf. - Wait for the answer in one request.
- Add the value as an
aws-waf-tokencookie to your requests to the site.
No site key to hunt for, no browser to run.
What you send
website_url: the full address of the page that shows the captcha, likehttps://shop.example/account. Use the page you actually want to open, so the token is made for that site.proxy(optional): your proxy, asuser:pass@host:portor with a scheme likehttp://orsocks5://. Send one if your script uses a proxy, so the solve and your later requests come from the same place.
That’s it. There is no site key for AWS WAF.
What you get back
A solved task gives you solution.token. This is the value of the aws-waf-token cookie.
To use it:
- Set a cookie named
aws-waf-tokenwith exactly this value for the site’s domain. - Or add it to your request’s
Cookieheader, likeCookie: aws-waf-token=<solution.token>. - If you sent a proxy, send these requests through the same proxy.
- Keep using the cookie for the next requests. When the site starts showing the captcha again, ask for a new one.
Copy the value exactly. Don’t trim or decode it.
A quick example
Start a task:
curl -s -X POST https://draxon.one/api/captcha/v1/tasks \
-H "Authorization: Bearer $DRAXON_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "aws_waf",
"website_url": "https://shop.example/account"
}'
Wait for it:
curl -s -H "Authorization: Bearer $DRAXON_KEY" \
"https://draxon.one/api/captcha/v1/tasks/<id>?wait=30"
The answer (some fields left out):
{
"status": "solved",
"solution": {
"token": "a1b2c3d4-e5f6-...:AAoAgQ6Hc4j0AAAA:..."
}
}
Then use it:
curl -s -H "Cookie: aws-waf-token=<solution.token>" https://shop.example/account
Already using another service?
- CapSolver and Anti-Captcha style:
createTaskwithAwsWafTask,AwsWafTaskProxyless,AntiAwsWafTask,AntiAwsWafTaskProxyLess,AmazonTaskorAmazonTaskProxyless. In the result,solution.cookieholds the value andsolution.cookiesholds{"aws-waf-token": "..."}. - 2Captcha style:
in.phpwithmethod=amazon_wafandpageurl. Nositekeyneeded.
Change the address to ours and use your DraxonCloud key. See Compatible APIs for formats.
When the captcha keeps coming back
If the site still shows the AWS WAF page after you send the cookie, check these:
- The cookie name. It must be exactly
aws-waf-token, with the value copied as it is. - The domain. Set the cookie for the same site you are visiting. A cookie for
shop.exampleis not sent toother.example. - The proxy. If the solve went through a proxy, your requests should too.
- The page. Send the address of the page that showed the captcha, on the same site you then visit.
- Time. A token doesn’t last forever. When the captcha appears again later, ask for a new one.
A task that ends as failed or expired costs nothing, so trying again is free.
What it costs
You pay for each solved AWS WAF captcha. The live price is in the box at the top of this page and on the pricing page. The price is set aside when you start a task, charged only when you get a token, and returned in full if the task fails or runs out of time. One task, one charge at most.
Tips that save you time
- Reuse the cookie. One
aws-waf-tokencan cover many requests. Solve again only when the captcha comes back. - Use the same proxy for the solve and the requests that follow, if you use a proxy at all.
- Send the exact page you want. A token for the wrong site won’t help.
- Look at the cookie name. If the site sets something other than
aws-waf-token, it may not be AWS WAF. - Use
?wait=30to get the answer in one request. - Retry safely with an
Idempotency-Keyheader, so a repeated request never costs twice.
Code in Python and Node.js, all fields and every error are in the AWS WAF docs.