Jump to content

Recommended Posts

I'm trying to run the script below to get the drive letter of the Bash Bunny then change directories to it but i keep having issues with the apostrophes and dollar signs

# test
LED Y 300
RUN WIN powershell.exe
QUACK STRING "$USBDrive = Get-WmiObject Win32_Volume -Filter "DriveType='2'"|select -expand driveletter"
QUACK STRING "cd $USBDrive/payloads/switch1"

i added quotation marks before and after the commands i wanted to execute because usually that runs anything through QUACK containing an apostrophe without error but then when i plug the usb in these are the commands that are output

Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.

PS C:\Users\Elijah>  = Get-WmiObject Win32_Volume -Filter DriveType=2|select -expand driveletter
= : The term '=' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:2
+  = Get-WmiObject Win32_Volume -Filter DriveType=2|select -expand driv ...
+  ~
    + CategoryInfo          : ObjectNotFound: (=:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:\Users\Elijah> cd /payloads/switch1
cd : Cannot find path 'C:\payloads\switch1' because it does not exist.
At line:1 char:1
+ cd /payloads/switch1
+ ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\payloads\switch1:String) [Set-Location], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand

PS C:\Users\Elijah>

Im not too advanced in Powershell, Bash, or even Ducky so there's probably some simple fix

Link to post
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.

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...