# Jitter

## Overview

Jitter is a feature which varies the cadence, or delay, between individual key presses. When enabled, jitter affects all keystroke injection commands. Jitter delays are randomly generated at payload deployment, rather than statically compiled delays such as when using the `DELAY` command. This means that each deployment of a jitter-enabled payload will produce different results.

## $\_JITTER\_ENABLED

Jitter is enabled and disabled by changing the boolean value of the `$_JITTER_ENABLED` internal variable. By default the value of this variable is `FALSE`. To turn jitter on, set the variable to `TRUE`.

### Example

```
REM Example Jitter

ATTACKMODE HID STORAGE
DELAY 2000

$_JITTER_ENABLED = TRUE
WHILE TRUE
    STRINGLN The quick brown fox jumps over the lazy dog
END_WHILE
```

* The test string is typed continuously with a modulated delay between each key press.

## $\_JITTER\_MAX

The `$_JITTER_MAX` internal variable sets the maximum time between key presses in milliseconds. The default is 20 ms.

### Example

```
REM Example Jitter with increasing $_JITTER_MAX

ATTACKMODE HID STORAGE
DELAY 2000

$_JITTER_ENABLED = TRUE
WHILE TRUE
    STRINGLN The quick brown fox jumps over the lazy dog
    $_JITTER_MAX = ($_JITTER_MAX * 2)
END_WHILE
```

#### Result

* With each iteration of typing the test string the jitter limit is doubled, yielding slower and more sporadic typing.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.hak5.org/hak5-usb-rubber-ducky/advanced-features/jitter.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
