Created
January 10, 2022 11:38
-
-
Save Majramos/1559ea7f1a566f168be7b932a411aff0 to your computer and use it in GitHub Desktop.
Get all wifi passwords
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
data = ( | |
subprocess.check_output(["netsh", "wlan", "show", "profiles"]) | |
.decode("ISO-8859-1") | |
.split("\n") | |
) | |
profiles = [i.split(":")[1][1:-1] for i in data if "All User Profile" in i] | |
for i in profiles: | |
results = ( | |
subprocess | |
.check_output(["netsh", "wlan", "show", "profile", i, "key=clear"]) | |
.decode("utf-8") | |
.split("\n") | |
) | |
results = [b.split(":")[1][1:-1] for b in results if "Key Content" in b] | |
try: | |
print("{:<30}| {:<}".format(i, results[0])) | |
except IndexError: | |
print("{:<30}| {:<}".format(i, "")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment