Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created a script to find the wifi passwords #1768

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Wifi_password_script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import subprocess ##system commands
import re ##Search specific text in an output
command_output= subprocess.run(["netsh", "wlan","show", "profile",], capture_output=True).stdout.decode()
profile_name = (re.findall("All user profile :(.*)\r", command_output))
wifi_list = list()
if len(profile_name) !=0:
for name in profile_name:
wifi_profile = dict()
profile_info = subprocess.run(["netsh","wlan", "show", "profile", name], capture_output=True).stdout.decode()
if re.search("Security key :Absent", profile_info):
continue
else:
wifi_profile['ssid'] =name
profile_info_pass = subprocess(["netsh", "wlan", "show", "profile", name, "key=clear"], capture_putput=True).stdout.decode()
password =re.search("Key Content :(.*)\r", profile_info_pass)
if password == None:
wifi_profile["password"] = None
else:
wifi_profile["password"]= password[1]
wifi_list.append(wifi_profile)

for x in range(len(wifi_list)):
print(wifi_list[x])