yellow up
yellow up

Reputation: 21

How to get an application listening ports with windows c++ api

As show in Windows Resource Monitor:

image

I want to analyse network traffic of an application, but I dont know the Windows API. I used scapy or wireshark, but I don't know what data packages are this application.

So, I want to get the listening port first. But I don't know the API.

Upvotes: 2

Views: 1396

Answers (1)

Remy Lebeau
Remy Lebeau

Reputation: 598134

You can use GetTcpTable2() or GetExtendedTcpTable() to enumerate open TCP ports, determining which ports are listeners, and get each one's owning process.

You can use GetExtendedUdpTable() to enumerate open UDP ports and get each one's owning process.

Upvotes: 2

Related Questions