ElijahLord Posted January 6, 2018 Share Posted January 6, 2018 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 B ATTACKMODE HID STORAGE LED Y 300 RUN WIN powershell.exe DELAY 100 QUACK STRING "$USBDrive = Get-WmiObject Win32_Volume -Filter "DriveType='2'"|select -expand driveletter" QUACK ENTER DELAY 50 QUACK STRING "cd $USBDrive/payloads/switch1" QUACK ENTER 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 Quote Link to comment Share on other sites More sharing options...
ElijahLord Posted January 6, 2018 Author Share Posted January 6, 2018 i should probably mention that my ultimate goal is to execute an exe in the switch1 directory on the bash bunny without prior knowledge of the drive letter Quote Link to comment Share on other sites More sharing options...
Rkiver Posted January 6, 2018 Share Posted January 6, 2018 Best bet is to check in the Bash Bunny section. All hardware Hak5 do has it's own section for questions and help. https://forums.hak5.org/forum/92-bash-bunny/ Quote Link to comment Share on other sites More sharing options...
ElijahLord Posted January 6, 2018 Author Share Posted January 6, 2018 oh i actually didnt know that. thanks i will Quote Link to comment Share on other sites More sharing options...
Rkiver Posted January 6, 2018 Share Posted January 6, 2018 You're quite welcome, and welcome to the forums. 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.