Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hak5
GitHub Repository: hak5/usbrubberducky-payloads
Path: blob/master/payloads/extensions/protected_storage_mode.txt
2968 views
1
EXTENSION PROTECTED_STORAGE_MODE
2
REM VERSION 1.1
3
REM AUTHOR: Korben
4
5
REM_BLOCK
6
Example hidden storage mode
7
Forces user to padlock style unlock storage mode by setting
8
the HOSTs lock keys and pressing the duck button to submit a
9
combination three times.
10
The wrong combination will immediately fail silently.
11
The correct combination will trigger ATTACKMODE STORAGE and LED_G
12
13
TARGET:
14
Any host that will reflect CAPSLOCK,NUMLOCK, and SCROLLLOCK
15
16
USAGE:
17
BUTTON_DEF
18
STORAGE_PASSWORD_CHECK()
19
END_BUTTON
20
21
CONFIGURATION:
22
Available combinations provided as DEFINEs below,
23
change within the STORAGE_PASSWORD_CHECK as desired
24
25
Method of input submission can be changed using SUBMIT_FOR_CHECK
26
But will obviously convolute combination checks.
27
END_REM
28
29
REM Combinations provided as defines for convenience (verbosely spaced - DEFINES aren't re-formatted by preprocessor)
30
DEFINE #ALL_LOCKS_OFF ( ( $_CAPSLOCK_ON == FALSE ) && ( $_NUMLOCK_ON == FALSE ) && ( $_SCROLLLOCK_ON == FALSE ) )
31
DEFINE #ALL_LOCKS_ON ( ( $_CAPSLOCK_ON == TRUE ) && ( $_NUMLOCK_ON == TRUE ) && ( $_SCROLLLOCK_ON == FALSE ) )
32
33
DEFINE #ONLY_CAPS_ON ( ( $_CAPSLOCK_ON == TRUE ) && ( $_NUMLOCK_ON == FALSE ) && ( $_SCROLLLOCK_ON == FALSE ) )
34
DEFINE #ONLY_NUM_ON ( ( $_CAPSLOCK_ON == FALSE ) && ( $_NUMLOCK_ON == TRUE ) && ( $_SCROLLLOCK_ON == FALSE ) )
35
DEFINE #ONLY_SCROLL_ON ( ( $_CAPSLOCK_ON == FALSE ) && ( $_NUMLOCK_ON == FALSE ) && ( $_SCROLLLOCK_ON == TRUE ) )
36
37
DEFINE #ONLY_CAPS_OFF ( ( $_CAPSLOCK_ON == FALSE ) && ( $_NUMLOCK_ON == TRUE ) && ( $_SCROLLLOCK_ON == TRUE ) )
38
DEFINE #ONLY_NUM_OFF ( ( $_CAPSLOCK_ON == TRUE ) && ( $_NUMLOCK_ON == FALSE ) && ( $_SCROLLLOCK_ON == TRUE ) )
39
DEFINE #ONLY_SCROLL_OFF ( ( $_CAPSLOCK_ON == TRUE ) && ( $_NUMLOCK_ON == TRUE ) && ( $_SCROLLLOCK_ON == FALSE ) )
40
41
DEFINE #SUBMIT_FOR_CHECK WAIT_FOR_BUTTON_PRESS
42
43
FUNCTION STORAGE_PASSWORD_CHECK()
44
VAR $ACCEPED = FALSE
45
LED_R
46
#SUBMIT_FOR_CHECK
47
48
REM first combination ALL LOCKS OFF
49
IF #ALL_LOCKS_OFF THEN
50
STRING .
51
#SUBMIT_FOR_CHECK
52
53
REM second combination ONLY CAPS ON
54
IF #ONLY_CAPS_ON THEN
55
STRING .
56
#SUBMIT_FOR_CHECK
57
58
REM third combination ONLY NUM ON
59
IF #ONLY_NUM_ON THEN
60
$ACCEPTED = TRUE
61
END_IF
62
END_IF
63
END_IF
64
65
IF $ACCEPTED THEN
66
LED_G
67
ATTACKMODE STORAGE
68
END_IF
69
END_FUNCTION
70
END_EXTENSION
71
72