39
10
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.
39
10
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.
28
1That's so good! :D +1 – BloodPhilia – 2010-06-23T19:54:51.727
Worth mentioning that this is Open Source and the source code is hosted on Github
– Drew Chapin – 2018-05-09T14:40:57.0834It is free? I have been using it for years. – William Hilsum – 2009-09-23T16:01:40.213
2Er.. yes it is? – Jon Cage – 2009-09-23T16:03:01.350
This sets off some Antivirus signatures for "Potentially Unwanted Program". I suggest using NirSoft's PingInfoView instead.
– Iszi – 2012-09-05T17:31:33.100@iszi False positive... I still think this is the best program for the job. – William Hilsum – 2012-09-05T23:26:02.210
@WilliamHilsum Perhaps AngryIP is the better program, but NirSoft is corporate AV friendly. Important for when you don't get to control the AV's whitelist. – Iszi – 2012-09-05T23:47:20.127
@iszi - sort of surprising since so many of their tools do get picked up! That is a good point, however a quick note to people who see this here - I just tried using it, and, I do like it... for one or two IPs, but, for example at work, I need to quickly scan entire subnets - I can do this with just 3 clicks on angry IP, I couldn't see a way to do that on here. – William Hilsum – 2012-09-06T21:32:18.533
@WilliamHilsum Yeah, that is one downfall of PingInfoView I'm hoping Nir will fix some time. The feature is available in some of his other tools, like FastResolver. The only NirSoft tools I've had problems with in regards to AV are those which are related to password cracking/recovery. – Iszi – 2012-09-06T22:00:56.860
40
Nmap is available for Windows:
# nmap -sP 10.0.10.1-100
on some newer versions of nmap, this is -sn
to run a "no port scan", just looking for hosts. – Hartley Brody – 2017-09-23T15:50:34.957
4nmap is absolutely a great piece of software – Prabhu R – 2009-09-24T04:06:45.617
13
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
5are you sure it does a simultaneous ping? or is it one machine after another! – Vineet Menon – 2011-11-29T10:52:10.007
1agreed, not simultaneous – hpavc – 2013-08-02T14:02:58.963
You're right it's sequential rather than simultaneous – Col – 2013-08-23T08:33:09.230
12
8
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
This still pings them one at a time though doesn't it? Angry IP scanner pings all IP's in the subnet at once by launching multiple threads so it takes very little time to complete a whole scan. – Jon Cage – 2010-04-12T08:38:50.867
Works very well in situations where no external program can be installed on the machine, and/or only a text console is available. The only caveat for international users is that the "Reply" string must be changed to whatever the local version of ping is using. Thanks for sharing! – Alberto M – 2019-02-01T12:55:58.657
6
try fping
It's available on brew for OSX too (incase anyone surfed from Google and missed Windows in the title.) – Ross – 2014-08-04T18:44:07.973
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
I belive you will need to pass the "-c" flag. Something like "ping -c1 192.168.1.1". otherwise, you will be stuck fora while. – zee – 2018-08-27T02:04:49.107
I think that "500" wants to be 255 or less? – David Mackintosh – 2009-09-24T02:41:38.783
1also not simultaneous – hpavc – 2013-08-02T14:03:18.323
2And I think ping 10.1.1.i
probably wants to be ping 10.1.1.$i
. – Adam Luchjenbroers – 2010-01-04T06:14:51.890
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.
1This is actually pretty slow compared to angry IP scanner as it does them one at a time. Unless most of the IP range is used, you'd have to wait minutes for this approach to give you an answer. – Jon Cage – 2011-12-14T07:25:48.700
2
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:
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 -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.
there's a slight chance this might trip off some kind of security. It might be a better bet to have the machines set to ping a central server at certain intervals, or check at the router. – Journeyman Geek – 2011-05-20T00:43:46.953
2I tried angry ip scanner and free ip scanner and angry seems faster after increasing it's maximum thread count to the range of IPs I was after. – Jon Cage – 2009-09-24T07:59:05.473