监控传出互联网流量
有没有办法以编程方式监控互联网流量? 我想记录用户在互联网上访问的页面。 这可以通过 .NET 代码实现吗?是否有可用于检索数据的第 3 方 .NET 组件。
有关互联网流量的信息必须存储到数据库中,因此我无法使用 IE 的插件或其他东西。 我们还希望将此代码包含到我们现有的产品中,这样我们就不能使用无法重新分发的第三方产品。
如果这个东西可以监控所有浏览器的流量那就太酷了,但监控 IE 流量也可能就足够了。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
可以通过 WinPCap 库设置嗅探器,该库有几个将其包装到 .NET 的项目:
可能还有其他一些,只是谷歌搜索的问题。
Setting up a sniffer is doable via the WinPCap library, which has several projects wrapping it to .NET:
and probably some others as well, just a matter of Googling.
您需要构建一些充当代理的软件。 您应该首先查看“Fiddler”等程序来了解概念以及需要实现的内容。
如果您想要我的专业意见,您应该转到服务器故障并询问低成本互联网代理解决方案的意见。 自己写这个东西既具有挑战性又有趣,不会有很好的商业意义。
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.
如果您想监控网络上每个人的所有流量,请考虑使用 Microsoft 的产品 Internet 安全和加速 (ISA) 服务器
虽然这对于您想要的东西来说可能有点过分,但关键是您需要一种方法让所有流量都通过单个点(代理服务器),流量在该点上传输可以记录。 由于所有流量都经过这一点,因此用户无法通过使用备用浏览器等来避免检测。
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.
您还可以尝试 Pcap.Net 在.NET 中轻松使用 WinPcap。
它是用 C++/CLI 和 C# 编写的 WinPcap 包装器,包括数据包解释和创建框架。
You can also try Pcap.Net to easily use WinPcap in .NET.
It is a wrapper for WinPcap written in C++/CLI and C# and includes a packet interpretation and creation framework.
就像 JD 已经提到的,你应该看看 Fiddler。 使用此代理,您可以监控所有网络流量(如果您的浏览器配置为使用 fiddler 作为代理)。
如果您不希望 fiddler 作为独立应用程序并需要在您自己的应用程序中使用其功能,您应该查看 FiddlerCore。 它是一个.Net程序集,封装了Fiddler的核心功能。
如果您需要一种更原始的方式来嗅探数据(也许您不想[或无法]配置客户端的代理),答案来自 Vinko 将为您提供进一步帮助。
Like JD already mentioned you should take a look into Fiddler. With this proxy you are able to monitor all the web traffic (if your browser is configured to use fiddler as proxy).
If you don't want fiddler as a standalone application and need its functionality within your own app, you should take a look into FiddlerCore. It is a .Net assembly which encapsulates the core functionality of Fiddler.
If you need a more raw way to sniff into the data (maybe you don't want to [or can't] configure the proxy of the client) the answer from Vinko will help you further.