Python暴力破解wifi密码这个你了解吗?你看了你也可以

免责声明
本文仅供参考,不建议您将此代码用于不想要的实践,否则本文/博客的作者将不承担任何责任。

需要打包好的软件关注小编,QQ群:810735403领取。

让我们开始吧

import subprocess
import re

首先,我们将导入子进程以通过python执行Windows命令,然后重新输入regex。

python
def main():
    command_output= subprocess.run(["netsh", "wlan", "show", "profiles"], capture_output= True).stdout.decode()
    profile_names = (re.findall("All User Profile     : (.*)\r", str(command_output)))

导入必要的程序包后,我们使用以下命令列出PC中的所有用户配置文件。

netsh wlan show配置文件显示所有wifi配置文件。

if len(profile_names) != 0 :
            for names in profile_names:
               check = subprocess.run(["netsh", "wlan", "show", "profiles", names], capture_output= True).stdout.decode()

现在,首先我们检查是否有profile_names来从中提取密码。获得所有概要文件名后,我们将循环到通过执行上述命令获取的每个profile_names中。

netsh wlan显示配置文件名称(在这里的names变量中,我们具有wifi或ssid名称)

re.findall()用于查找与给定模式匹配的所有事件。

if re.search(" Security key           : Absent", str(check)):
                    continue
            else:
                paswd = subprocess.run(["netsh", "wlan", "show", "profiles", names ,"key=clear"], capture_output= True).stdout.decode()
                get = re.search("Key Content            :(.*)\r", paswd)           
                if get == None:
                    print (f"profile {names} password None")
                else:    
                    profile = {
    
    
                        'ssid' : names,
                        'Password' : get[1],
                    }
                    print (profile)

f name == “main”:
main()
然后,如果缺少安全密钥,我们将搜索该密钥,然后离开该配置文件并继续查找下一个。

netsh wlan显示配置文件名称key = clear显示该ssid名称的密码作为Key内容

re.search()仅返回与指定模式匹配的第一个匹配项。

片段

在这里还是要推荐下我自己建的Python学习群:810735403,群里都是学Python的,如果你想学或者正在学习Python ,欢迎你加入,大家都是软件开发党,不定期分享干货(只有Python软件开发相关的),包括我自己整理的一份2021最新的Python进阶资料和零基础教学,欢迎进阶中和对Python感兴趣的小伙伴加入!

**以下内容无用,为本篇博客被搜索引擎抓取使用
(* ̄︶ ̄)(* ̄︶ ̄)(* ̄︶ ̄)(* ̄︶ ̄)(* ̄︶ ̄)(* ̄︶ ̄)(* ̄︶ ̄)(* ̄︶ ̄)
python 是干什么的 零基础学 python 要多久 python 为什么叫爬虫
python 爬虫菜鸟教程 python 爬虫万能代码 python 爬虫怎么挣钱
python 基础教程 网络爬虫 python python 爬虫经典例子
python 爬虫
(* ̄︶ ̄)(* ̄︶ ̄)(* ̄︶ ̄)(* ̄︶ ̄)(* ̄︶ ̄)(* ̄︶ ̄)( ̄︶ ̄)( ̄︶ ̄)
以上内容无用,为本篇博客被搜索引擎抓取使用

猜你喜欢

转载自blog.csdn.net/XIe_0928/article/details/112652632