Bot Demo 1: Result
Success
hello non-bot
You have successfully reached this page.
π Result Analysis
Seeing this page means one of the following:
Regular User
AWS WAF Bot Control classified your request as normal user traffic.
Lucky Bot
Classified as a bot, but fell into the 30% pass-through and received a normal response.
βοΈ CloudFront Function Logic
Actual Implementation
import cf from 'cloudfront';
async function handler(event) {
var request = event.request;
var headers = request.headers;
// isBot: x-amzn-waf-bot-targeted is non-empty (WAF header contract)
var botTargeted = headers['x-amzn-waf-bot-targeted'];
if (botTargeted && botTargeted.value && botTargeted.value.length > 0) {
// 70% probability β route to unreachable Timeout ALB
if (Math.random() < 0.7) {
cf.selectRequestOriginById('timeout-alb');
console.log('routed to timeout origin');
}
}
return request;
}
Bot Detection Mechanisms
- Automation patterns: Puppeteer / Playwright detection
- Behavioral analysis: Abnormal request rate and sequence
- JA4 fingerprint: TLS client signature
- JS Challenge: Browser environment verification (first visit)
π Probability Statistics
~30%
Bots reaching this page
~70%
Bots experiencing timeout
100%
Regular user success rate