Monitoring outgoing internet traffic
Solution 1
Setting up a sniffer is doable via the WinPCap library, which has several projects wrapping it to .NET:
- http://geekswithblogs.net/dotnetnomad/archive/2008/01/31/119140.aspx
- http://www.codeproject.com/KB/IP/dotnetwinpcap.aspx
- http://coolthingoftheday.blogspot.com/2006/02/sharppcap-net-winpcap-wrapper.html
and probably some others as well, just a matter of Googling.
Solution 2
You would need to build some software that acts as a proxy. You should start by looking at programs like "Fiddler" to understand the concepts and what you need to implement.
If you want my profesional opionon you should go to Server Fault and ask for opionons for low cost internet proxy solution. Writing this thing yourself while challenging and fun will not make good business sense.
Solution 3
If you want to monitor all traffic from everyone on your network consider a product like Microsoft's Internet Security and Acceleration (ISA) Server
While this is probably overkill for what you want, the point is that you need a way to have all traffic go through a single point (a proxy server) where the traffic can be logged. Since all traffic goes through this one point, users can't avoid detection by using an alternate browser etc.
Admin
Updated on September 09, 2022Comments
-
Admin over 1 year
Is there a way to monitoring internet traffic programatically? I would like to log the pages users are visiting on the Internet. Can this be achieved with .NET code, is there a 3rd party .NET component that could be used to retrieved data.
Information about Internet traffic must be stored to a database so I cannot use a plugin or something for IE. We are also looking to include this code into our existing product so we cannot use a 3rd party product that cannot be redistributed.
It would be cool if this thing could monitor traffic for all browsers but monitoring IE traffic might also be sufficient.
-
Andrey almost 15 yearsWinPCap rules for passive monitoring. The most simple thing to do (without getting into other 3rd parties besides winpcap) - is to bypass wpcap.dll and use packet.dll directly. It is a DLL with low-level API functions that are very easy to wrap in .NET
-
Admin almost 15 yearsYup, this is great BUT we cannot redistribute ISA with our product :(
-
Admin almost 15 yearsWell I do not see how we could redistribute a low cost internet server proxy?
-
Admin almost 15 yearsHuh it seems this WInPCap might do it, however it seem to be too complicated to use, and it is open source solution and that might be a problem because our product is not.
-
Vinko Vrsalovic almost 15 yearsThe license allows it: Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Read conditions at winpcap.org/misc/copyright.htm
-
Evan Plaice over 13 years@Andrey There's no need to write a WinPcap wrapper for C# as they already exist. That's the function of SharpPcap and Pcap.Net. And yes, both projects are open source licensed.