ZeroTrace HID
OS Detection
Identify the host OS and branch payloads accordingly
The firmware identifies the target host's OS and exposes it as the script state _@detectedOS. Detection runs automatically within ~1 s of USB enumeration; it relies on USB descriptor probes and HID lock-state quirks unique to each OS.
Possible values
Windows
Linux
macOS
iOS
Android
Unknown OS
OS Detection Disabled
Waiting...
Use in scripts
IF "_@detectedOS" is "Windows"
press "win r"
delay 500
writeLn "cmd"
IF_END
IF "_@detectedOS" is "macOS"
press "cmd space"
delay 500
writeLn "Terminal"
press "enter"
IF_END
The terminal "<os>" primitive wraps this pattern for the common case.
Disable
Some restricted hosts log USB descriptor probes; disable detection in Settings → OS Detection when stealth matters more than per-OS branching. With detection off, _@detectedOS returns OS Detection Disabled.
Reliability
Detection is heuristic, not authoritative. Heavily customized OS images (Linux kiosks running a single browser, locked-down macOS in MDM) can return Unknown OS. When detection matters, validate in the lab against an image of the target before deployment.