Path: blob/master/payloads/examples/Lock Keys/Lock-Keys-example2.txt
2968 views
REM Example SAVE and RESTORE of of the Keyboard Lock State12ATTACKMODE HID STORAGE3DELAY 200045SAVE_HOST_KEYBOARD_LOCK_STATE67$_RANDOM_MIN = 18$_RANDOM_MAX = 39VAR $TIMER = 1201011WHILE ($TIMER > 0)12VAR $A = $_RANDOM_INT13IF ($A == 1) THEN14CAPSLOCK15ELSE IF ($A == 2) THEN16NUMLOCK17ELSE IF ($A == 3) THEN18SCROLLLOCK19END_IF20DELAY 5021$TIMER = ($TIMER - 1)22END_WHILE2324RESTORE_HOST_KEYBOARD_LOCK_STATE25262728REM At the beginning of the payload, the currently reported keyboard lock state are saved.29REM For about 6 seconds, as a while loop iterates 120 times with a 50 ms delay, the caps, num or scroll lock keys will be randomly pressed.30REM When the "keyboard fireworks" display has concluded, the previously saved keyboard lock state will be restored.31REM Meaning, if the target has caps lock off, scroll lock off, and num lock on before the payload began, so too would it after its conclusion.323334