Jump to content

Network Discovery (from linux)


Recommended Posts

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:

while [ $addr -lt 256 ]; do
ping -c 1 -t 1 $subnet$addr > /dev/null && echo Found $subnet$addr
let addr=addr+1

OR this script may work better

for addr in `seq 1 1 255 `; do
( ping -c 1 -t 1 $subnet$addr > /dev/null && echo Found $subnet$addr ) &

OR even ping the broadcast address like this

ping -b

OR use arp-scan (if loaded)

sudo arp-scan -I eth0

OR utilize nmap (one of my favorite discovery tools)

nmap -v -sP


OR even another script

FOR /L %i IN (1,1,254) DO ping -n 1 10.254.254.%i | FIND /i “Reply”>> ipaddresses.txt

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...