BLOGGER TEMPLATES AND TWITTER BACKGROUNDS »

Tuesday, 19 March 2013

Script to find live IP addresses on your network


Sometimes it can be the simplest of things which are the hardest to do. An example is finding details of IP address allocation and usage on the network.

This command will ping all addresses in your class C network from .1 to .254 and display the result of the ping if the address responds:

C:\>for /L %a in (1,1,254) do @ping -n 1 192.168.3.%a|find "TTL"
Reply from 192.168.3.1: bytes=32 time<1ms TTL=128
Reply from 192.168.3.3: bytes=32 time<1ms TTL=128
Reply from 192.168.3.4: bytes=32 time<1ms TTL=128
Reply from 192.168.3.9: bytes=32 time<1ms TTL=64
Reply from 192.168.3.17: bytes=32 time=2ms TTL=128
Reply from 192.168.3.22: bytes=32 time=2ms TTL=12
Reply from 192.168.3.27: bytes=32 time=2ms TTL=128
Reply from 192.168.3.41: bytes=32 time=1ms TTL=128


As you can see, this has picked up some addresses which we didn't see in the ARP list.

The command is actually sending a single ping to each address in the range but only displaying those which respond as being 'alive'.

0 comments: