Rookie
Rookie

Reputation: 3793

How to track which network ports any program is trying to use?

I want to see what kind of connections any program is doing, which port and see the program exe path etc.

I'm trying to achieve some sort of firewall notification system, it would pop up a window for me to tell that this and that port needs to be opened in order the program could work properly.

How do i get started on this?

Upvotes: 1

Views: 353

Answers (3)

jweyrich
jweyrich

Reputation: 32240

You'll need to hook the socket API for each process you're willing to provide this functionality, or write a filter using WFP and a client application that receive the informations from your filter and shows a notification window.

Upvotes: 1

bobmcn
bobmcn

Reputation: 1184

netstat /o gives you the process id for each network connection, and netstat /b gives you the executable name.

Upvotes: 1

Steve Townsend
Steve Townsend

Reputation: 54148

Check out Windows Filtering Platform (WFP) API. Not sure how you correlate network activity to applications, but this is the correct place for you to intercept it.

Upvotes: 1

Related Questions