44

I have a bunch of machines on an IP address range which I want to ping simultaneously as a quick and dirty way of telling which ones are switched on. What (free) software can I use to do this?

I'm using Windows Vista.

Jon Cage
  • 2,627

9 Answers9

49

Nmap is available for Windows:

# nmap -sP 10.0.10.1-100
31

The quickest way is to use Angry IP Scanner

alt text

I use it for the same way you want to!

domih
  • 125
William Hilsum
  • 117,648
15

I've used this command

for %%i in 200 to 254 do ping 10.1.1.%%i 

in a batch file for a similar reason

Col
  • 7,043
12

Free IP Scanner 1.6

Here is the range of IP addresses as you can notice in:

Alt text

11

Instead of manually pinging all IP addresses on your LAN you can do the following:

Open a Command Prompt and type:

FOR /L %i IN (1,1,254) DO ping -n 1 192.168.0.%i | FIND /i "Reply">>C:\ipaddresses.txt

-n 1 means that only 1 ping packet will be sent to each computer.

Change 192.168.0 to match you own network ID.

This will ping all IP addresses on the 192.168.0.0 network segment and create a text file called ipaddresses.txt in C:\, where it will list only the IP addresses that gave a reply.

You can also add -a to the ping command to resolve all the responding IP addresses to hostnames, but doing so will cause the script to take a considerable time to finish:

FOR /L %i IN (1,1,254) DO ping -a -n 1 192.168.0.%i | FIND /i "Reply">>C:\ipaddresses.txt
Gareth
  • 19,080
6

try fping

akira
  • 63,447
4

You could just write a Bash script that loops through an IP address range and pings them. An example that pings addresses in the range 10.1.1.1 to 10.1.1.255 (inclusive):

for i in {100..255}
do
    ping 10.1.1.$i
done
Lekensteyn
  • 6,982
kylex
  • 605
3

Save the below script on the server with an extension of .bat or .cmd and call the file from the command prompt. It should prompt you to enter the IP address range.

Please enter only three octets of the IP address.


@echo off

SET count=0
SET /p subnet=Please enter IP address range (for example, 192.168.0)

:start
SET /a count=%count%+1

cls
ECHO. & ECHO Trying %subnet%.%count% & ECHO.

ping -n 1 -w 1000 %subnet%.%count% >nul  
IF %errorlevel%==0 echo %subnet%.%count% UP >> c:\pingnet.log  
IF %errorlevel%==1 echo %subnet%.%count% DOWN >> c:\pingnet.log

IF %count%==254 goto :eof

GOTO start

Once the command has run, it will create a text file name pingnet.log in the root of C drive. That file should give you a list of used and down (free) IP addresses.

For example:

10.2.214.1 UP   
10.2.214.2 UP   
10.2.214.3 UP   
10.2.214.4 DOWN 

It is pretty simple to run, and it should save you loads of time.

GSA
  • 31
3

Angry IP Scanner is great, but I prefer CLI tools. See if you can get this powershell script running in Vista. https://github.com/webstersprodigy/PowerSploit/blob/Portscan/Recon/Invoke-Portscan.ps1

I also suggest getting access to a Linux CLI by using a linux live cd/usb, dual boot, or a vm in VirtualBox. (Install VirtualBox, add a new vm, install Debian.) A linux CLI is invaluable.

From a linux CLI, run the following:

PING Based Scan

for ip in 172.10.1.{1..254}; do ping -c 1 -w 1 $ip > /dev/null && echo $ip "$(nslookup $ip | grep 'name = ' | awk -F ' = ' '{print $2}')"; done

Adjust for your network range (the '172.10.1' part,) and you're off. This will provide a list of all hosts on the network that respond to ICMP echo (ping) requests, and resolve them against your DNS server.

Note: This is not the most reliable way to test for live hosts as they may have ICMP blocked.

nmap Based Scan

nmap -sP 192.168.1.0/24

Note: Nmap is more reliable as it is a port scanner and bases its results on the activity on more than just ICMP responses. It's heavily used by pentesters and is worth learning.