Jump to content

[PAYLOAD] Play the Imperial March (Star Wars) using powershell beeps!


zSec

Recommended Posts

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

  • Like 3
Link to comment
Share on other sites

  • 2 months later...
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 🙂

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...