Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
Available now!
Buy at Amazon US or
Buy at Amazon UK



Articles

1.Windows API reference
2.HTML to WML Converter
3.Webcam streaming in VB.NET
4.Remoting with firewalls
5.RSA from first principles
6.Key & MouseLogger in .NET
7.Networking Resource Kit for .NET
8.Automatic Reboot with .NET
9.XAML Schema
10.Migrating VB6 Winsock to VB.NET
11.Migrating C++ sockets to C#
12.RFC Reference guide
13.Lingua - Localization webservice
14.COM Reference guide
15.WMI Reference guide
16.SQL stored procedures
17.TCP & UDP port reference
18..NET Framework reference
19.Ethernet Type codes
20.IP to country webservice
21.MAC address assignments
22.DLL entry point reference
23.WHOIS server list
24. Turing Numbers
25. Boost SQL performance
26. Progress Bar in ASP.NET
27. OleDb WebService
27. Internet Explorer

Contact us

10. Packet sniffing, in C# and VB.NET

Packet sniffing has got a bad rap over the past few years, since it makes it possible to read anything sent over the wire, whether it was destined for your PC or not. This makes plain text username/password pair protection laughably insecure. However, packet sniffing isn’t just a hacker’s tool, it is an excellent non-invasive means of monitoring network traffic, to scan for bandwidth usage, worms, DOS attacks etc.

Whilst it is possible to use native raw sockets in .NET to capture packets at IP level, using a technique first published by Lance Olson at Microsoft. This has some limitations, as it cannot drill down below IP level, into the frame stack, nor can it capture in ‘promiscuous’ mode – that is, packets destined for other machines.

However, by using an open-source packet driver, and a C++ DLL (available for download separately), it is possible to drill down into the frame stack, below IP level, and capture packets promiscuously, as this example shows.

To test this application, install the packet driver and DLL as detailed in the book Network programming in .NET (Buy at Amazon UK) (Buy at Amazon US), and start the application, then open a browser, and connect to any site you wish (excluding localhost!), and you will see all the raw data travelling between client and server.

(Source code availabile in the book Network Programming in .NET (Buy at Amazon UK) (Buy at Amazon US) , Chapter 13, Example 2)

Page 2  Page 3  Page 4  Page 5  Page 6  Page 7  Page 8  Page 9  Page 10  Page 11  Page 12  Page 13 



Google

© 2008 Free SMS| Sage Line 50 Component