Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I used to use an application that could ping or maybe run a port scan on a machine even if the machine was configured to not allow it.

I am currently trying to ping a remote machine on our WAN, but I have configured the machine to not allow ping. Is there something similar to ping that I can use?

Again, this a machine located in another city that is part of our wan.

share|improve this question

14 Answers 14

up vote 2 down vote accepted

If your using XP/2003+ (this includes Vista/2008/7), then you can use the Win32_PingStatus. The machines inwhich is running the script code is the only system which needs to be XP/2003+, and it works just like using Ping.exe, only it's not using ping.exe so it should act as a loophole to your security setting which does not allow the execution of ping.exe.

strComputer = ""
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colItems = objWMIService.ExecQuery _
    ("Select * from Win32_PingStatus " & _
        "Where Address = '" & strComputer & "'")
For Each objItem in colItems
    If objItem.StatusCode = 0 Then 
        WScript.Echo "Reply received."          
    End If

See the Scripting Guy article for more info on how to use Win32_PingStatus:

share|improve this answer
My understanding is that the remote host has been configured not to respond to ICMP Echo Request packets, not that ping.exe on the localhost has been disabled. As such this isn't going to do anything different to running ping.exe, which is to say, nothing. – David Pashley Jun 9 '09 at 23:12

You can telnet to an open tcp port on the machine. For instance, if the machine is a web server, and has port 80 open, just:

telnet 80

This will work even on encrypted ports (although you won't be able to understand the data)

Some other ports to try are:

  • 443 for an https server
  • 22 for ssh

(there is a list of ports/services in /etc/services on linux machines)

share|improve this answer

Run an SNMP agent on the remote machine, and use a manager to read one of the values out of the standard MIB.

share|improve this answer

If you have not firewalls and routers in the way, i.e., if you're on the same segment as the host you're trying to check - most of the solutions above are a little exhaustive imho.

It doesn't matter what port you connect to, and in fact, if you connect to a port that's unlikely to have a service running, you can get the job done without being detected.


You can use any tool you like, but we can just use telnet...

% telnet <host> 313373
telnet: connect to address Connection refused
telnet: Unable to connect to remote host

This should happen immediately, unless the host is dropping packets. What's actually happening is that the TCP/IP stack on the host is sending you back a TCP segment with the RST bit set - i.e. terminating your SYN packet.

The fact that you received a RST packet means that there is indeed a host up at the other end, and as a bonus - you've done so undetected (The TCP/IP had no upper-layer application to talk to about this connection).

Rather than telnet however, I'd probably use something like scapy, write up something that looks for the RST flag and let's you know.

Just to complete this, if there is no host on the IP that you try - it will hang for a little while, and the timeout - the same thing that would happen if the receiving host had a firewall with a drop filter.

If firewalls are involved, then as others have suggested, make use of tools such as nmap and whatever else.

share|improve this answer

If you have access to another machine on the same LAN as your target machine, you can use arping.

Arping works by sending ARP packets targeting the machine, this works perfectly because you cannot block arp packets if you want to use the network (well, you can set up static arp tables everywhere :D ) But the downside is you have to be within the same LAN as your arping target.

share|improve this answer

Are there any services available on the machine? One way to see if a machine is there is to use the telnet client to connect to it, but changing the port you need to hit.

So lets say the machine is running MS SQL which runs on port 1433 by default. You use the following command

telnet machine-name-address 1433

If Telnet connects the the machine is up and running, Doesn't mean it's running properly, but listening to that port nonetheless

share|improve this answer

for i in seq 1 65535 ; do tcpconnect -v remotehost $i ; done

share|improve this answer
didn't know about tcpconnect. For the people looking for it: – Server Horror Jun 9 '09 at 22:53

nmap -T5 -sS -P0 That will see what's available port wise on that machine.. Recommend installing cygwin if you are running on windows or don't have access to a linux machine.

share|improve this answer

softperfect network scanner.

google for it.

I use it alot. Works great

share|improve this answer

Google for "nmap". I use this all the time. Great for verifying your firewalls are operating as expected too. Plus I believe it was referenced in a Matrix movie which makes it doubly awesome.

share|improve this answer

You could have the machine send an snmp trap (packet) once a minute to a remote monitor and set up a rule to monitor that you were receiving the trap each minute.

share|improve this answer
This is indeed a good answer and a very correct one. SNMP is low level enough and can be configured on windows systems. Its the only alternative to ICMP and in fact routinely used by network engineers for monitoring routers and systems over WAN and LAN – Vangel Sep 28 '12 at 16:19

You can install a simple web server and use a web page saying "ONLINE". The you only have to connect to it wherever you want Of course you need a statin ip or services linke dyndns

share|improve this answer

A very simple approach is to telnet to a TCP port that should be open on the server, ie:

telnet theServerHostname 80

Although if the service is down you would get the same result as if the host was down.

There are all sorts of scans that can be done with nmap, learn about them on nmap's site and you should become an expert on how to test if a host is up. These include using protocols other than icmp (ping), such as TCP (as telnet does) and UDP.

Also, if you want something that includes the ability to connect to udp, that is similar to telnet in this sense, consider netcat.

share|improve this answer

Microsoft's own PortQry Command Line Port Scanner Version 2.0

I use it to test SQL Server ports often

open port = LISTENING or NOT LISTENING firewall = FILTERED

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.