diff --git a/portradar.sh b/portradar.sh index c84efc7..f45457a 100755 --- a/portradar.sh +++ b/portradar.sh @@ -75,16 +75,14 @@ fast_ping(){ } scan_tcp(){ - [[ $1 ]] && { [[ $1 =~ ^[0-9]+$ ]] && { c=$1; ret=$(nc -zn -w2 $ip $c >/dev/null 2>&1; echo $?); [[ $ret == 0 ]] && echo $c >> /tmp/tcp_ports; } || { ports=${1//,/ }; for c in ${ports[@]}; do ret=$(nc -zn -w2 $ip $c >/dev/null 2>&1; echo $?); [[ $ret == 0 ]] && echo $c >> /tmp/tcp_ports; done; }; [[ -f /tmp/tcp_ports ]] && { [[ $RUN_NMAP == true ]] && { command="nmap -Pn -n -sCV -p $(allports=($(/dev/null 2>&1; echo $?); [[ $ret == 0 ]] && echo $c >> /tmp/tcp_ports; } || { for c in ${mports[@]}; do ret=$(nc -zn -w2 $ip $c >/dev/null 2>&1; echo $?); [[ $ret == 0 ]] && echo $c >> /tmp/tcp_ports; done; }; [[ -f /tmp/tcp_ports ]] && { [[ $RUN_NMAP == true ]] && { command="nmap -Pn -n -sCV -p $(allports=($(