简体   繁体   English

如何在不使用PCap的情况下在.NET中嗅探本地传出网络流量?

[英]How to sniff local outgoing network traffic in .NET without using PCap?

I'd like to somehow hook into the local system's network stack to capture outgoing network packets without using Winpcap. 我想以某种方式挂钩到本地系统的网络堆栈,以捕获传出的网络数据包,而无需使用Winpcap。 Unfortunately it tends to crash my system every now and then. 不幸的是,它偶尔会使我的系统崩溃。

Is there a way to "sniff" outgoing traffic of the local system from a user space process written in a .NET language? 有没有办法从用.NET语言编写的用户空间进程“嗅探”本地系统的传出流量?

What you want is the Network Monitor API . 你想要的是网络监视器API More here and here . 更多这里这里

I use smsniff from NIRSOFT. 我使用NIRSOFT的smsniff。 You need to be admin on the machine to sniff any traffic. 你需要在机器上管理员来嗅探任何流量。

http://www.nirsoft.net/utils/smsniff.html http://www.nirsoft.net/utils/smsniff.html

I have never seen .net used to sniff traffic. 我从未见过.net用来嗅流量。 But maybe NetMon from Microsoft has a COM interface you call from .Net 但也许Microsoft的NetMon有一个你从.Net调用的COM接口

But as always you need to be admin to sniff traffic, since it is needed to put the NIC in promiscuous mode. 但是一如既往,你需要管理员来嗅探流量,因为需要将NIC置于混杂模式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM