├── .gitignore
├── .gitattributes
├── show_wifi_pass.ps1
├── show_wifi_pass.bat
├── LICENSE
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | ".txt"
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/show_wifi_pass.ps1:
--------------------------------------------------------------------------------
1 | (netsh wlan show profiles) | Select-String "All User Profile" | ForEach-Object {
2 | $ssid = $_.Line.Split(':')[1].Trim()
3 | $profile = (netsh wlan show profile name=$ssid key=clear)
4 | $passwordLine = $profile | Select-String "Key Content"
5 | if ($passwordLine -ne $null) {
6 | $password = $passwordLine.Line.Split(':')[1].Trim()
7 | "SSID: $ssid`nPassword: $password`n"
8 | }
9 | } | Out-File -FilePath "$env:USERPROFILE\Desktop\wifipass.txt"
10 |
--------------------------------------------------------------------------------
/show_wifi_pass.bat:
--------------------------------------------------------------------------------
1 | :: Created by: akhi07rx
2 | :: Recover Wireless Password on Windows Using CMD
3 | :: https://github.com/akhi07rx
4 |
5 |
6 | @echo off
7 | setlocal enabledelayedexpansion
8 |
9 | for /f "tokens=2 delims=:" %%a in ('netsh wlan show profile ^| findstr ":"') do (
10 | set "ssid=%%~a"
11 | call :getpwd "%%ssid:~1%%"
12 | )
13 |
14 | echo.
15 | echo Press any key to exit...
16 | pause > nul
17 | exit
18 |
19 | :getpwd
20 | set "ssid=%*"
21 |
22 | for /f "tokens=2 delims=:" %%i in ('netsh wlan show profile name^="%ssid:"=%" key^=clear ^| findstr /C:"Key Content"') do (
23 | echo SSID: %ssid% PASS: %%i
24 | )
25 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 akhi07rx
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://choosealicense.com/licenses/mit/)
2 | 
3 | 
4 | 
5 | 
6 | 
7 |
8 | 
9 |
10 | # Recover Wi-Fi Password Using CMD, Windows PowerShell
11 |
12 | This guide will show you how to recover Wi-Fi passwords on a Windows PC using CMD, Windows PowerShell
13 |
14 | ## Reveal Target Wi-Fi Password
15 |
16 | First, we must uncover the target Wi-Fi network to display the corresponding password. To accomplish this, launch the Windows Command Prompt window and input the subsequent command to exhibit all Wi-Fi networks that your computer has previously connected to:
17 |
18 |
19 |
20 | ```
21 | netsh wlan show profile
22 | ```
23 |
24 |
25 | With the Wi-Fi network profiles visible, enter the following command, replacing `WIFI-NAME-PROFILE` (leave the quotes) with the profile for which you want to see the password:
26 |
27 |
28 |
29 | ```
30 | netsh wlan show profile “WIFI-NAME-PROFILE” key=clear
31 | ```
32 |
33 |
34 |
35 | To only show the Wi-Fi password for that target wireless network profile, enter the following command:
36 |
37 |
38 |
39 | ```
40 | netsh wlan show profile “WIFI-NAME-PROFILE” key=clear | findstr “Key Content”
41 | ```
42 |
43 |
44 |
45 | ## Reveal All Wi-Fi Passwords
46 |
47 | The subsequent command will display all saved Wi-Fi networks along with their corresponding Wi-Fi passwords:
48 |
49 |
50 |
51 | ```
52 | for /f "skip=9 tokens=1,2 delims=:" %i in ('netsh wlan show profiles') do @if "%j" NEQ "" (echo SSID: %j & netsh wlan show profiles %j key=clear | findstr "Key Content") & echo.
53 | ```
54 |
55 |
56 |
57 | You can also save all of those Wi-Fi network details shown using the command above to a text document using the following command:
58 |
59 |
60 | (Windows Power Shell)
61 |
62 |
63 |
64 | ```
65 | (netsh wlan show profiles) | Select-String "All User Profile" | ForEach-Object {
66 | $ssid = $_.Line.Split(':')[1].Trim()
67 | $profile = (netsh wlan show profile name=$ssid key=clear)
68 | $passwordLine = $profile | Select-String "Key Content"
69 | if ($passwordLine -ne $null) {
70 | $password = $passwordLine.Line.Split(':')[1].Trim()
71 | "SSID: $ssid`nPassword: $password`n"
72 | }
73 | } | Out-File -FilePath "$env:USERPROFILE\Desktop\wifipass.txt"
74 |
75 | ```
76 |
77 |
78 |
79 | **Note:** Replace `wifipass.txt` at the end of the above command to customize the file name which will be generated in the Windows directory you currently reside.
80 |
81 |
82 |
83 | ## Create a Windows Batch File
84 |
85 | You can create a Windows batch file to show all Wi-Fi network passwords or just download the one provided in this repository.
86 |
87 | To create a batch file, open a text editor and paste in the following code:
88 |
89 | ```
90 | @echo off
91 | setlocal enabledelayedexpansion
92 |
93 | for /f "tokens=2 delims=:" %%a in ('netsh wlan show profile ^| findstr ":"') do (
94 | set "ssid=%%~a"
95 | call :getpwd "%%ssid:~1%%"
96 | )
97 |
98 | echo.
99 | echo Press any key to exit...
100 | pause > nul
101 | exit
102 |
103 | :getpwd
104 | set "ssid=%*"
105 |
106 | for /f "tokens=2 delims=:" %%i in ('netsh wlan show profile name^="%ssid:"=%" key^=clear ^| findstr /C:"Key Content"') do (
107 | echo SSID: %ssid% PASS: %%i
108 | )
109 |
110 | ```
111 |
112 | Save the file with a `.bat` extension, such as `show_wifi_pass.bat`. To run the batch file, simply double-click on it.
113 |
114 | This batch file will run the command to show all stored Wi-Fi networks and their associated Wi-Fi passwords. It will also pause at the end so you can view the results.
115 |
116 |
117 |
118 | ## Troubleshooting
119 |
120 | If you encounter any issues while following the steps in this guide, here are some troubleshooting tips that may help:
121 |
122 | - Make sure you are running the commands in a Windows Command Prompt window with administrative privileges. To do this, right-click on the Command Prompt icon and select "Run as administrator".
123 |
124 | - If you are having trouble creating or running a batch file, make sure the file has a `.bat` extension and that you have permission to run it.
125 |
126 | If you continue to have issues, please feel free to open an issue in this repository or seek help from online forums or communities.
127 |
128 | ## Additional Resources
129 |
130 | If you would like to learn more about managing wireless networks on Windows, here are some additional resources that may be helpful:
131 |
132 | - [Microsoft's documentation on the `netsh` command](https://docs.microsoft.com/en-us/windows-server/networking/technologies/netsh/netsh)
133 | - [Windows Command Line reference](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/windows-commands)
134 | - [Wireless networking on Windows](https://support.microsoft.com/en-us/windows/connect-to-a-wi-fi-network-in-windows-10-1a3c1c0e-7b55-80a9-5a7f-f35d0d1f3d2c)
135 |
136 | These resources provide more detailed information about the `netsh` command and other tools for managing wireless networks on Windows.
137 |
138 |
139 |
140 | ## Acknowledgment
141 |
142 | We would like to acknowledge and thank the authors and creators of the additional resources listed in this guide. Your work has provided valuable information and guidance for users looking to learn more about managing wireless networks on Windows. This code was developed with help from various online resources, including documentation for the netsh command, Windows Command Line reference, and Wireless networking on Windows. We would like to thank all contributors who have shared their knowledge and expertise with us. Thank you for your contributions to the community.
143 |
144 |
145 |
146 | ## Contributing
147 |
148 | Contributions to this repository are welcome. If you find any issues or have suggestions for improvements, please submit a pull request or open an issue.
149 |
150 | We appreciate any contributions, big or small. Thank you for helping to improve this guide!
151 |
152 | ## License
153 |
154 | This project is licensed under the MIT License.
155 |
156 |
--------------------------------------------------------------------------------