Netcat Portscanner

Aus xinux.net
Zur Navigation springen Zur Suche springen

with netcat

  • nc -zv 10.11.12.3 20-81
10.11.12.3 [10.11.12.3] 80 (http) open
10.11.12.3 [10.11.12.3] 53 (domain) open
10.11.12.3 [10.11.12.3] 25 (smtp) open
10.11.12.3 [10.11.12.3] 21 (ftp) open

script with netcat

#!/bin/bash
test $# -eq "3" || { echo "usage: $0 IP PORTSTART PORTEND" ; exit 1 ;}
for ((x=$2;x<=$3;x++))
do
nc -w 1 -z  $1 $x && echo "$x open"
done