Skip to content

Commit 6247d62

Browse files
Merge pull request #495 from MortezaBashsiz/bash-dev
Validate fronting checking returned content
2 parents 88a61be + c6f56fc commit 6247d62

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

bash/cfScanner.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ function fncCheckIPList {
218218
fi
219219
if $timeoutCommand 1 bash -c "</dev/tcp/$ip/443" > /dev/null 2>&1;
220220
then
221-
domainFronting=$($timeoutCommand 1 curl -k -s -w "%{http_code}\n" --tlsv1.2 -H "Host: speed.cloudflare.com" --resolve "speed.cloudflare.com:443:$ip" "https://speed.cloudflare.com/__down?bytes=1000" -o /dev/null)
222-
if [[ "$domainFronting" == "200" ]]
221+
domainFronting=$($timeoutCommand 1 curl -k -s --tlsv1.2 -H "Host: speed.cloudflare.com" --resolve "speed.cloudflare.com:443:$ip" "https://speed.cloudflare.com/__down?bytes=10")
222+
if [[ "$domainFronting" == "0000000000" ]]
223223
then
224224
mainDomain=$(echo "$configHost" | awk -F '.' '{ print $2"."$3}')
225225
if [[ "$osVersion" == "Linux" ]]
@@ -373,8 +373,8 @@ function fncCheckIPList {
373373
fi
374374
if $timeoutCommand 1 bash -c "</dev/tcp/$ip/443" > /dev/null 2>&1;
375375
then
376-
domainFronting=$($timeoutCommand 1 curl -k -s -w "%{http_code}\n" --tlsv1.2 -H "Host: speed.cloudflare.com" --resolve "speed.cloudflare.com:443:$ip" "https://speed.cloudflare.com/__down?bytes=1000" -o /dev/null)
377-
if [[ "$domainFronting" == "200" ]]
376+
domainFronting=$($timeoutCommand 1 curl -k -s --tlsv1.2 -H "Host: speed.cloudflare.com" --resolve "speed.cloudflare.com:443:$ip" "https://speed.cloudflare.com/__down?bytes=10")
377+
if [[ "$domainFronting" == "0000000000" ]]
378378
then
379379
downTotalTime=0
380380
upTotalTime=0

0 commit comments

Comments
 (0)