Skip to content

AWS WAF

Solve the AWS WAF captcha with the aws_waf type and get the aws-waf-token cookie. Fields, code samples, compatible names and fixes.

Use the aws_waf type when a site protected by AWS WAF shows its captcha. You send the page address. You get the value of the aws-waf-token cookie.

Overview

AWS WAF is Amazon’s web firewall. Sites can make it show a captcha before letting a visitor in. When the captcha is passed, the site sets the aws-waf-token cookie, and requests that carry it get through.

type aws_waf
Needs a site key No
Optional extras proxy
You get solution.token: the aws-waf-token cookie value

Before you start

  1. Create an API key in the dashboard under API keys (starts with drx_) and add funds.
  2. Make sure the site uses AWS WAF:
    • Open the site in your browser and pass the captcha once by hand.
    • Open the developer tools, go to Application (Chrome) or Storage (Firefox), then Cookies.
    • If you see a cookie named aws-waf-token, this is the right type.
  3. Note the address of the page that shows the captcha. That is your website_url.

Request fields

Field Required What to put
type Yes aws_waf
website_url Yes The full address of the page that shows the captcha, starting with https://.
proxy No user:pass@host:port, or with a scheme like http:// or socks5://. Use the same proxy later when you send the cookie.

No site key is needed. Other fields like website_key or rqdata are not used for this type.

Create the task

curl

curl -s -X POST https://draxon.one/api/captcha/v1/tasks \
  -H "Authorization: Bearer $DRAXON_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: account-5531" \
  -d '{
    "type": "aws_waf",
    "website_url": "https://shop.example/account"
  }'

Python

import os
import requests

API = "https://draxon.one/api/captcha/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['DRAXON_KEY']}"}
PAGE = "https://shop.example/account"

task = requests.post(f"{API}/tasks", headers=HEADERS, timeout=30, json={
    "type": "aws_waf",
    "website_url": PAGE,
}).json()

while task["status"] in ("queued", "processing"):
    task = requests.get(f"{API}/tasks/{task['id']}", params={"wait": 30},
                        headers=HEADERS, timeout=60).json()

if task["status"] == "solved":
    session = requests.Session()
    session.cookies.set("aws-waf-token", task["solution"]["token"], domain="shop.example")
    page = session.get(PAGE, timeout=30)
    print(page.status_code)
else:
    print("not solved:", task["error"])

Node.js

const API = "https://draxon.one/api/captcha/v1";
const headers = {
  Authorization: `Bearer ${process.env.DRAXON_KEY}`,
  "Content-Type": "application/json",
};

let task = await (await fetch(`${API}/tasks`, {
  method: "POST",
  headers,
  body: JSON.stringify({ type: "aws_waf", website_url: "https://shop.example/account" }),
})).json();

while (task.status === "queued" || task.status === "processing") {
  task = await (await fetch(`${API}/tasks/${task.id}?wait=30`, { headers })).json();
}

if (task.status === "solved") {
  const page = await fetch("https://shop.example/account", {
    headers: { Cookie: `aws-waf-token=${task.solution.token}` },
  });
  console.log(page.status);
}

Get the result

Use ?wait=30 (0 to 120 seconds) to get the answer in one request.

curl -s -H "Authorization: Bearer $DRAXON_KEY" \
  "https://draxon.one/api/captcha/v1/tasks/<id>?wait=30"

A solved task (cost fields left out):

{
  "id": "5e1c8a2f-7b34-4d90-a6c1-2f8e9d0b3a47",
  "type": "aws_waf",
  "status": "solved",
  "website_host": "shop.example",
  "attempts": 1,
  "created_at": "2026-10-30T10:00:00Z",
  "completed_at": "2026-10-30T10:00:07Z",
  "solution": {
    "token": "a1b2c3d4-e5f6-...:AAoAgQ6Hc4j0AAAA:..."
  },
  "error": null
}

Use the answer

  • Set a cookie named aws-waf-token with the exact value of solution.token, for the site’s domain. Or send it in a Cookie header: aws-waf-token=<value>.
  • If you sent a proxy, send your requests through the same proxy.
  • Reuse the cookie for the following requests. When the site shows the captcha again, create a new task.
  • Don’t change the value. Copy it as it is.

Compatible API names

Change your tool’s address to https://draxon.one/api/captcha/compat and use your DraxonCloud key as the client key.

Service style Name for this type
CapSolver / Anti-Captcha createTask AwsWafTask, AwsWafTaskProxyless, AntiAwsWafTask, AntiAwsWafTaskProxyLess, AmazonTask, AmazonTaskProxyless
2Captcha in.php method=amazon_waf (no sitekey)
curl -s -X POST https://draxon.one/api/captcha/compat/createTask \
  -H "Content-Type: application/json" \
  -d '{
    "clientKey": "'"$DRAXON_KEY"'",
    "task": {
      "type": "AntiAwsWafTaskProxyLess",
      "websiteURL": "https://shop.example/account"
    }
  }'

When getTaskResult says ready, the solution has token, cookie (the same value) and cookies ({"aws-waf-token": "..."}). On 2Captcha, res.php returns the value. See Compatible APIs.

Errors and fixes

When you create a task:

Error What it means What to do
422 validation_error on website_url Not a full http(s):// address, or too long. Send the full page address.
422 validation_error on proxy The proxy string is too long. Send only user:pass@host:port.
422 target_blocked This website is not served. Pick a site you are allowed to automate.
402 insufficient_balance / spend_cap_reached Not enough funds, or the key’s daily limit. Add funds or raise the limit.

When a task ends without a token:

error.code What it means What to do
solve_failed The captcha could not be passed, or the page did not show an AWS WAF captcha. Check the page address and that the site really uses AWS WAF.
provider_timeout It took too long. Try again.
expired Not finished within about 3 minutes. Try again.

Failed and expired tasks cost nothing. The site still shows the captcha with the cookie? Check the cookie name and value, the domain you set it for, and that you used the same proxy. More codes on the errors page.

Price and billing

Each solved AWS WAF captcha costs the price on the pricing page, also in GET /api/captcha/v1/families. Creating a task holds the amount, a solved task is charged, and a failed or expired task is released for free.