刷b站偶然刷到用python来解wifi密码,看的那个博主有用到一个自己写的解码本,估计就是一个个遍历解开他。在本网站只找到查看之前登录过的wifi密码的代码,如下:
import subprocess
def get_wifi_password(profile_name):
try:
result = subprocess.check_output(
['netsh', 'wlan', 'show', 'profile', profile_name, 'key=clear'],
stderr=subprocess.STDOUT, # Redirect stderr to stdout
text=True # Return output as string instead of bytes
)
return result
except subprocess.CalledProcessError as e:
print(f"An error occurred while trying to retrieve the Wi-Fi password: {e.output}")
return None
# Example usage (replace 'YourWiFiProfileName' with the actual WiFi profile name you want to query)
wifi_passwords = get_wifi_password('YourWiFiProfileName')
print(wifi_passwords)
我想等我哪次没流量用了,肯定会把那个代码敲下来。不过,ai提示:未经授权访问他人的Wi-Fi网络是非法的行为!!!