Mantis DELAY Command
The Mantis DELAY command pauses script execution for a specified duration in milliseconds (ms).
Proper timing is the single most critical factor in building reliable keystroke injection payloads. Operating systems require time to enumerate USB devices, launch applications, render GUI windows, and process terminal commands.
What It Does
- Suspends payload processing for the exact number of milliseconds requested.
- Maintains USB HID connection state and keep-alive signals while paused.
- Prevents keystrokes from firing before the host operating system is ready to receive input.
Syntax & Parameters
hello.mantis
1DELAY <milliseconds>Parameters
<milliseconds>(required): An integer representing pause duration (e.g.500for half a second,2000for 2 seconds).
Examples & Payload Snippets
Waiting for OS Enumeration & Application Startup
hello.mantis
1REM Initial delay to allow USB device enumeration2DELAY 150034REM Launch Run Dialog5GUI r6REM Wait 600ms for Run dialog window to appear7DELAY 60089REM Type command10STRING cmd11ENTER1213REM Wait 1000ms for Command Prompt terminal to initialize14DELAY 10001516STRINGLN echo Mantis payload active.Timing Best Practice Guidelines
| Operation | Recommended Delay | Why It Matters |
|---|---|---|
| Post-USB Plug-in | 1000 – 2000 ms | OS needs time to bind the generic USB HID keyboard driver. |
Dialog Launch (GUI r) | 400 – 700 ms | Windows Explorer animation delay. |
Terminal Startup (cmd / powershell) | 1000 – 1500 ms | Shell process initialization & window painting. |
| Browser Launch | 2000 – 3000 ms | Heavy browser process & profile loading. |
Common Mistakes & Troubleshooting
- Zero Delay at Payload Start: Plugging in Mantis and immediately sending keystrokes will cause the initial characters to be lost while the host OS initializes the USB bus. Always begin payloads with
DELAY 1000orDELAY 2000. - Assuming Instant App Startup: Machines with slow hard drives or heavy background processes take longer to open apps. Tune your delays conservatively to ensure reliability across varied hardware.
Related Commands
SET_DELAY— Set fixed delay between every individual keystroke.SET_SPEED— Apply global speed profiles ($Human, $Fastest).WAIT_FOR_BUTTON_PRESS— Pause indefinitely until physical button click.
Last updated on