import subprocess
import platform
import csv
import sys
class Colors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
def check_os():
if platform.system() != "Windows":
print(f"{Colors.FAIL}[!] Error: This script relies on the Windows 'netsh' command.")
print(f"[!] It cannot run on Linux, macOS, or Android/Termux.{Colors.ENDC}")
sys.exit(1)
def get_wifi_profiles():
try:
data = subprocess.check_output(
['netsh', 'wlan', 'show', 'profiles'],
stderr=subprocess.DEVNULL,
encoding='utf-8',
errors='ignore'
)
profiles = []
for line in data.split('\n'):
if "All User Profile" in line:
profile_name = line.split(":", 1)[1].strip()
profiles.append(profile_name)
return profiles
except subprocess.CalledProcessError:
print(f"{Colors.FAIL}[!] Error: Could not retrieve profiles. Is the WLAN AutoConfig service running?{Colors.ENDC}")
sys.exit(1)
def get_wifi_password(profile_name):
try:
results = subprocess.check_output(
['netsh', 'wlan', 'show', 'profile', 'name=' + profile_name, 'key=clear'],
stderr=subprocess.DEVNULL,
encoding='utf-8',
errors='ignore'
).split('\n')
for line in results:
if "Key Content" in line:
return line.split(":", 1)[1].strip()
return "[Open Network / No Password]"
except subprocess.CalledProcessError:
return "[Error Retrieving]"
def main():
check_os()
print(f"{Colors.HEADER}{Colors.BOLD}=== Wi-Fi Password Recovery Tool ==={Colors.ENDC}\n")
profiles = get_wifi_profiles()
if not profiles:
print(f"{Colors.WA…
Читать полностью →