From d91f44c287e80afc911190a4e82a8dfed367f167 Mon Sep 17 00:00:00 2001 From: remittor Date: Sat, 17 Jan 2026 14:59:25 +0300 Subject: [PATCH] diag: dwc: Add detect JS-challenge --- zapret/dwc.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/zapret/dwc.sh b/zapret/dwc.sh index a8a8aa3..3a267db 100644 --- a/zapret/dwc.sh +++ b/zapret/dwc.sh @@ -204,9 +204,15 @@ printf '%s\n' "$ZAP_TMP_DIR"/*.log | sort | while IFS= read -r file; do res=100 fi fi + if [ $res -lt 100 ] && [ -f "$FNAME.hdr" ] && [ $BODY_SIZE -eq 0 ]; then + if grep -q 'x-amzn-waf-action: challenge' "$FNAME.hdr"; then + status="WARN: tested site required JS-challenge" + res=999 + fi + fi printf '%12s / %-15s / %-13s: %s \n' "$TAG" "$IPADDR" "$PROVIDER" "$status" echo "$BODY_SIZE" > "$FNAME.size" - if [ $res != 100 ]; then + if [ $res -lt 100 ]; then URL=$( cat "$FNAME.url" ) echo "$FILENAME : $URL" >> "$FAIL_URL_LIST" fi