a-python-script
a-python-script

Reputation: 898

How to display the port numbers of open connections for a specific process with tcpvcon.exe (Windows 10)?

I have both TCPView and Tcpvcon on my Windows 10 machine and I wonder how to get all the information (port numbers, etc.) displayed in TCPView in the output of the Tcpvcon program? TCPView has the process name, PID, protocol, remote address, remote port, etc. in its output to the GUI. Tcpvcon, on the other hand, only contains the process name, protocol, remote and local address. I would like to have all information that can be read in the TCPView GUI in the command line output of Tcpvcon (especially the port numbers). Tcpvcon seems to have only the three switches -a -c -n but no matter how I combine them, I do not reach my goal. Can anyone help me?

Below is a sample output when I use all three switches. In TCPView I see much more information about the specified process. enter image description here

Upvotes: 1

Views: 2141

Answers (3)

user275119
user275119

Reputation: 11

Tested with tcpvcon-v2.34 (I couldn't find 2.54) and it shows the ports but it doesn't show the process, all conections appear as from System. Also TCPV6 and UDPV6 are missing.

This is an example:

C:\WINDOWS\system32>"C:\My Program Files\TCPView-v4.13\tcpvcon-v2.34.exe" -a -c
TCP,System,-1,LISTENING,WXP-OR7507156:epmap,WXP-OR7507156:0
TCP,System,-1,LISTENING,WXP-OR7507156:microsoft-ds,WXP-OR7507156:0
TCP,System,-1,LISTENING,WXP-OR7507156:sms-rcinfo,WXP-OR7507156:0
TCP,System,-1,LISTENING,WXP-OR7507156:5040,WXP-OR7507156:0
TCP,System,-1,LISTENING,WXP-OR7507156:wsd,WXP-OR7507156:0
..
UDP,System,-1,,192.168.56.1:137,*:*
UDP,System,-1,,192.168.56.1:138,*:*
UDP,System,-1,,192.168.56.1:2177,*:*
UDP,System,-1,,192.168.56.1:5353,*:*

EDIT: I correct myself. ASB was right. I just got TCPView v2.54 and it does indeed show the application, the ports and also TCPV6 and UDPV6.

So I confirm that the "good" version is v2.54.

Tcpvcon.exe -a -c

TCPView v2.54 - TCP/UDP endpoint viewer
Copyright (C) 1998-2009 Mark Russinovich
Sysinternals - www.sysinternals.com

TCP,dnscrypt-proxy.exe,4188,LISTENING,WXP-XXX:domain,WXP-XXX:0
TCP,[System Process],0,TIME_WAIT,WXP-XXX:domain,localhost:62240
..
UDP,Teams.exe,12632,*,WXP-XXX:58950,*:*
TCPV6,svchost.exe,1232,LISTENING,wxp-XXX:135,wxp-XXX:0
..
UDPV6,svchost.exe,19712,*,wxp-XXX:50836,*:*
UDPV6,System,4,*,wxp-XXX:56736,*:*

Upvotes: 1

ASB
ASB

Reputation: 1

Up until the 2011 release of TCPVCON, it used to show port info.

The newer versions don't any more.

If you could get your hand on version 2.54, you would be able to get port info.

Upvotes: 0

swobi
swobi

Reputation: 105

I was also very surprised that tcpvcon does not show port numbers (maybe we should ask Mark R. to add them ;-)

BUT you could use

netstat -a -o -n

or with an admin shell even

netstat -a -o -n -b

switches meaning:

-a ... Displays all active TCP connections and the TCP and UDP ports 
       on which the computer is listening.

-o ... Displays active TCP connections and includes the process ID (PID)
       for each connection.

-n ... Displays active TCP connections, however, addresses and port numbers 
       are expressed numerically and no attempt is made to determine names.

-b ... Displays the executable involved in creating each connection or 
       listening port. (Note that this option can be time-consuming and 
       will fail unless you have sufficient permissions.)

To get all available switches just use netstat -? (there are other interesting ones) or https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/netstat

swobi

Upvotes: 0

Related Questions