export ip=yourip; for port in $(seq 1 65535); do timeout 0.01 bash -c "</dev/tcp/$ip/$port && echo The port $port is open || echo The Port $port is closed > /dev/null" 2>/dev/null || echo Connection Timeout > /dev/null; done
wget https://raw.githubusercontent.com/AlexRandomed/Bash_Port_Scanner/main/scanner.sh -O ./scanner.sh; chmod +x scanner.sh
./scanner.sh IP_ADDRESS NUMBER_OF_PORTS PRECISION
$ ./scanner.sh 192.168.1.254 555 0.05
[!] Scanning of 192.168.1.254 in progress...
Precision is set to 0.05
[+] Port 53 is open
[+] Port 80 is open
[+] Port 443 is open
[-] Scan finished ! : 555 ports scanned