├── .gitattributes ├── .gitignore ├── Linux ├── README.md ├── linuxWIFIget.png └── ubuntywifi.py ├── PsExec.exe ├── README.md ├── WIFIpass.png ├── WIFIpass.py └── Windows ├── PsExec.exe └── WIFIpass.exe /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .project 7 | .metadata 8 | bin/ 9 | tmp/ 10 | *.tmp 11 | *.bak 12 | *.swp 13 | *~.nib 14 | local.properties 15 | .classpath 16 | .settings/ 17 | .loadpath 18 | 19 | # External tool builders 20 | .externalToolBuilders/ 21 | 22 | # Locally stored "Eclipse launch configurations" 23 | *.launch 24 | 25 | # CDT-specific 26 | .cproject 27 | 28 | # PDT-specific 29 | .buildpath 30 | 31 | 32 | ################# 33 | ## Visual Studio 34 | ################# 35 | 36 | ## Ignore Visual Studio temporary files, build results, and 37 | ## files generated by popular Visual Studio add-ons. 38 | 39 | # User-specific files 40 | *.suo 41 | *.user 42 | *.sln.docstates 43 | 44 | # Build results 45 | 46 | [Dd]ebug/ 47 | [Rr]elease/ 48 | x64/ 49 | build/ 50 | [Bb]in/ 51 | [Oo]bj/ 52 | 53 | # MSTest test Results 54 | [Tt]est[Rr]esult*/ 55 | [Bb]uild[Ll]og.* 56 | 57 | *_i.c 58 | *_p.c 59 | *.ilk 60 | *.meta 61 | *.obj 62 | *.pch 63 | *.pdb 64 | *.pgc 65 | *.pgd 66 | *.rsp 67 | *.sbr 68 | *.tlb 69 | *.tli 70 | *.tlh 71 | *.tmp 72 | *.tmp_proj 73 | *.log 74 | *.vspscc 75 | *.vssscc 76 | .builds 77 | *.pidb 78 | *.log 79 | *.scc 80 | 81 | # Visual C++ cache files 82 | ipch/ 83 | *.aps 84 | *.ncb 85 | *.opensdf 86 | *.sdf 87 | *.cachefile 88 | 89 | # Visual Studio profiler 90 | *.psess 91 | *.vsp 92 | *.vspx 93 | 94 | # Guidance Automation Toolkit 95 | *.gpState 96 | 97 | # ReSharper is a .NET coding add-in 98 | _ReSharper*/ 99 | *.[Rr]e[Ss]harper 100 | 101 | # TeamCity is a build add-in 102 | _TeamCity* 103 | 104 | # DotCover is a Code Coverage Tool 105 | *.dotCover 106 | 107 | # NCrunch 108 | *.ncrunch* 109 | .*crunch*.local.xml 110 | 111 | # Installshield output folder 112 | [Ee]xpress/ 113 | 114 | # DocProject is a documentation generator add-in 115 | DocProject/buildhelp/ 116 | DocProject/Help/*.HxT 117 | DocProject/Help/*.HxC 118 | DocProject/Help/*.hhc 119 | DocProject/Help/*.hhk 120 | DocProject/Help/*.hhp 121 | DocProject/Help/Html2 122 | DocProject/Help/html 123 | 124 | # Click-Once directory 125 | publish/ 126 | 127 | # Publish Web Output 128 | *.Publish.xml 129 | *.pubxml 130 | 131 | # NuGet Packages Directory 132 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line 133 | #packages/ 134 | 135 | # Windows Azure Build Output 136 | csx 137 | *.build.csdef 138 | 139 | # Windows Store app package directory 140 | AppPackages/ 141 | 142 | # Others 143 | sql/ 144 | *.Cache 145 | ClientBin/ 146 | [Ss]tyle[Cc]op.* 147 | ~$* 148 | *~ 149 | *.dbmdl 150 | *.[Pp]ublish.xml 151 | *.pfx 152 | *.publishsettings 153 | 154 | # RIA/Silverlight projects 155 | Generated_Code/ 156 | 157 | # Backup & report files from converting an old project file to a newer 158 | # Visual Studio version. Backup files are not needed, because we have git ;-) 159 | _UpgradeReport_Files/ 160 | Backup*/ 161 | UpgradeLog*.XML 162 | UpgradeLog*.htm 163 | 164 | # SQL Server files 165 | App_Data/*.mdf 166 | App_Data/*.ldf 167 | 168 | ############# 169 | ## Windows detritus 170 | ############# 171 | 172 | # Windows image file caches 173 | Thumbs.db 174 | ehthumbs.db 175 | 176 | # Folder config file 177 | Desktop.ini 178 | 179 | # Recycle Bin used on file shares 180 | $RECYCLE.BIN/ 181 | 182 | # Mac crap 183 | .DS_Store 184 | 185 | 186 | ############# 187 | ## Python 188 | ############# 189 | 190 | *.py[co] 191 | 192 | # Packages 193 | *.egg 194 | *.egg-info 195 | dist/ 196 | build/ 197 | eggs/ 198 | parts/ 199 | var/ 200 | sdist/ 201 | develop-eggs/ 202 | .installed.cfg 203 | 204 | # Installer logs 205 | pip-log.txt 206 | 207 | # Unit test / coverage reports 208 | .coverage 209 | .tox 210 | 211 | #Translations 212 | *.mo 213 | 214 | #Mr Developer 215 | .mr.developer.cfg 216 | 217 | .idea/ 218 | -------------------------------------------------------------------------------- /Linux/README.md: -------------------------------------------------------------------------------- 1 | linuxWIFIget 2 | ======== 3 | 4 | Get all saved WIFI passwords on your PC, Linux only. 5 | 6 | Updated on 2016-9-14. (Tested on Ubuntu 14.04). 7 | 8 | Output could be like 9 | 10 | python ubuntywifi.py 11 | 12 | ![WIFIget]( linuxWIFIget.png ) -------------------------------------------------------------------------------- /Linux/linuxWIFIget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lijiejie/WIFIpass/50e251978c938ee0eb324d4544298a10efcb7981/Linux/linuxWIFIget.png -------------------------------------------------------------------------------- /Linux/ubuntywifi.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #coding = utf-8 3 | #Authors : kg 4 | import os 5 | import sys 6 | import re 7 | 8 | path = "/etc/NetworkManager/system-connections/" 9 | 10 | ''' get all wifi name and passwd''' 11 | def getAllwifi(path): 12 | wifiName = [] 13 | f_list = os.listdir(path) 14 | for i in f_list: 15 | try: 16 | i = os.path.dirname(path) + os.sep + i 17 | if judgePath(i): 18 | with open(i) as f: 19 | data = f.read() 20 | if "psk=" in data: 21 | ssid = re.search(r'id=(\w\w*)', data) 22 | pwd = re.search(r'psk=([\w=]*)', data) 23 | w_list = 'ssid: ' + ssid.group(1) + ' passwd: ' + pwd.group(1) + '\n' 24 | wifiName.append(w_list) 25 | else: 26 | print "you don't have permission, please use sudo or su" 27 | sys.exit() 28 | except Exception, e: 29 | print str(e) 30 | pass 31 | return wifiName 32 | 33 | ''' judge path access''' 34 | def judgePath(path): 35 | if os.access(path, os.R_OK): 36 | return True 37 | 38 | ''' write file ''' 39 | def writeFile(com): 40 | f=file("wifi.txt","a+") 41 | for context in com: 42 | f.write(context) 43 | f.close() 44 | 45 | 46 | if __name__ == '__main__': 47 | comment = getAllwifi(path) 48 | writeFile(comment) 49 | -------------------------------------------------------------------------------- /PsExec.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lijiejie/WIFIpass/50e251978c938ee0eb324d4544298a10efcb7981/PsExec.exe -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | WIFIpass 2 | ======== 3 | 4 | 5 | Decrypt all saved WIFI passwords on your PC, Windows only. 6 | 7 | Updated on 2015-5-1. (Tested on Windows 7). 8 | 9 | Output could be like 10 | 11 | ![WIFIpass](WIFIpass.png) 12 | 13 | [http://www.lijiejie.com](http://www.lijiejie.com) 14 | 15 | concact me: my[at]lijiejie.com 16 | -------------------------------------------------------------------------------- /WIFIpass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lijiejie/WIFIpass/50e251978c938ee0eb324d4544298a10efcb7981/WIFIpass.png -------------------------------------------------------------------------------- /WIFIpass.py: -------------------------------------------------------------------------------- 1 | ''' 2 | Decrypt all saved WIFI passwords on Windows 3 | By Lijiejie ( my[at]lijiejie.com ) 2015-5-1 4 | ''' 5 | 6 | from win32com.shell import shell, shellcon 7 | import os, sys 8 | from xml.dom import minidom 9 | import win32crypt 10 | import ctypes 11 | import subprocess 12 | 13 | 14 | if os.path.basename(sys.executable) == 'python.exe': 15 | exe_file = 'python %s ' % __file__ 16 | cur_dir = os.path.dirname(__file__) 17 | outfile_path = os.path.join(cur_dir, 'WIFI_pass.txt') 18 | else: 19 | exe_file = sys.executable 20 | cur_dir = os.path.dirname(sys.executable) 21 | outfile_path = os.path.join(os.path.dirname(sys.executable), 'WIFI_pass.txt') 22 | 23 | if os.path.exists(outfile_path): 24 | os.remove(outfile_path) 25 | 26 | if len(sys.argv) == 1: 27 | ret = subprocess.call('%s /accepteula /i /s %s -getpass' % (os.path.join(cur_dir,'PsExec.exe'), exe_file) ) 28 | if ret != 0: 29 | ctypes.windll.user32.MessageBoxW(0, u'Must run as administrator!', u'Require privileges', 16) 30 | sys.exit(1) 31 | sys.exit(0) 32 | 33 | # Get $ProgramData path 34 | folder = shell.SHGetFolderPath(0, shellcon.CSIDL_COMMON_APPDATA, None, 0) 35 | interface_folder = os.path.join(folder, 'Microsoft\Wlansvc\Profiles\Interfaces') # Interfaces folder 36 | 37 | if not os.path.exists(interface_folder): 38 | ctypes.windll.user32.MessageBoxW(0, u'Fail to locate $Interfaces folder!', u'Error', 16) # MB_ICONERROR = 0x00000010L 39 | sys.exit(-1) 40 | 41 | for root, dirs, files in os.walk(interface_folder): 42 | for file in files: 43 | if file.endswith('.xml'): 44 | try: 45 | xml_file = os.path.join(root, file) 46 | xml_doc = minidom.parse(xml_file) 47 | ssid = xml_doc.getElementsByTagName('SSID')[0].getElementsByTagName('name')[0].childNodes[0].data 48 | if not xml_doc.getElementsByTagName('keyMaterial'): 49 | continue 50 | key = xml_doc.getElementsByTagName('keyMaterial')[0].childNodes[0].data 51 | binout = [] 52 | for i in range(len(key)): 53 | if i % 2 == 0: 54 | binout.append(chr(int(key[i:i+2],16))) 55 | pwdHash = ''.join(binout) 56 | try: 57 | ret = win32crypt.CryptUnprotectData(pwdHash, None, None, None, 0) 58 | except: 59 | ctypes.windll.user32.MessageBoxW(0,u'Must run as administrator!', u'Require privileges', 16) 60 | sys.exit(-1) 61 | with open(outfile_path, 'a+') as outFile: 62 | outFile.write('SSID: {0:<20} Password: {1} \n\n'.format(ssid, ret[1])) 63 | except: 64 | pass 65 | 66 | ctypes.windll.user32.MessageBoxW(0, 67 | u'All WIFI passwords have been saved to\n\n%s' % os.path.abspath(outfile_path), 68 | u'Success', 64) -------------------------------------------------------------------------------- /Windows/PsExec.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lijiejie/WIFIpass/50e251978c938ee0eb324d4544298a10efcb7981/Windows/PsExec.exe -------------------------------------------------------------------------------- /Windows/WIFIpass.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lijiejie/WIFIpass/50e251978c938ee0eb324d4544298a10efcb7981/Windows/WIFIpass.exe --------------------------------------------------------------------------------