├── main.py └── requirements.txt /main.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | 3 | 4 | def extract_wifi_passwords(): 5 | """Extracting Windows Wi-Fi passwords into .txt file""" 6 | 7 | profiles_data = subprocess.check_output('netsh wlan show profiles').decode('utf-8').split('\n') 8 | profiles = [i.split(':')[1].strip() for i in profiles_data if 'All User Profile' in i] 9 | 10 | for profile in profiles: 11 | profile_info = subprocess.check_output(f'netsh wlan show profile {profile} key=clear').decode('utf-8').split('\n') 12 | 13 | try: 14 | password = [i.split(':')[1].strip() for i in profile_info if 'Key Content' in i][0] 15 | except IndexError: 16 | password = None 17 | 18 | with open(file='wifi_passwords.txt', mode='a', encoding='utf-8') as file: 19 | file.write(f'Profile: {profile}\nPassword: {password}\n{"#" * 20}\n') 20 | 21 | 22 | def main(): 23 | extract_wifi_passwords() 24 | 25 | 26 | if __name__ == '__main__': 27 | main() 28 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | altgraph==0.17.2 2 | future==0.18.2 3 | pefile==2021.9.3 4 | pyinstaller==4.8 5 | pyinstaller-hooks-contrib==2022.0 6 | pywin32-ctypes==0.2.0 7 | --------------------------------------------------------------------------------