From 9bc262191e2867293e269b17739ca3b49f0ef4f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E6=81=92aead?= Date: Mon, 2 Sep 2024 20:44:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20v1.2.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 13 ++++++++++++- requirements.txt | 2 +- wifi_crack_tool.py | 23 ++++++++++++++++------- wifi_crack_tool_gui.py | 2 +- wifi_crack_tool_gui.ui | 2 +- 5 files changed, 31 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index e9ae3ab..d6000dc 100644 --- a/README.md +++ b/README.md @@ -158,21 +158,25 @@ Tips:理论支持Win10、Win11、Linux、MacOS(MacOS 暂未测试,可自 ### Windows 1. [下载 Python 3.11.9](https://www.python.org/downloads/release/python-3119/) 并安装 + 2. 安装所需模块 ```cmd pip install -r requirements.txt ``` + 3. 编译 wifi_crack_tool_gui.ui ```cmd pyside6-uic wifi_crack_tool_gui.ui -o wifi_crack_tool_gui.py ``` + 4. 编译运行 wifi_crack_tool.py ```cmd python -u wifi_crack_tool.py ``` + 5. 打包 wifi_crack_tool.py ```cmd @@ -188,10 +192,11 @@ Tips:理论支持Win10、Win11、Linux、MacOS(MacOS 暂未测试,可自 sudo apt upgrade ``` -2. 安装QT GUI依赖库 +2. 安装QT GUI依赖库 以及 剪切板依赖库 ```shell sudo apt install libxcb-cursor0 + sudo apt install xclip ``` 3. 安装python3虚拟环境库 @@ -238,6 +243,12 @@ Tips:理论支持Win10、Win11、Linux、MacOS(MacOS 暂未测试,可自 ## 更新日志 +### v1.2.2 + +- **[修复]** 在多网卡的情况下意外的提示了 “应用程序的另一个实例已经在运行。” 的问题。([#13](https://github.com/baihengaead/wifi-crack-tool/issues/13)) +- **[修复]** 在部分情况下,进行utf-8编码转换时,出现转换异常的问题。([#13](https://github.com/baihengaead/wifi-crack-tool/issues/13)) +- **[修复]** 在破解中文WiFi后,连接的中文WiFi名称乱码的问题。 + ### v1.2.1 - **[优化]** 对Linux平台支持。 diff --git a/requirements.txt b/requirements.txt index c641d0d..c522f03 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -pywifi>=1.1.12 +git+https://github.com/baihengaead/pywifi.git@master#egg=pywifi PySide6>=6.7.2 pyperclip>=1.9.0 comtypes>=1.4.4 diff --git a/wifi_crack_tool.py b/wifi_crack_tool.py index 19611d5..97aedbd 100644 --- a/wifi_crack_tool.py +++ b/wifi_crack_tool.py @@ -2,7 +2,7 @@ """ Author: 白恒aead Repositories: https://github.com/baihengaead/wifi-crack-tool -Version: 1.2.1 +Version: 1.2.2 """ import os,sys,datetime,time,threading,ctypes,json import platform @@ -30,8 +30,8 @@ def __init__(self,mutex): else: self.icon_path = "images/wificrack.ico" - if mutex is None: - self.showinfo(title='WiFi\u5bc6\u7801\u66b4\u529b\u7834\u89e3\u5de5\u5177v1.2.1', message='应用程序的另一个实例已经在运行。') + if pywifi.PyWiFi().interfaces().__len__() <= 1 and mutex is None: + self.showinfo(title=self.windowTitle(), message='应用程序的另一个实例已经在运行。') sys.exit() icon = QIcon() @@ -185,7 +185,7 @@ def __init__(self,win:MainWindow): self.ui = win.ui self.config_dir_path = os.getcwd()+"/config" #配置文件目录路径 - # 如果不存在log目录,则创建 + # 如果不存在config目录,则创建 if not os.path.exists(self.config_dir_path): os.mkdir(self.config_dir_path) @@ -195,7 +195,7 @@ def __init__(self,win:MainWindow): os.mkdir(self.log_dir_path) self.dict_dir_path = os.getcwd()+"/dict" #字典目录路径 - # 如果不存在log目录,则创建 + # 如果不存在dict目录,则创建 if not os.path.exists(self.dict_dir_path): os.mkdir(self.dict_dir_path) @@ -377,8 +377,17 @@ def __init__(self,tool:'WifiCrackTool'): self.iface:Interface self.get_wnic() self.ssids = [] + self.convert_success = False self.is_auto = False + def coding_convert(self,content:str,encoding:str='utf-8'): + try: + return content.encode('raw_unicode_escape').decode(encoding) + except Exception as r: + self.win.show_msg.send(f"编码转换时发生错误 {r}\n\n","red") + self.win.reset_controls_state.send() + return False + def get_wnic(self): '''获取无线网卡''' try: @@ -419,7 +428,7 @@ def search_wifi(self): self.win.show_msg.send("扫描完成!\n","black") self.ssids = [] for i,data in enumerate(ap_list):#输出扫描到的WiFi名称 - ssid = data.ssid.encode('raw_unicode_escape').decode('utf-8') + ssid = data.ssid#self.coding_convert(data.ssid,'utf-8') self.ssids.insert(i,ssid) self.win.reset_controls_state.send() self.win.add_wifi_items.send(self.ssids) @@ -551,7 +560,7 @@ def connect(self,ssid,pwd,filetype,count): elif akm=='UNKNOWN': akm_v = 5 profile = pywifi.Profile() #创建wifi配置对象 - profile.ssid = ssid.encode('utf-8').decode('gb18030') #Wifi SSID 解码为gb18030 + profile.ssid = ssid#.encode('utf-8').decode('gb18030') #Wifi SSID 解码为gb18030 profile.key = pwd # type: ignore #WiFi密码 profile.auth = const.AUTH_ALG_OPEN #网卡的开放 profile.akm.append(akm_v) #wifi加密算法,一般是 WPA2PSK diff --git a/wifi_crack_tool_gui.py b/wifi_crack_tool_gui.py index a0ee786..2df5273 100644 --- a/wifi_crack_tool_gui.py +++ b/wifi_crack_tool_gui.py @@ -126,7 +126,7 @@ def setupUi(self, MainWindow): # setupUi def retranslateUi(self, MainWindow): - MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"WiFi\u5bc6\u7801\u66b4\u529b\u7834\u89e3\u5de5\u5177v1.2.1 by \u767d\u6052aead", None)) + MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"WiFi\u5bc6\u7801\u66b4\u529b\u7834\u89e3\u5de5\u5177v1.2.2 by \u767d\u6052aead", None)) self.lbl_wifi_name.setText(QCoreApplication.translate("MainWindow", u"WiFi\u540d\u79f0:", None)) self.lbl_security_type.setText(QCoreApplication.translate("MainWindow", u"\u5b89\u5168\u7c7b\u578b:", None)) self.lbl_wnic.setText(QCoreApplication.translate("MainWindow", u"\u65e0\u7ebf\u7f51\u5361:", None)) diff --git a/wifi_crack_tool_gui.ui b/wifi_crack_tool_gui.ui index 77f69e8..348e0f7 100644 --- a/wifi_crack_tool_gui.ui +++ b/wifi_crack_tool_gui.ui @@ -32,7 +32,7 @@ - WiFi密码暴力破解工具v1.2.1 by 白恒aead + WiFi密码暴力破解工具v1.2.2 by 白恒aead