码迷,mamicode.com
首页 > 移动开发 > 详细

抓手机的包

时间:2015-12-13 18:48:11      阅读:243      评论:0      收藏:0      [点我收藏+]

标签:

需要一个有无线网卡的win7 电脑、可连wifi的手机

电脑通过有线上网,建一个无线虚拟网卡【无线承载网络(wireless hosted network)】,将有线网络共享给它。试了一下,用无线网共享给虚拟网卡也是一样,什么原理搞不清楚。就好象把无线网卡弄成模拟成NAT上网设备。最后用抓包工具抓取这个虚拟网卡。

参考:How-to-Create-Wireless-Hosted-Networks-in-Windows-7

Back in 2002, the research department at Microsoft started experimenting with the virtualization of 802.11 wireless adapters under the project code name VirtualWiFi. They discovered a way to make a single physical Wi-Fi adapter look like multiple adapters in Windows.

VirtualWiFi lets users simultaneously connect to multiple wireless networks with only one wireless card. They hoped this technology could be used in a variety of applications, including wireless diagnosis and troubleshooting, Wi-Fi mesh networking, virtual access points, and wireless repeating.

What is a wireless Hosted Network?

Though the VirtualWiFi project disbanded before the feature was fully implemented, Microsoft has included some of the underlying functionality in Windows 7 and Windows Server 2008 R2. Microsoft coined the name, wireless Hosted Network, for this new feature.

The wireless Hosted Network feature uses the VirtualWiFi technology along with a software-based access point (AP) feature. Thus, it lets anyone with a supported Wi-Fi adapter and driver to become a wireless AP for other Wi-Fi users, while also having the ability to connect to another wireless network. It also includes a DHCP server, so users automatically receive an IP address.

One use of this new feature might be to extend a hotel’s paid-Internet connection to other Wi-Fi users for free—not that I advocate this practice. Another more legitimate use might be to “repeat” a network’s signal. In any case, it serves as a quick mobile AP.

开启方法:Windows提供了命令行工具来建立,需要管理员权限。先用管理员权限运行命令行窗口。

C:\Windows\system32>netsh wlan
先输入netsh wlan回车,进入可以看到netsh wlan>,免得之后又要重复输入。

netsh wlan> set hostednetwork mode=allow ssid=Neta key=12345678
这样就新建了一个ssid为Neta的网络,密码是12345678

在网络适配器管理页面能看到这个虚拟的无线网卡。选中可以上网的网卡,比如本地连接的有线网卡,右键-属性-共享标签,勾选“允许其他网络用户……”,在网络连接中选择共享给刚刚新建的虚拟网卡的名称,默认的是“无线网络连接 2”。

netsh wlan> start hostednetwork
已启动承载网络。启用Neta网络

netsh wlan> stop hostednetwork
已停止承载网络。如果需要停止start改成stop就可以了。

需要改密码为password
netsh wlan> set hostednetwork  key=password
已成功更改托管网络的用户密钥密码。改名就加个ssid=要改的名字。

查看帮助:netsh wlan > ?

关于这个hostednetwork微软的文档

用手机连上这个wifi,刚刚新建的是Neta。可能要等一会儿才有。手机连接上之后,只需要监听这个虚拟的无线网卡就可以了。打开Wireshark,选择“无线网络连接 2”,开始抓包就可以了。

抓手机的包

标签:

原文地址:http://www.cnblogs.com/mize/p/5043188.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!