diff --git a/portradar.sh b/portradar.sh index b55ba23..5ac59c2 100755 --- a/portradar.sh +++ b/portradar.sh @@ -106,13 +106,13 @@ do_ip(){ echo "-> Scanning $ip" if [[ $port ]]; then scan_tcp $port; pt /tmp/tcp_ports tcp - [[ $HTTPX == true ]] && { [[ ${#http_ports[@]} != 0 || ${#https_ports[@]} != 0 ]] && { cg_color bbg "[+] Running httpx"; [[ ${http_ports[@]} ]] && probe="http:${http_ports[@]}" || probe="https:${https_ports[@]}"; echo $ip | ~/go/bin/httpx -silent -fr -sc -td -title -ports $probe 2>/dev/null || echo $ip | ~/.local/share/go/bin/httpx -silent -fr -sc -td -title -ports $probe 2>/dev/null || { cg_color olby "[+] httpx is not installed. Install by running: "; cg_color olbp "go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest"; exit; }; }; } + [[ $HTTPX == true ]] && { [[ ${#http_ports[@]} != 0 || ${#https_ports[@]} != 0 ]] && { cg_color bbg "[+] Running httpx"; [[ ${http_ports[@]} ]] && probe="http:${http_ports[@]}" || probe="https:${https_ports[@]}"; echo $ip | ~/go/bin/httpx -silent -fr -sc -td -title -ports $probe 2>/dev/null || echo $ip | ~/.local/share/go/bin/httpx -silent -fr -sc -td -title -ports $probe 2>/dev/null || { cg_color olby "[+] httpx is not installed. Install by running: "; cg_color bbp "go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest"; exit; }; }; } elif [[ $mports ]]; then scan_tcp $mports; pt /tmp/tcp_ports tcp - [[ $HTTPX == true ]] && { [[ ${#http_ports[@]} != 0 || ${#https_ports[@]} != 0 ]] && { cg_color bbg "[+] Running httpx"; [[ ${http_ports[@]} ]] && { a=${http_ports[@]}; http_ports=${a// /,}; [[ ${https_ports[@]} ]] && { a=${https_ports[@]}; https_ports=${a// /,}; probe="http:$http_ports,https:$https_ports"; } || probe="http:$http_ports"; } || { a=${https_ports[@]}; https_ports=${a// /,}; probe="https:$https_ports"; }; echo $ip | ~/go/bin/httpx -silent -fr -sc -td -title -ports $probe 2>/dev/null || echo $ip | ~/.local/share/go/bin/httpx -silent -fr -sc -td -title -ports $probe 2>/dev/null || { cg_color olby "[+] httpx is not installed. Install by running: "; cg_color olbp "go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest"; exit; }; }; } + [[ $HTTPX == true ]] && { [[ ${#http_ports[@]} != 0 || ${#https_ports[@]} != 0 ]] && { cg_color bbg "[+] Running httpx"; [[ ${http_ports[@]} ]] && { a=${http_ports[@]}; http_ports=${a// /,}; [[ ${https_ports[@]} ]] && { a=${https_ports[@]}; https_ports=${a// /,}; probe="http:$http_ports,https:$https_ports"; } || probe="http:$http_ports"; } || { a=${https_ports[@]}; https_ports=${a// /,}; probe="https:$https_ports"; }; echo $ip | ~/go/bin/httpx -silent -fr -sc -td -title -ports $probe 2>/dev/null || echo $ip | ~/.local/share/go/bin/httpx -silent -fr -sc -td -title -ports $probe 2>/dev/null || { cg_color olby "[+] httpx is not installed. Install by running: "; cg_color bbp "go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest"; exit; }; }; } else pp "TCP ports"; scan_tcp; pt /tmp/tcp_ports tcp - [[ $HTTPX == true ]] && { [[ ${#http_ports[@]} != 0 || ${#https_ports[@]} != 0 ]] && { cg_color bbg "[+] Running httpx"; [[ ${http_ports[@]} ]] && { a=${http_ports[@]}; http_ports=${a// /,}; [[ ${https_ports[@]} ]] && { a=${https_ports[@]}; https_ports=${a// /,}; probe="http:$http_ports,https:$https_ports"; } || probe="http:$http_ports"; } || { a=${https_ports[@]}; https_ports=${a// /,}; probe="https:$https_ports"; }; echo $ip | ~/go/bin/httpx -silent -fr -sc -td -title -ports $probe 2>/dev/null || echo $ip | ~/.local/share/go/bin/httpx -silent -fr -sc -td -title -ports $probe 2>/dev/null || { cg_color olby "[+] httpx is not installed. Install by running: "; cg_color olbp "go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest"; exit; }; }; } + [[ $HTTPX == true ]] && { [[ ${#http_ports[@]} != 0 || ${#https_ports[@]} != 0 ]] && { cg_color bbg "[+] Running httpx"; [[ ${http_ports[@]} ]] && { a=${http_ports[@]}; http_ports=${a// /,}; [[ ${https_ports[@]} ]] && { a=${https_ports[@]}; https_ports=${a// /,}; probe="http:$http_ports,https:$https_ports"; } || probe="http:$http_ports"; } || { a=${https_ports[@]}; https_ports=${a// /,}; probe="https:$https_ports"; }; echo $ip | ~/go/bin/httpx -silent -fr -sc -td -title -ports $probe 2>/dev/null || echo $ip | ~/.local/share/go/bin/httpx -silent -fr -sc -td -title -ports $probe 2>/dev/null || { cg_color olby "[+] httpx is not installed. Install by running: "; cg_color bbp "go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest"; exit; }; }; } fi } @@ -123,13 +123,13 @@ do_cidr(){ echo "-> Scanning $ip" if [[ $port ]]; then scan_tcp $port; pt /tmp/tcp_ports tcp - [[ $HTTPX == true ]] && { [[ ${#http_ports[@]} != 0 || ${#https_ports[@]} != 0 ]] && { cg_color bbg "[+] Running httpx"; [[ ${http_ports[@]} ]] && probe="http:${http_ports[@]}" || probe="https:${https_ports[@]}"; echo $ip | ~/go/bin/httpx -silent -fr -sc -td -title -ports $probe 2>/dev/null || echo $ip | ~/.local/share/go/bin/httpx -silent -fr -sc -td -title -ports $probe 2>/dev/null || { cg_color olby "[+] httpx is not installed. Install by running: "; cg_color olbp "go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest"; exit; }; echo; }; } + [[ $HTTPX == true ]] && { [[ ${#http_ports[@]} != 0 || ${#https_ports[@]} != 0 ]] && { cg_color bbg "[+] Running httpx"; [[ ${http_ports[@]} ]] && probe="http:${http_ports[@]}" || probe="https:${https_ports[@]}"; echo $ip | ~/go/bin/httpx -silent -fr -sc -td -title -ports $probe 2>/dev/null || echo $ip | ~/.local/share/go/bin/httpx -silent -fr -sc -td -title -ports $probe 2>/dev/null || { cg_color olby "[+] httpx is not installed. Install by running: "; cg_color bbp "go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest"; exit; }; echo; }; } elif [[ $mports ]]; then scan_tcp $mports; pt /tmp/tcp_ports tcp - [[ $HTTPX == true ]] && { [[ ${#http_ports[@]} != 0 || ${#https_ports[@]} != 0 ]] && { cg_color bbg "[+] Running httpx"; [[ ${http_ports[@]} ]] && { a=${http_ports[@]}; http_ports=${a// /,}; [[ ${https_ports[@]} ]] && { a=${https_ports[@]}; https_ports=${a// /,}; probe="http:$http_ports,https:$https_ports"; } || probe="http:$http_ports"; } || { a=${https_ports[@]}; https_ports=${a// /,}; probe="https:$https_ports"; }; echo $ip | ~/go/bin/httpx -silent -fr -sc -td -title -ports $probe 2>/dev/null || echo $ip | ~/.local/share/go/bin/httpx -silent -fr -sc -td -title -ports $probe 2>/dev/null || { cg_color olby "[+] httpx is not installed. Install by running: "; cg_color olbp "go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest"; exit; }; echo; }; } + [[ $HTTPX == true ]] && { [[ ${#http_ports[@]} != 0 || ${#https_ports[@]} != 0 ]] && { cg_color bbg "[+] Running httpx"; [[ ${http_ports[@]} ]] && { a=${http_ports[@]}; http_ports=${a// /,}; [[ ${https_ports[@]} ]] && { a=${https_ports[@]}; https_ports=${a// /,}; probe="http:$http_ports,https:$https_ports"; } || probe="http:$http_ports"; } || { a=${https_ports[@]}; https_ports=${a// /,}; probe="https:$https_ports"; }; echo $ip | ~/go/bin/httpx -silent -fr -sc -td -title -ports $probe 2>/dev/null || echo $ip | ~/.local/share/go/bin/httpx -silent -fr -sc -td -title -ports $probe 2>/dev/null || { cg_color olby "[+] httpx is not installed. Install by running: "; cg_color bbp "go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest"; exit; }; echo; }; } else pp "TCP ports"; scan_tcp; pt /tmp/tcp_ports tcp - [[ $HTTPX == true ]] && { [[ ${#http_ports[@]} != 0 || ${#https_ports[@]} != 0 ]] && { cg_color bbg "[+] Running httpx"; [[ ${http_ports[@]} ]] && { a=${http_ports[@]}; http_ports=${a// /,}; [[ ${https_ports[@]} ]] && { a=${https_ports[@]}; https_ports=${a// /,}; probe="http:$http_ports,https:$https_ports"; } || probe="http:$http_ports"; } || { a=${https_ports[@]}; https_ports=${a// /,}; probe="https:$https_ports"; }; echo $ip | ~/go/bin/httpx -silent -fr -sc -td -title -ports $probe 2>/dev/null || echo $ip | ~/.local/share/go/bin/httpx -silent -fr -sc -td -title -ports $probe 2>/dev/null || { cg_color olby "[+] httpx is not installed. Install by running: "; cg_color olbp "go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest"; exit; }; echo; }; } + [[ $HTTPX == true ]] && { [[ ${#http_ports[@]} != 0 || ${#https_ports[@]} != 0 ]] && { cg_color bbg "[+] Running httpx"; [[ ${http_ports[@]} ]] && { a=${http_ports[@]}; http_ports=${a// /,}; [[ ${https_ports[@]} ]] && { a=${https_ports[@]}; https_ports=${a// /,}; probe="http:$http_ports,https:$https_ports"; } || probe="http:$http_ports"; } || { a=${https_ports[@]}; https_ports=${a// /,}; probe="https:$https_ports"; }; echo $ip | ~/go/bin/httpx -silent -fr -sc -td -title -ports $probe 2>/dev/null || echo $ip | ~/.local/share/go/bin/httpx -silent -fr -sc -td -title -ports $probe 2>/dev/null || { cg_color olby "[+] httpx is not installed. Install by running: "; cg_color bbp "go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest"; exit; }; echo; }; } fi [[ ($RUN_NMAP == true) && -f /tmp/tcp_ports ]] && echo http_ports=(); https_ports=() @@ -301,4 +301,4 @@ if [[ $ip ]]; then do_ip elif [[ $cidr ]]; then do_cidr -fi \ No newline at end of file +fi