added a --pointers flag, pure bliss

This commit is contained in:
jc
2025-05-26 23:53:01 +03:00
parent cfb1e77e53
commit e21e152d71
+7 -1
View File
@@ -13,6 +13,7 @@ options:
--open only print hosts with atleast one open port --open only print hosts with atleast one open port
--hosts only print live hosts in the subnet --hosts only print live hosts in the subnet
--force scan open ports even if ping is disabled --force scan open ports even if ping is disabled
--pointers only scan key ports
SYNTAX SYNTAX
exit exit
} }
@@ -38,7 +39,7 @@ ir(){
pt(){ pt(){
file=$1 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 [[ $RUN_NMAP == true ]] && return
ports=($(sort -n $file)) ports=($(sort -n $file))
prot=$2 prot=$2
@@ -201,6 +202,7 @@ RUN_NMAP=false
HOST_SCAN=false HOST_SCAN=false
PRINT_OPEN=false PRINT_OPEN=false
FORCE=false FORCE=false
POINTERS=false
while [ "$1" != "" ]; do while [ "$1" != "" ]; do
case $1 in case $1 in
-p | --port) -p | --port)
@@ -226,6 +228,9 @@ while [ "$1" != "" ]; do
--force) --force)
FORCE=true FORCE=true
;; ;;
--pointers)
POINTERS=true
;;
*) *)
if [[ $1 =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then if [[ $1 =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
ip=$1 ip=$1
@@ -257,6 +262,7 @@ if [[ $ip ]]; then
fi fi
elif [[ $cidr ]]; then elif [[ $cidr ]]; then
cidr_to_ips $cidr cidr_to_ips $cidr
[[ $POINTERS == true ]] && { a=${!keyports[@]}; mports=${a// /,}; }
for ip in ${ips[@]}; do for ip in ${ips[@]}; do
echo "--> Scanning $ip" echo "--> Scanning $ip"
if [[ $port ]]; then if [[ $port ]]; then