Jump to content

Weird Variable Assignment Behavior in DuckyScript

Recommended Posts

Hi Team,

I'm wondering if anyone else can replicate an anomaly I'm finding in DuckyScript compiled in PayloadStudio for use with Rubber Ducky?

When I manually set the MAN_ PROD_ and SERIAL_ parameters, If I then try and assign the integer value 3000 to a variable it only registers as 48.  I wrote a function to test all other assignments up to 10,000 and the anomaly only seems to occur with 3000 exactly. This is my reduced payload.txt for error reproduction:


DELAY 2000

VAR $X = 3000

IF ($X == 48) THEN
    STRING X is 48


As far as troubleshooting goes, I've tried:

- different variable names.

- variable orders and assignment styles.

- using the TRANSLATE extension.

- manipulating the variable with mathematical operators (If you start with 3000 as the assignment the quirk persists however if you say VAR $X = 2999; $X = ($X + 1); then $X will actually be 3000).

- using the variable within WHILE loops and various conditional statements.

- using the three different active ATTACKMODES.


If MAN_ PID_ and SERIAL_ aren't included then the anomaly does not occur. Does anyone know why this happens?



Link to comment
Share on other sites

I would suggest creating a support ticket. Devs (Korben to be more specific since it's about PayloadStudio/Ducky Script 3.0) isn't very active here (and this isn't official support either). Someone with insight "under the hood" probably needs to dive deeper into an issue like this.

  • Thanks 1
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.

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