mirror of
https://github.com/metafy-social/python-scripts.git
synced 2024-11-24 04:21:12 +00:00
Merge pull request #349 from rahulkarda/master
Script to fetch all the wifi passwords
This commit is contained in:
commit
f77d40e81d
6
scripts/fetching_system_information/README.md
Normal file
6
scripts/fetching_system_information/README.md
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
# Fetching System Information
|
||||||
|
This is a simple script that fetches system information for your system.(Windows)
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
1. Clone the repo
|
||||||
|
2. Run python script.py
|
11
scripts/fetching_system_information/script.py
Normal file
11
scripts/fetching_system_information/script.py
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import wmi
|
||||||
|
|
||||||
|
c = wmi.WMI()
|
||||||
|
my_system = c.Win32_ComputerSystem()[0]
|
||||||
|
|
||||||
|
print(f"Manufacturer: {my_system.Manufacturer}")
|
||||||
|
print(f"Model: {my_system. Model}")
|
||||||
|
print(f"Name: {my_system.Name}")
|
||||||
|
print(f"NumberOfProcessors: {my_system.NumberOfProcessors}")
|
||||||
|
print(f"SystemType: {my_system.SystemType}")
|
||||||
|
print(f"SystemFamily: {my_system.SystemFamily}")
|
9
scripts/wifi_password_checker/README.md
Normal file
9
scripts/wifi_password_checker/README.md
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
# Wifi Passwords
|
||||||
|
This is a simple script that fetches all the saved passwords.
|
||||||
|
|
||||||
|
## Improvements
|
||||||
|
Generating a QR code to easily connect mobile devices.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
1. Clone the repo
|
||||||
|
2. Run python script.py
|
49
scripts/wifi_password_checker/script.py
Normal file
49
scripts/wifi_password_checker/script.py
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
import subprocess
|
||||||
|
import os
|
||||||
|
import platform
|
||||||
|
|
||||||
|
pswd_txt = open(f"{os.getlogin()}-{platform.node()}", "w")
|
||||||
|
|
||||||
|
data = subprocess.check_output(['netsh', 'wlan', 'show', 'profiles']).decode('utf-8', errors="backslashreplace").split(
|
||||||
|
'\n')
|
||||||
|
profiles = [i.split(":")[1][1:-1] for i in data if "All User Profile" in i]
|
||||||
|
|
||||||
|
pswd_txt.write(f'{"{:<30}| {:<}".format("WIFI", "Password")} \n')
|
||||||
|
pswd_txt.write(f'{"-" * 50} \n')
|
||||||
|
|
||||||
|
print("{:<30}| {:<}".format('WIFI', 'Password'))
|
||||||
|
print("-" * 50)
|
||||||
|
|
||||||
|
for i in profiles:
|
||||||
|
try:
|
||||||
|
|
||||||
|
results = subprocess.check_output(['netsh', 'wlan', 'show', 'profile', i, 'key=clear']).decode('utf-8',
|
||||||
|
errors="backslashreplace").split(
|
||||||
|
'\n')
|
||||||
|
results = [b.split(":")[1][1:-1] for b in results if "Key Content" in b]
|
||||||
|
|
||||||
|
try:
|
||||||
|
|
||||||
|
pswd_txt.write(f'{"{:<30}| {:<}".format(i, results[0])} \n')
|
||||||
|
pswd_txt.write(f'{"-" * 50} \n')
|
||||||
|
|
||||||
|
print("{:<30}| {:<}".format(i, results[0]))
|
||||||
|
print("-" * 50)
|
||||||
|
|
||||||
|
|
||||||
|
except IndexError:
|
||||||
|
|
||||||
|
pswd_txt.write(f'{"{:<30}| {:<}".format(i, "")} \n')
|
||||||
|
pswd_txt.write(f'{"-" * 50} \n')
|
||||||
|
print("{:<30}| {:<}".format(i, ""))
|
||||||
|
print("-" * 50)
|
||||||
|
|
||||||
|
|
||||||
|
except subprocess.CalledProcessError:
|
||||||
|
|
||||||
|
pswd_txt.write(f'{"{:<30}| {:<}".format(i, "ENCODING ERROR")} \n')
|
||||||
|
pswd_txt.write(f'{"-" * 50} \n')
|
||||||
|
print("{:<30}| {:<}".format(i, "ENCODING ERROR"))
|
||||||
|
print("-" * 50)
|
||||||
|
|
||||||
|
pswd_txt.close()
|
Loading…
Reference in New Issue
Block a user