查看本地电脑连接过的wifi密码

原理

  • “netsh wlan show profiles”命令获取配置信息
  • “netsh wlan show profiles name="xxx" key=clear”查看对应的密码

代码实现

python

import subprocess
 
# Run the PowerShell command to get the list of all Wi-Fi profiles
command = 'netsh wlan show profiles'
profiles = subprocess.check_output(['powershell', '-Command', command]).decode('utf-8')
 
# Loop through all profiles and get the password for each one
for profile in profiles.split('\n'):
    if 'All User Profile' in profile:
        ssid = profile.split(':')[1].strip()
        command = f'netsh wlan show profile name="{ssid}" key=clear'
        profile_info = subprocess.check_output(['powershell', '-Command', command]).decode('utf-8')
        if 'Key Content' in profile_info:
            password = profile_info.split('Key Content')[1].split(':')[1].strip()
            print(f'SSID: {ssid}')
            print(f'Password: {password}\n')

 

自动化测试

robotframework+selenium的PO模式、RF标识及编写规范

2022-9-29 11:02:01

PHP脚本

PHP两种代码混淆加密工具

2023-1-24 18:01:46

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
今日签到
有新私信 私信列表
搜索
Array ( [0] => post [1] => user [2] => document [3] => newsflashes )