Skip to contentSkip to Content

Mantis STRING Command

The Mantis STRING command instructs the Mantis USB hardware to type a sequence of characters through the standard USB HID keyboard interface.

When Mantis executes a STRING instruction, it translates each character in the provided text into standard USB HID keyboard scan codes (press and release events) and delivers them to the host operating system at the configured typing pace.


What It Does

  • Emulates human or machine keyboard input on Windows, macOS, Linux, Android, and ChromeOS.
  • Consumes all characters after the STRING keyword until the end of the line.
  • Respects per-keystroke pacing configured by SET_DELAY or SET_SPEED.
  • Does not automatically append an Enter / Return keystroke (use STRINGLN if a newline is needed).

Syntax & Parameters

hello.mantis
1STRING <text>

Parameters

  • <text> (required): The ASCII or UTF-8 character sequence to type. Leading whitespace immediately following STRING is preserved.

Examples & Payload Snippets

Basic Text Injection

hello.mantis
1REM Set pacing and type a welcome string
2SET_SPEED $Normal
3STRING Hello from Karvi Mantis!

Full Automation Payload Example

The following payload opens the Windows Run dialog, launches Notepad, and types a multiline note:

hello.mantis
1REM Open Windows Run Dialog
2GUI r
3DELAY 500
4
5REM Open Notepad
6STRING notepad
7ENTER
8DELAY 1000
9
10REM Type message using STRING
11STRING Welcome to Mantis USB HID Automation.
12ENTER
13STRING Designed and built in India.

Expected Behavior

  1. The target host receives keypress events corresponding to each character in the string.
  2. Uppercase characters, punctuation marks, and symbols (e.g. !, @, #) automatically trigger the appropriate internal SHIFT modifier keystrokes.
  3. Execution pauses briefly between each character according to the active SET_SPEED or SET_DELAY value.

Common Mistakes & Troubleshooting

  • Missing Initial Delay: If Mantis starts typing before the target operating system has recognized the USB device, the first few characters may be lost. Always include an initial delay (e.g., DELAY 1000) at the start of your payload.
  • Forgetting Enter: If you expect the command to be submitted in a terminal or dialog, remember to either add an ENTER command on the next line or use STRINGLN.
  • Keyboard Layout Mismatch: Mantis emulates a standard US QWERTY keyboard layout by default. On host systems configured for different keyboard layouts (e.g. UK, AZERTY, QWERTZ), specific symbols (such as @, ", z, y) may map differently.

  • STRINGLN — Type text and automatically press Enter.
  • FAST_STRING — Type text using batched HID reports at high WPM.
  • ENTER — Press the Enter / Return key.
  • DELAY — Pause script execution.
  • SET_SPEED — Set typing pace presets ($Human, $Fastest, $Normal).
Last updated on