AWS WAF Captcha Image Solving
Solve Amazon Web Services WAF (Web Application Firewall) captcha challenges. AWS WAF uses image-based verification for bot detection and DDoS protection with 99.3% accuracy.
Amazon Web Services Web Application Firewall (AWS WAF) provides advanced protection against web exploits and bots. AWS WAF captcha challenges typically require users to identify specific objects or patterns in images to prove they are human. Our API processes these challenges automatically and returns the required verification responses.
Captcha Type
Use the following captcha type identifier in your API requests:
"type": "AWSWAF_IMAGE"
Request Format
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
captcha.type |
string | required | Must be "AWSWAF_IMAGE" |
captcha.metadata.siteUrl |
string | required | URL where AWS WAF captcha appears |
captcha.payload.images |
array | required | Array of base64-encoded images (typically 6 images) |
captcha.payload.questionType |
string | required | Captcha type: "grid" or "coordinate" |
captcha.payload.question |
string | required | Challenge question text |
Example Request
const response = await fetch('https://solver-api.mydisct.com/createTask', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'apikey': 'YOUR_API_KEY'
},
body: JSON.stringify({
auth: { token: 'YOUR_API_KEY' },
context: { source: 'api', version: '1.0.0' },
captcha: {
type: 'AWSWAF_IMAGE',
metadata: {
siteUrl: 'https://example.com'
},
payload: {
images: [
'image_1_base64',
'image_2_base64',
'image_3_base64',
'image_4_base64',
'image_5_base64',
'image_6_base64'
],
questionType: 'grid',
question: 'Select all images containing a cat'
}
}
})
});
Response Format
Create Task Response
{
"success": true,
"service": "MyDisct Solver",
"message": "Captcha is being processed",
"task": {
"id": "MyDisctSolver_abc123",
"status": "processing"
}
}
Fetch Result Response (Processing)
{
"success": true,
"service": "MyDisct Solver",
"message": "Captcha is being processed",
"task": {
"id": "MyDisctSolver_abc123",
"status": "processing"
}
}
Fetch Result Response (Completed)
{
"success": true,
"service": "MyDisct Solver",
"message": "Captcha solved successfully",
"task": {
"id": "MyDisctSolver_abc123",
"status": "completed",
"result": {
"answers": [0, 2, 5],
"timestamp": "2025-11-05T12:34:56.789Z"
}
}
}
Python Example
import requests
import time
def solve_aws_waf(images, question, site_url, api_key):
create_response = requests.post(
'https://solver-api.mydisct.com/createTask',
headers={'Content-Type': 'application/json', 'apikey': api_key},
json={
'auth': {'token': api_key},
'context': {'source': 'api', 'version': '1.0.0'},
'captcha': {
'type': 'AWSWAF_IMAGE',
'metadata': {'siteUrl': site_url},
'payload': {
'images': images,
'questionType': 'grid',
'question': question
}
}
}
)
create_data = create_response.json()
if not create_data['success']:
raise Exception(create_data['error']['message'])
task_id = create_data['task']['id']
while True:
time.sleep(3)
result_response = requests.post(
'https://solver-api.mydisct.com/fetchResult',
headers={'Content-Type': 'application/json', 'apikey': api_key},
json={'taskId': task_id}
)
result_data = result_response.json()
if result_data['task']['status'] == 'completed':
return result_data['task']['result']['answers']
elif result_data['task']['status'] == 'failed':
raise Exception('Captcha solving failed')
solution = solve_aws_waf(
images=['img1', 'img2', 'img3', 'img4', 'img5', 'img6'],
question='Select all images containing a cat',
site_url='https://example.com',
api_key='YOUR_API_KEY'
)
print(f'Selected indices: {solution}')
Implementation Guide
Step 1: Extract AWS WAF Images
AWS WAF captchas appear when accessing protected resources. Extract the images from the challenge:
// Extract AWS WAF captcha data
function extractAWSWAFData() {
const imageElements = document.querySelectorAll('.aws-waf-captcha-image img') ||
document.querySelectorAll('[data-testid*="captcha"] img');
const images = [];
const question = document.querySelector('.aws-waf-captcha-question')?.textContent ||
document.querySelector('.captcha-instruction')?.textContent || '';
let questionType = 'grid'; // default
if (document.querySelector('canvas') && !document.querySelectorAll('button').length) {
questionType = 'coordinate'; // Toycarcity style captcha
}
for (const img of imageElements) {
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
canvas.width = img.naturalWidth;
canvas.height = img.naturalHeight;
ctx.drawImage(img, 0, 0);
const base64 = canvas.toDataURL('image/png').split(',')[1];
images.push(base64);
}
return { question, questionType, images };
}
Step 2: Submit to API
async function solveAWSWAF(siteUrl) {
const { question, questionType, images } = extractAWSWAFData();
const response = await fetch('https://solver-api.mydisct.com/createTask', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'apikey': 'YOUR_API_KEY'
},
body: JSON.stringify({
auth: { token: 'YOUR_API_KEY' },
context: { source: 'api', version: '1.0.0' },
captcha: {
type: 'AWSWAF_IMAGE',
metadata: { siteUrl },
payload: {
images: images,
questionType: questionType,
question: question
}
}
})
});
const data = await response.json();
if (!data.success) {
throw new Error(data.error.message);
}
const taskId = data.task.id;
while (true) {
await new Promise(resolve => setTimeout(resolve, 3000));
const resultResponse = await fetch('https://solver-api.mydisct.com/fetchResult', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'apikey': 'YOUR_API_KEY'
},
body: JSON.stringify({ taskId })
});
const resultData = await resultResponse.json();
if (resultData.task.status === 'completed') {
return resultData.task.result.answers;
} else if (resultData.task.status === 'failed') {
throw new Error('AWS WAF solving failed');
}
}
}
const solution = await solveAWSWAF('https://protected-site.com');
console.log('Selected indices:', solution);
Best Practices
- Specify questionType as "grid" for grid selection or "coordinate" for coordinate clicking
- Typically 6 images in grid challenges, 1 image in coordinate challenges
- Include exact question text
- AWS WAF has special format requirements
Common Issues
Solution: Ensure images are properly base64-encoded and in the correct order. AWS WAF typically shows 6 images in a grid.
Solution: AWS WAF may block requests from certain IPs or regions. Consider using proxies or different IP addresses.
Solution: Ensure you use "grid" for grid selection captchas and "coordinate" for coordinate clicking captchas. Check if the captcha has clickable buttons (grid) or requires canvas clicking (coordinate).
Solution: AWS WAF interface may change. Monitor for updates in CSS selectors and DOM structure.