Click here to Skip to main content
11,647,170 members (69,964 online)
Click here to Skip to main content


, 9 Jun 2004 95.4K 3.5K 41
Rate this:
Please Sign up or sign in to vote.
Enhance netstat and packet filtering.

Sample Image - EnetstatX_img.jpg


This article represents an update to my previous one "Enhance netstat". What's new regarding EnetstatX? It has packet filtering capabilities, sniffing using raw sock (disabled from menu, but could be enabled and extended by developers) and pop-up taskbar notifier concerning incoming and outgoing connections.


What it does and base functionalities?

We have three base functionalities:

  • TCP connection manager
  • UDP connection manager
  • Packet filtering
  • Packet sniffing

How it does it?

  • TCP & UDP connection manager is using the following APIs:
             // Gets extended TCP Connection/UDP Listener Table //
             // ! Note -> imported function from iphlpapi.dll          //
            typedef DWORD (WINAPI *pAllocateAndGetTcpExTableFromStack)(
                 IN OUT PMIB_TCPTABLE_EX *pTcpTableEx, 
                 IN BOOL,
                 IN HANDLE,
                 IN DWORD, 
                 IN DWORD); 
            typedef DWORD (WINAPI *pAllocateAndGetUdpExTableFromStack) (
                 IN OUT PMIB_UDPTABLE_EX *pUdpTableEx , 
                 IN BOOL,
                 IN HANDLE,
                 IN DWORD, 
                 IN DWORD);
            class content: CTCPTable and CUDPClass
  • Packet filtering is using the following APIs (iphlpapi.lib):
             class content: CFilter
  • Packet sniffing is using raw socket capabilities:
             // Create a raw socket 
             socket(AF_INET, SOCK_RAW, IPPROTO_IP);
             // Set sock option
                  (const char *)&rcvtimeo,
             class content: CFilter

How to use it?

Hmmm ... Run it, and there will be no problem. The graphical interface is intuitive, I hope Wink | ;) .

Note: WinXP supported only.


In the final step, I would like to tell you guys that maybe there will be an update to this article regarding design part. I didn't have much time to do it, but if one of you are interested to cooperate or to continue this project, I can give you some ideas, and if necessary all my support. What more can be done? I was thinking that it could be nice to have a "passive OS fingerprinting" module that can detect the OS of connected computers. Another module can be to focus on "report and statistics" with compare capabilities and "what's new about my connection activities" ...




This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Web Developer
Romania Romania
No Biography provided

You may also be interested in...

Comments and Discussions

QuestionAlways 87!!! Pin
eRRaTuM16-Mar-08 4:33
membereRRaTuM16-Mar-08 4:33 
Hi, I'm trying to close connections using SetTcpEntry BUT it always returns 87!! the demo you provide works on my machine...
I can't figure out why
Can u help please? Roll eyes | :rolleyes:
I am using C# 2.0 Blush | :O

:: YOU make history ::

AnswerRe: Always 87!!! Pin
eRRaTuM16-Mar-08 7:15
membereRRaTuM16-Mar-08 7:15 
GeneralPacket capture Pin
Jan Stetka16-May-07 0:29
memberJan Stetka16-May-07 0:29 
GeneralCompilation of project onVS 2005 Pin
chigo5814-Apr-06 5:02
memberchigo5814-Apr-06 5:02 
GeneralRe: Compilation of project onVS 2005 Pin
chigo5814-Apr-06 5:08
memberchigo5814-Apr-06 5:08 
QuestionHow to block and allow the packets so it can act as a firewall Pin
saravanan_vv9-Jun-05 2:57
susssaravanan_vv9-Jun-05 2:57 
QuestionHow to list process and port on window98? Pin
dungbkhn16-May-05 15:57
memberdungbkhn16-May-05 15:57 
AnswerRe: How to list process and port on window98? Pin
y0da17-May-05 19:56
membery0da17-May-05 19:56 
GeneralRe: How to list process and port on window98? Pin
dungbkhn18-May-05 4:57
memberdungbkhn18-May-05 4:57 
Generalsniff grayed Pin
Friedhelm Schuetz11-May-05 22:48
memberFriedhelm Schuetz11-May-05 22:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150804.2 | Last Updated 10 Jun 2004
Article Copyright 2004 by y0da
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid