Skip to content
This repository was archived by the owner on May 25, 2022. It is now read-only.

Commit 3b75ce6

Browse files
authored
get wifi password using python
1 parent ce24e74 commit 3b75ce6

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

projects/Get Wifi password/wifi.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import subprocess
2+
3+
data = (
4+
subprocess.check_output(["netsh", "wlan", "show", "profiles"])
5+
.decode("utf-8")
6+
.split("\n")
7+
)
8+
profiles = [i.split(":")[1][1:-1] for i in data if "All User Profile" in i]
9+
for i in profiles:
10+
results = (
11+
subprocess
12+
.check_output(["netsh", "wlan", "show", "profile", i, "key=clear"])
13+
.decode("utf-8")
14+
.split("\n")
15+
)
16+
results = [b.split(":")[1][1:-1] for b in results if "Key Content" in b]
17+
try:
18+
print("{:<30}| {:<}".format(i, results[0]))
19+
except IndexError:
20+
print("{:<30}| {:<}".format(i, ""))

0 commit comments

Comments
 (0)