#!/bin/bash # Add /usr/share/nmap-services in the script itself (maybe as a blob?) help() { cat </dev/null; echo $?) [[ $ret == 0 ]] && { echo $c >> /tmp/tcp_ports; cg_color olbg "$c "; } } udp_scan(){ ret=$(nc -u -w1 -z $ip $c; echo $?) [[ $ret == 0 ]] && { echo $c >> /tmp/udp_ports; } } fast_ping(){ nn=$(ping -W1 -c1 $ip 1>/dev/null 2>/dev/null; echo $?) [[ $nn == 0 ]] && { echo $ip >> /tmp/ips; } } scan_tcp(){ [[ $1 ]] && { c=$1; ret=$(nc -w1 -z $ip $c 2>/dev/null; echo $?); [[ $ret == 0 ]] && { echo $c >> /tmp/tcp_ports; [[ $RUN_NMAP == true ]] && { command="nmap -Pn --disable-arp-ping -n -sCV -p $(allports=($( Scanning $ip" if [[ $port ]]; then scan_tcp $port; pt /tmp/tcp_ports tcp else pp "TCP ports"; scan_tcp; pt /tmp/tcp_ports tcp fi elif [[ $cidr ]]; then cidr_to_ips $cidr for ip in ${ips[@]}; do echo "--> Scanning $ip" if [[ $port ]]; then scan_tcp $port; pt /tmp/tcp_ports tcp else pp "TCP ports"; scan_tcp; pt /tmp/tcp_ports tcp fi cl done fi