nmap check openport



scan port in a subnet
> nmap -p139,445,22,3389 -P0 -sS 192.168.$i.0/24 > /tmp/w/$i
 -p (post lists)
-sS (tcp sync scan,half-open scan)
-sT (Tcp connect scan)
-P0 (switch off icmp pings)

make a script to execute in subnets
> [root@localhost ~]# cat /opt/n.sh
ipr=(10 11 12 13 15 16 17 18 19)
for i in "${ipr[@]}"
do
#echo $i
nmap -p139,445,22,3389 -P0 -sS 192.168.$i.0/24 > /tmp/nmap/$i
done

留言

熱門文章