Click here to Skip to main content
11,412,578 members (75,082 online)
Click here to Skip to main content

EnetstatX

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

Sample Image - EnetstatX_img.jpg

Introduction

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.

Description

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):
             PfCreateInterface
             PfAddFiltersToInterface
             PfBindInterfaceToIPAddress
             PfUnBindInterface
             PfRemoveFiltersFromInterface
             PfDeleteInterface
    
             class content: CFilter
  • Packet sniffing is using raw socket capabilities:
             // Create a raw socket 
             socket(AF_INET, SOCK_RAW, IPPROTO_IP);
    
             // Set sock option
             setsockopt( 
                  m_hSniffSocket, 
                  SOL_SOCKET,
                  SO_RCVTIMEO,
                  (const char *)&rcvtimeo,
                  sizeof(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.

Conclusion

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" ...

Enjoy!

y0d4

License

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

Share

About the Author

y0da
Web Developer
Romania Romania
No Biography provided

Comments and Discussions

 
QuestionAlways 87!!! Pin
eRRaTuM at 16-Mar-08 5:33
membereRRaTuM16-Mar-08 5:33 
AnswerRe: Always 87!!! Pin
eRRaTuM at 16-Mar-08 8:15
membereRRaTuM16-Mar-08 8:15 
GeneralPacket capture Pin
Jan Stetka at 16-May-07 1:29
memberJan Stetka16-May-07 1:29 
GeneralCompilation of project onVS 2005 Pin
chigo58 at 14-Apr-06 6:02
memberchigo5814-Apr-06 6:02 
GeneralRe: Compilation of project onVS 2005 Pin
chigo58 at 14-Apr-06 6:08
memberchigo5814-Apr-06 6:08 
QuestionHow to block and allow the packets so it can act as a firewall Pin
saravanan_vv at 9-Jun-05 3:57
susssaravanan_vv9-Jun-05 3:57 
QuestionHow to list process and port on window98? Pin
dungbkhn at 16-May-05 16:57
memberdungbkhn16-May-05 16:57 
AnswerRe: How to list process and port on window98? Pin
y0da at 17-May-05 20:56
membery0da17-May-05 20:56 
GeneralRe: How to list process and port on window98? Pin
dungbkhn at 18-May-05 5:57
memberdungbkhn18-May-05 5:57 
Generalsniff grayed Pin
Friedhelm Schuetz at 11-May-05 23:48
memberFriedhelm Schuetz11-May-05 23:48 
GeneralRe: sniff grayed Pin
y0da at 12-May-05 0:18
membery0da12-May-05 0:18 
Generalconnection status Pin
Anonymous at 21-Apr-05 17:50
sussAnonymous21-Apr-05 17:50 
Hi i am wondering how to be notified
immediately that the connection to internet has been lost.
EG cable unplugged within IsNewConnection
Generaladding full path Pin
mervick at 25-Jan-05 20:39
membermervick25-Jan-05 20:39 
QuestionHow to do this work on Win98 Pin
Anonymous at 27-Dec-04 17:01
sussAnonymous27-Dec-04 17:01 
GeneralNo path /res in source Pin
NielsR at 15-Sep-04 5:22
memberNielsR15-Sep-04 5:22 
GeneralRe: No path /res in source Pin
y0da at 15-Sep-04 6:05
membery0da15-Sep-04 6:05 
Generalrunning EnestatX on Win2000 Pin
y0da at 13-Jun-04 22:30
membery0da13-Jun-04 22:30 
GeneralRe: running EnestatX on Win2000 Pin
TaknuMone at 14-Jun-04 3:21
memberTaknuMone14-Jun-04 3:21 
GeneralRe: running EnestatX on Win2000 Pin
feldman_joel at 14-Jun-04 11:19
memberfeldman_joel14-Jun-04 11:19 
GeneralRe: running EnestatX on Win2000 Pin
NielsR at 15-Sep-04 8:15
memberNielsR15-Sep-04 8:15 
GeneralRe: running EnestatX on Win2000 Pin
zcy_beijing at 30-Jun-05 19:12
memberzcy_beijing30-Jun-05 19:12 
GeneralRe: running EnestatX on Win2000 Pin
silencew at 5-Jul-05 9:09
membersilencew5-Jul-05 9:09 
GeneralGot it to compile on w2k but... Pin
TaknuMone at 12-Jun-04 16:29
memberTaknuMone12-Jun-04 16:29 
GeneralI'm waiting to give this a 5, but... Pin
prcarp at 10-Jun-04 11:47
memberprcarp10-Jun-04 11:47 
General... partially fixed Pin
prcarp at 10-Jun-04 12:10
memberprcarp10-Jun-04 12:10 
GeneralRe: I'm waiting to give this a 5, but... Pin
Gabriel 2 at 10-Jun-04 13:35
memberGabriel 210-Jun-04 13:35 
GeneralRe: I'm waiting to give this a 5, but... Pin
Friedhelm Schuetz at 11-May-05 23:45
memberFriedhelm Schuetz11-May-05 23:45 
GeneralRe: I'm waiting to give this a 5, but... Pin
Gabriel 2 at 12-May-05 9:55
memberGabriel 212-May-05 9:55 
GeneralWindows 2000 fix. Pin
Gabriel 2 at 10-Jun-04 8:33
memberGabriel 210-Jun-04 8:33 
GeneralRe: Windows 2000 fix. Pin
dungbkhn at 5-Dec-04 23:42
memberdungbkhn5-Dec-04 23:42 
GeneralRe: Windows 2000 fix. Pin
y0da at 6-Dec-04 2:26
membery0da6-Dec-04 2:26 
GeneralRe: Windows 2000 fix. Pin
y0da at 6-Dec-04 2:29
membery0da6-Dec-04 2:29 

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
Web03 | 2.8.150427.1 | Last Updated 10 Jun 2004
Article Copyright 2004 by y0da
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid