April 23, 201412 yr Trying to discover hosts in a subnet from a linux box and here is what I came up with so far Using a BASH script: subnet=192.168.2.addr=1while [ $addr -lt 256 ]; doping -c 1 -t 1 $subnet$addr > /dev/null && echo Found $subnet$addrlet addr=addr+1done OR this script may work better subnet=192.168.2.for addr in `seq 1 1 255 `; do( ping -c 1 -t 1 $subnet$addr > /dev/null && echo Found $subnet$addr ) &done OR even ping the broadcast address like this ping -b 192.168.2.255 OR use arp-scan (if loaded) sudo arp-scan -I eth0 192.168.2.0/24 OR utilize nmap (one of my favorite discovery tools) nmap -v -sP 192.168.0.0/16 10.0.0.0/8 OR even another script FOR /L %i IN (1,1,254) DO ping -n 1 10.254.254.%i | FIND /i “Reply”>> ipaddresses.txt
Create an account or sign in to comment