From 598500dce4eff848823c5bed25840696c6d2e70d Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Sat, 9 May 2020 21:41:22 +0200 Subject: [PATCH] add Referer to port check --- lib.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib.sh b/lib.sh index d34846a9..11863d24 100644 --- a/lib.sh +++ b/lib.sh @@ -536,14 +536,14 @@ restart_webserver # Check if port is open # check_open_port 443 domain.example.com check_open_port() { -print_text_in_color "$ICyan" "Checking if port ${1} is open with https://networkappers.com/tools/open-port-checker..." +print_text_in_color "$ICyan" "Checking if port ${1} is open with https://www.networkappers.com/tools/open-port-checker..." install_if_not curl # WAN Adress -if check_command curl -s -H 'Cache-Control: no-cache' "https://networkappers.com/api/port.php?ip=${WANIP4}&port=${1}" | grep -q "open" +if check_command curl -s -H 'Cache-Control: no-cache' -H 'Referer: https://www.networkappers.com/tools/open-port-checker' "https://networkappers.com/api/port.php?ip=${WANIP4}&port=${1}" | grep -q "open" then print_text_in_color "$IGreen" "Port ${1} is open on ${WANIP4}!" # Domain name -elif check_command curl -s -H 'Cache-Control: no-cache' "https://www.networkappers.com/api/port.php?ip=${2}&port=${1}" | grep -q "open" +elif check_command curl -s -H 'Cache-Control: no-cache' -H 'Referer: https://www.networkappers.com/tools/open-port-checker' "https://www.networkappers.com/api/port.php?ip=${2}&port=${1}" | grep -q "open" then print_text_in_color "$IGreen" "Port ${1} is open on ${2}!" else