13

I need a simple utility that allow me to check if a PC, attached to a local network, is able to reach a specified address:port using specified protocol like TCP or UDP

Machine's OS I will use to do the check is Windows XP.

1
  • You should check our psexec from Microsoft Sysinternals. It will allow you to run a process on a given computer using given credentials. Oct 31, 2014 at 16:18

3 Answers 3

12

Use simply telnet:

telnet hostname port

If you get a connection, something replies on that port.

If you get an error message, no program is listening on that port, or the hostname is invalid:

Connecting To hostname...Could not open connection to the 
host, on port <port>: Connect failed
4
  • +1, telnet or the allmighty netcat (nc), but you have to grab that from "somewhere", so telnet is just fine.
    – akira
    Apr 8, 2010 at 12:01
  • 1
    @snark which protocol is used to do this test? TCP, UDP or other?
    – Drake
    Apr 8, 2010 at 12:28
  • TCP is used, as telnet establishes a connection. UDP is connectionless so you cannot tell if someone is listening or not.
    – Snark
    Apr 8, 2010 at 13:08
  • thanks. So there is no way to use a tool to check if UDP is allowed in output on a certain port? Only using the desired application and see it is working?
    – Drake
    Apr 8, 2010 at 15:40
3

You can use iperf to check if UDP ports are reachable or not.

Example: Testing if port 5093 UDP is open on remote server 10.0.0.1

C:\>iperf -u -p 5093 -c 10.0.0.1
------------------------------------------------------------
Client connecting to 10.0.0.1, UDP port 5093
Sending 1470 byte datagrams
UDP buffer size: 8.00 KByte (default)
------------------------------------------------------------
[320] local 10.16.61.182 port 54574 connected with 10.0.0.1 port 5093
[ ID] Interval       Transfer     Bandwidth
[320]  0.0-10.0 sec  1.25 MBytes  1.05 Mbits/sec
[320] **Sent 893 datagrams**

As you can see the client successfully transferred 893 datagrams meaning the port is open indeed. In case the firewall was blocking the port, you should read a message like this:

Read failed: Connection reset by peer
2

nmap should be able to handle this.

1
  • 4
    if you could provide an example along with this suggestion, that would be great. Maybe something like this would work: nmap -v IP_ADDRESS -Pn -p PORT
    – Chris
    Mar 27, 2016 at 3:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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