Jump to content
Aerosol

PortQry - troubleshooting TCP/IP network connectivity

Recommended Posts

Posted

PortQry is a simple command-line utility that can be used to find out status of TCP and UDP ports of a network resource and to troubleshoot TCP/IP connectivity issues. It runs on Windows operating systems and can be downloaded from Microsoft Download Center on Microsoft's support site. The advantage that PortQry has while testing ports state is that support UDP-based services. Other simple tools like Telnet Client do not support this functionality. Sysadmins often use it for getting reports on opened ports in computer networks. It reports the status of a TCP/IP port which can be in Listening, Not Listening, or Filtered state:

Listening status is generated when PortQry receives response from the queried port. It means that process is listening at that port on the queried server.

Not Listening status means that no process is listening on the target port at the queired system.

Filtered status gets generated when the port on the computer that we're querying is filtered. This is usually means that port is blocked by some kind of firewall, which can be very useful information. Portqry do not receive a response from such port and but process on it may or may not be listening.

Usage - querying opend TCP and UDP ports

PortQry is executable, a so after downloading and unpacking, it's ready for use. To use it, simply enter command prompt by going to Start > run > and enter "cmd":

run_cmd.jpg

Once in command promt, navigate to PortQry directory from where You can start using portqry command:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\John>cd \PortQryV2

C:\PortQryV2>

To query single HTTP port on host ittutorials.org, we can use following syntax:

C:\PortQryV2> portqry -n ittutorials.org -p tcp -e 80
Querying target system called:
ittutorials.org
Attempting to resolve name to IP address...
Name resolved to 64.37.52.52
querying...

TCP port 80 (http service): LISTENING

(Switch -n indicates host that we're querying, -p indicates TCP or UDP protocol, and -e says to portqry to query exactely this single port.)

Example of querying single port 22 (SSH) on host 192.168.10.20:

C:\PortQryV2> portqry -n 192.168.10.200 -p tcp -e 22
Querying target system called:
192.168.10.200
Attempting to resolve IP address to a name...
Failed to resolve IP address to name
querying...

TCP port 22 (ssh service): LISTENING

Example of querying single UDP port 53 (DNS) on host 192.168.10.20:

C:\PortQryV2> portqry -n ittutorials.org -p udp -e 53
Querying target system called:
ittutorials.org
Attempting to resolve name to IP address...

Name resolved to 64.37.52.52
querying...

UDP port 53 (domain service): LISTENING or FILTERED
Sending DNS query to UDP port 53...
DNS query timed out

Queryin a range of ports

PortQry also lets You to query a range of ports. The folowing command tries to query a range of TCP ports (-r option indicates "range". In this case from 21 to 24):

C:\PortQryV2> portqry -n ittutorials.org -p tcp -r 20:24
Querying target system called:
ittutorials.org
Attempting to resolve name to IP address...

Name resolved to 64.37.52.52
querying...

TCP port 20 (ftp-data service): NOT LISTENING
TCP port 21 (ftp service): LISTENING

Data returned from port:
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 2 of 50 allowed.
220-Local time is now 07:47. Server?1@
port: 21.
220-This is a private system - No anonymous login
220-IPv6 connections are also welcome on this server.
220 You will be discon?1@

TCP port 22 (ssh service): NOT LISTENING
TCP port 23 (telnet service): FILTERED
TCP port 24 (unknown service): FILTERED

C:\PortQryV2>

The following command queries the specified range of UDP ports (135-138). Once finished, command creates a log file (opened_ports.txt) that contains a log of opened/filtered ports that you jus queried:

C:\PortQryV2> portqry -n 192.168.10.200 -p udp -r 135:138 -l opened_ports.txt
Creating log file called opened_ports.txt
Querying target system called:
192.168.10.200

Attempting to resolve IP address to a name...
Failed to resolve IP address to name
querying...

UDP port 135 (epmap service): LISTENING or FILTERED
UDP port 136 (unknown service): LISTENING or FILTERED
UDP port 137 (netbios-ns service): LISTENING or FILTERED
UDP port 138 (netbios-dgm service): LISTENING or FILTERED

Log file opened_ports.txt successfully created in current directory

C:\PortQryV2>

Source

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...