Jump to content

Ducky Script Issue


xmuchbeastx
 Share

Recommended Posts

  • 2 weeks later...

Can ya give the full lines or examples of the full lines your having issues with?

 

At first glance it looks like you might be setting variables in such a way that the conpiler does not understand, bellow is an example of setting a variable in Windows cmd using Ducky syntax

 

STRING set "var_name=var_value"
ENTER
STRING ECHO Variable value "%var_name%"

 

Check out StackOverflow's answer for more variable assignment examples; hint, quotes ar funky.

At second glance it looks as though you maybe trying to complile a payload that should instead be copied to the target's file system and run there without re-compiling with Ducky, ie a plan-old .bat file. If that is the case then you may want to look tat the documentation on how to copie payload scripts to the target prior to running'em. Just be awair that the syntax stuff for Ducky script should be removed from these pailoads.

 

I found it was easiest to consider the Ducky script syntax much like the syntax used for auto-building with .yml files. Hope ya get it all working.

Link to comment
Share on other sites

Did you copy-paste the "s?

I find that, occasionally, either quotation marks ('), double quotation marks (") or dashes (-) copied from internet sources are encoded differently that they would be in notepad/leafpad/terminal etc., so try deleting the "s and replacing them by actually typing them in, then try again.

Link to comment
Share on other sites

11 hours ago, haze1434 said:

Did you copy-paste the "s?

I find that, occasionally, either quotation marks ('), double quotation marks (") or dashes (-) copied from internet sources are encoded differently that they would be in notepad/leafpad/terminal etc., so try deleting the "s and replacing them by actually typing them in, then try again.

I'll up-vote this solution as I have run into this issue too. It's the leading reason why I switched from fancy text GUI applications to using vim, nano, and other terminal based text editers.

The other issues similar to this that I've run into while scripting are the newline/return marks on documents. Linux based systems use the `\n` for line feed and I think windows uses `\r` or `\r\n` for carage return. Additionally symbles such as `$`, `>`, `|` and others will often get messed with by web hosting software.

Link to comment
Share on other sites

  • 4 months later...

I was having the same problem the other day with the online encoder while using some powershell I had written up. Easiest way to fix it is to just download the Java encoder and use that. I havent had an issue since. The Java encoder seams to be upto date with bug fixes 

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.

 Share

  • Recently Browsing   0 members

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