用 Ethereal/WireShark 抓取无线接口的包

昨天准备抓一些包分析用,家里只有无线网络,而且非得在 Windows 上,然后用 [Ethereal/WireShark] 对无线网络接口进行抓包,使用的是缺省的选项,竟然一个包都抓不到。Ethereal/WinCap 安装完以后应该是不需要重启的,但是担心机器上的防火墙可能阻止了一部分东西,所以重装了一次,还是不行。后来不知道怎么地,把混杂模式(promiscuous)选项关掉以后,再抓就能抓到了。昨天时间比较紧,就没有深究。刚刚在 Ethereal/WireShark 的 [FAQ][Wiki] 上看到了解释。

简单来说,要看到 802.11 协议的头部信息,驱动程序必须处于监视模式(Monitor Mode)才可以,而 Win 下的大多数驱动都不支持。好在我也是只想抓数据包,不需要知道 802.11 自己的协议信息,这种情况下,它会从 802.11 头部假造出一个以太网的头部,和数据包放在一起。对于一般的以太网适配器,需要在混杂模式下才能抓包,但是对于无线适配器来说,很多驱动都不支持,所以结果就是什么都抓不到。只能设置在非混杂模式下,在这个模式下,就只能抓取自己本机的数据包,还好,我也只需要这个。最后还是成功了。

看来这里面的道道还挺多,以前基本上只跟以太网打交道,基本上没碰过无线的,也就是在工作后才开始用,都不太了解这些详细的内容,算是学了一点东西。有机会再在 Linux 下试试。

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote>
  • You can use BBCode tags in the text.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. The supported tag styles are: <foo>, [foo].
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
  _____   _     _  __        __  _____                   _  __
| ____| (_) (_) \ \ / / | ____| _ _ __ _ | |/ /
| _| | | | | \ \ /\ / / | _| | | | | / _` | | ' /
| |___ | | | | \ V V / | |___ | |_| | | (_| | | . \
|_____| |_| _/ | \_/\_/ |_____| \__, | \__, | |_|\_\
|__/ |___/ |_|
Enter the code depicted in ASCII art style.