From e21e152d71f730cb0b628616ebf1ba2acdd43ec8 Mon Sep 17 00:00:00 2001 From: jc Date: Mon, 26 May 2025 23:53:01 +0300 Subject: [PATCH] added a --pointers flag, pure bliss --- portradar.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/portradar.sh b/portradar.sh index 87cd235..6b0b0d1 100755 --- a/portradar.sh +++ b/portradar.sh @@ -13,6 +13,7 @@ options: --open only print hosts with atleast one open port --hosts only print live hosts in the subnet --force scan open ports even if ping is disabled + --pointers only scan key ports SYNTAX exit } @@ -38,7 +39,7 @@ ir(){ pt(){ file=$1 - [[ ! -f $file ]] && { [[ $port ]] && { [[ ! $PRINT_OPEN == true ]] && cg_color bby "Port $port is closed :(" || { UP='\033[1A'; printf "$UP"; }; } || { [[ ! $PRINT_OPEN == true ]] && cg_color bby "No ports discovered" || { for i in {1..4}; do UP='\033[1A'; printf "$UP"; done; }; }; return; } + [[ ! -f $file ]] && { [[ $port ]] && { [[ ! $PRINT_OPEN == true ]] && cg_color bby "Port $port is closed :(" || { UP='\033[1A'; printf "$UP"; }; } || { [[ ! $PRINT_OPEN == true ]] && cg_color bby "No ports discovered" || { [[ $mports ]] && { UP='\033[1A'; printf "$UP"; return; }; for i in {1..4}; do UP='\033[1A'; printf "$UP"; done; }; }; return; } [[ $RUN_NMAP == true ]] && return ports=($(sort -n $file)) prot=$2 @@ -201,6 +202,7 @@ RUN_NMAP=false HOST_SCAN=false PRINT_OPEN=false FORCE=false +POINTERS=false while [ "$1" != "" ]; do case $1 in -p | --port) @@ -226,6 +228,9 @@ while [ "$1" != "" ]; do --force) FORCE=true ;; + --pointers) + POINTERS=true + ;; *) if [[ $1 =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then ip=$1 @@ -257,6 +262,7 @@ if [[ $ip ]]; then fi elif [[ $cidr ]]; then cidr_to_ips $cidr + [[ $POINTERS == true ]] && { a=${!keyports[@]}; mports=${a// /,}; } for ip in ${ips[@]}; do echo "--> Scanning $ip" if [[ $port ]]; then @@ -269,4 +275,4 @@ elif [[ $cidr ]]; then [[ ($RUN_NMAP == true) && -f /tmp/tcp_ports ]] && echo cl done -fi +fi \ No newline at end of file