We help IT Professionals succeed at work.

need a way to test if port is open from machine a to machine b

Christopher Schene
Christopher Schene used Ask the Experts™
I need a way of testing whether ports are open between two devices.

I know I can us telnet in some cases, but I want something where I can actually send data from one machine to the other and verify that data.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

There may be others but you can use netstat.  here is what I get on a typical server:

C:\Program Files\Windows Resource Kits\Tools>netstat -ano

Active Connections

  Proto  Local Address          Foreign Address        State           PID
  TCP                 LISTENING       4
  TCP                LISTENING       792
  TCP                LISTENING       4
  TCP               LISTENING       512
  TCP               LISTENING       1572
  TCP               LISTENING       1756
  TCP               LISTENING       5584
  TCP               LISTENING       1432
  TCP               LISTENING       3020
  TCP               LISTENING       904
  TCP              LISTENING       1980
  TCP              LISTENING       4
  TCP              LISTENING       4
  TCP       TIME_WAIT       0
  TCP     ESTABLISHED     512
  TCP       TIME_WAIT       0
  TCP       TIME_WAIT       0
  TCP       ESTABLISHED     512
  TCP     ESTABLISHED     512
  TCP       ESTABLISHED     4
  TCP      ESTABLISHED     3020
  TCP         ESTABLISHED     4
  TCP          ESTABLISHED     4
  TCP              LISTENING       1432
  TCP              LISTENING       1392
  UDP            *:*                                    1832
  UDP            *:*                                    4
  UDP            *:*                                    512
  UDP           *:*                                    1832
  UDP           *:*                                    1848
  UDP           *:*                                    512
  UDP       *:*                                    888
  UDP       *:*                                    4
  UDP       *:*                                    4
  UDP          *:*                                    888
  UDP         *:*                                    512
  UDP         *:*                                    1572
  UDP         *:*                                    452
  UDP         *:*                                    904
  UDP         *:*                                    1756
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

That requires more than the port to be open, it requires a program or driver to listen and respond.  But that is what happens when a port is actually open.  It is not only not blocked but there is also a listener program receiving the data.

For port testing from the internet, you can use Shields Up! https://www.grc.com/x/ne.dll?bh0bkyd2 from GRC.  Or on your LAN, you can use Superscan http://www.mcafee.com/us/downloads/free-tools/index.aspx from McAfee.  Some anti-viruses will consider it a bad program, they generally don't like port scanners.
Top Expert 2013

If you are wanting to test a particular port you might want to use a service such as remote desktop that allows you to change the port. Many services will not do so. You can use the registry change below on the computer to which you want to connect, and then connect using:
mstsc -v:PCname:<port #>
such as
mstsc -v:PCname:5000

To change RDP listening port:Start Registry Editor.
Locate and then click the following registry subkey:
On the Edit menu, click Modify, and then click Decimal.
Type the new port number, and then click OK.
Quit Registry Editor.
Restart the computer.
from: http://support.microsoft.com/kb/306759
Christopher ScheneSystem Engineer/Software Engineer


Thanks all....I need a little bit of time to test out the solutions,

Top Expert 2013

By the way if you want to test if a port is open, most of the above suggestions are far superior to my post http#a36345229 . However you had asked about selecting a specific port and using a service to transfer data over that specific port to manually test. In that case it is a useful option.
Top Expert 2013

1).nmap  -v -sU -sT -sS localhost  - its for local system.
2). nmap -v -sU -sT -sS <remote system ip> - its for remote system.
Christopher ScheneSystem Engineer/Software Engineer


I tried

nmap  -v -sU -sT -sS localhost

on my win7 box and it says that it can't find the nmap command