zSec Posted May 15, 2019 Share Posted May 15, 2019 Hi everyone! Inspired by the "Making Windows scream when you unplug devices" payload, I was thinking of other fun payloads you can do with the Rubber Ducky. Lately, a co-worker of mine showed me how you can play music with powershell and after I've seen that, I just had to make a payload with this feature. For those who aren't aware of, you can use "beep" commands with powershell which will, when executed, play a tone. If you want to try it yourself, just open powershell and execute the following commmand: [console]::beep(500,300) When executed, you will hear a short "beep". You can find further information on the powershell beep command here:https://devblogs.microsoft.com/scripting/powertip-use-powershell-to-send-beep-to-console/ So now we can make our own music using powershell. Luckily, there are already some tracks available such as "The Imperial March (Star Wars)" or "Mission Impossible". When I saw this, I just had to make a Rubber Ducky payload out of this. So every time you plug in the Rubber Ducky, it will execute the powershell script and play the Star Wars Imperial March. Here is the payload: DELAY 3000 GUI r DELAY 250 STRING powershell DELAY 250 ENTER DELAY 500 REM Hide the powershell window STRING Add-Type -Name W -Names C -M ' ENTER STRING [DllImport("Kernel32.dll")] ENTER STRING public static extern IntPtr GetConsoleWindow(); ENTER STRING [DllImport("user32.dll")] ENTER STRING public static extern bool MoveWindow(IntPtr h, int X, int Y, int W, int H);' ENTER STRING [C.W]::MoveWindow([C.W]::GetConsoleWindow(),0,0,-1,-1); ENTER REM Play the Imperial March STRING [console]::beep(440,500);[console]::beep(440,500);[console]::beep(440,500);[console]::beep(349,350);[console]::beep(523,150);[console]::beep(440,500);[console]::beep(349,350);[console]::beep(523,150);[console]::beep(440,1000);[console]::beep(659,500);[console]::beep(659,500);[console]::beep(659,500);[console]::beep(698,350);[console]::beep(523,150);[console]::beep(415,500);[console]::beep(349,350);[console]::beep(523,150);[console]::beep(440,1000);exit ENTER Of course one should be able to loop this so the song will keep playing, but I'll leave that up to you guys 🙂 I know it's a kinda meaningless but fun payload, so I hope some of you will enjoy it! - zSec 3 Quote Link to comment Share on other sites More sharing options...
jblk01 Posted July 23, 2019 Share Posted July 23, 2019 REM Play the Imperial March STRING while ($true) { ENTER STRING [console]::beep(440,500);[console]::beep(440,500);[console]::beep(440,500);[console]::beep(349,350);[console]::beep(523,150);[console]::beep(440,500);[console]::beep(349,350);[console]::beep(523,150);[console]::beep(440,1000);[console]::beep(659,500);[console]::beep(659,500);[console]::beep(659,500);[console]::beep(698,350);[console]::beep(523,150);[console]::beep(415,500);[console]::beep(349,350);[console]::beep(523,150);[console]::beep(440,1000); ENTER STRING } ENTER Done 🙂 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.