githubEdit

Host scan (Linux)

for i in {1..254} ; do (ping -c 1 172.16.5.$i |grep 'bytes from' &) ;done
for i in $(seq 1 254); do (ping -c 1 172.19.0.$i | grep "bytes from" | cut -d':' -f1 | cut -d' ' -f4 &); done
for i in $(seq 1 255); do (ping 172.16.5."$i" -c 1) &>/dev/null; done |grep 'bytes from'

Port scan

export ip=172.16.8.50; for port in $(seq 1 65535); do timeout 0.01 bash -c "</dev/tcp/$ip/$port && echo $ip':'$port || echo Port:  $port is closed > /dev/null" 2>/dev/null || echo Connection Timeout > /dev/null; done

Last updated