From f33fa62c715a8171b77460e0d36f48d53f86e55f Mon Sep 17 00:00:00 2001 From: Aaron Johnson Date: Tue, 25 Dec 2018 14:43:04 -0600 Subject: [PATCH] Added DNS timeout (and a commented out ICMP check) --- tab-sorcery.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tab-sorcery.sh b/tab-sorcery.sh index 8da7eb4..8545007 100644 --- a/tab-sorcery.sh +++ b/tab-sorcery.sh @@ -11,6 +11,8 @@ scan_ns=$2 # Static Configuration (Do not edit) dns_time=5 dns_tries=1 +#icmp_fail_text="$(tput bold)Tab Sorcery: $(tput setaf 1)ICMP connection to ${scan_ns} failed!$(tput sgr0)" +dns_fail_text="$(tput bold)Tab Sorcery: $(tput setaf 1)DNS connection to ${scan_ns} failed!$(tput sgr0)" # Check for and set RDP geometry config case "$SORC_GEOM_RDP" in @@ -30,7 +32,14 @@ get_hostip () { host_ip=`echo $zone_xfer | grep $1 | grep A | awk '{print $3}'` } -zone_xfer=`dig $scan_domain @$scan_ns +time=$dns_time +tries=$dns_tries AXFR | egrep -v 'SOA|NS|MX|DiG' | grep $scan_domain | awk '{print $1,$4,$5}'` +##Check network +#if ! ping -c1 -t3 $scan_ns >/dev/null 2>&1 +#then +# echo $icmp_fail_text >&2 +# return 1 +#fi + +zone_xfer=`{dig $scan_domain @$scan_ns +time=$dns_time +tries=$dns_tries AXFR || echo $dns_fail_text >&2} | egrep -v 'SOA|NS|MX|DiG' | grep $scan_domain | awk '{print $1,$4,$5}'` while read host <&3; do user_name=$3 connect_cmd="ssh -t"