Click here to Skip to main content
Licence 
First Posted 11 Apr 2002
Views 194,876
Bookmarked 66 times

RawSocket Class-Create Network Monitoring (Packet Sniffing) Apps

By | 11 Apr 2002 | Article
A class for creating Network Monitoring Programs

Introduction

This program illustrates the use of the RawSocket class which is written in C#. The class RawSocket is a packet sniffing class that fires notification events when an IP packet is received. This makes using the class simple. Just declare your RawSocket object, instantiate it, and register to be notified when the event fires.

When the event fires, you are sent event arguments which give your program access to everything in the IP packet including things like IP addresses, port numbers, protocols, message lengths, and of course the message contents.

The included Windows form is a simplified example which basically just shows the origination and destination IP addresses for all incoming packets on a listbox control. The Rawsocket class makes creating more sophisticated network monitoring applications easy.

This program relies on Winsock 2 and runs only on Win2000 or WinXP.

Please email comments and improvements to:

Kember Brown
kbrown@internetcds.com

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

About the Author

Lyle Brown

Web Developer

United States United States

Member

Lyle is a computer programmer in Vancouver, Washington.


Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
QuestionCAN SOMEONE HELP ME Pinmemberayumiaw19:32 23 Jan '08  
GeneralARP are Packets not capturing PinmemberAniket Salunkhe2:00 2 Nov '06  
GeneralExcellent ! PinmemberGil.Y1:14 9 Jun '06  
QuestionProblems with Thread? PinmemberRobse13:41 13 Apr '06  
AnswerRe: Problems with Thread? PinmemberRed_angelX20:55 24 Apr '07  
AnswerRe: Problems with Thread? Pinmembersergios_rus13:59 10 Jul '07  
QuestionWSAIoctl vs. C# Pinmembertalbot5:09 31 Jan '06  
GeneralSending packets received Pinmemberdoctorcpu20:28 28 Sep '05  
GeneralExplain please PinsussBabs200413:34 1 Nov '04  
Generaldocumentation Pinmemberwassim suleiman5:48 23 Jun '04  
QuestionThe owning process of a connection? PinmemberJohan Danforth21:18 12 May '04  
GeneralDHCPDISCOVER Pinmemberatu@ds-fr.com5:51 3 May '04  
GeneralRe: DHCPDISCOVER PinmemberBigRedAtwood10:41 13 Sep '04  
GeneralRe: DHCPDISCOVER Pinmemberatu@ds-fr.com21:45 13 Sep '04  
Questionhow about reading TCP header? Pinmembermehro13:30 21 Feb '04  
GeneralSpoofing PinmemberFad B0:45 5 Feb '04  
GeneralNot Run in Windows98 Pinmembersbf200016:45 24 Aug '03  
GeneralRe: Not Run in Windows98 Pinmemberoglodek6:15 28 May '04  
GeneralDecoding Socket MessageBuffer PinmemberEric Gibson4:54 19 Jun '03  
GeneralRe: Decoding Socket MessageBuffer Pinmemberkikon0:05 22 Jul '03  
GeneralRe: Decoding Socket MessageBuffer PinmemberMike Hunt18:21 10 Mar '04  
GeneralRe: Decoding Socket MessageBuffer PinmemberRKennison8:55 9 Jan '05  
GeneralRe: Decoding Socket MessageBuffer Pinsussdfhgesart9:28 26 Jan '05  
Questionwrong numberof packets? Pinmemberprincedom7:24 27 May '03  
QuestionRawSocket to NAT? Pinmemberdsandor12:36 6 May '03  

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.

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120517.1 | Last Updated 12 Apr 2002
Article Copyright 2002 by Lyle Brown
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid