diff --git a/payloads/library/DuckyTemplate/payload.txt b/payloads/library/DuckyTemplate/payload.txt index c9d615a..b46e2cc 100644 --- a/payloads/library/DuckyTemplate/payload.txt +++ b/payloads/library/DuckyTemplate/payload.txt @@ -5,24 +5,8 @@ ATTACKMODE HID STORAGE LANGUAGE='us' LED R G -# Check for switch position to make it easier for us. (can be replaced in the future with bunny helpers) -check_switch() { - switch1=`cat /sys/class/gpio_sw/PA8/data` - switch2=`cat /sys/class/gpio_sw/PL4/data` - switch3=`cat /sys/class/gpio_sw/PL3/data` - echo "--- switch1 = $switch1, switch2 = $switch2, switch3 = $switch3" - if [ "x$switch1" = "x0" ] && [ "x$switch2" = "x1" ] && [ "x$switch3" = "x1" ]; then - SWITCH_POSITION="switch1" - elif [ "x$switch1" = "x1" ] && [ "x$switch2" = "x0" ] && [ "x$switch3" = "x1" ]; then - SWITCH_POSITION="switch2" - elif [ "x$switch1" = "x1" ] && [ "x$switch2" = "x1" ] && [ "x$switch3" = "x0" ]; then - SWITCH_POSITION="switch3" - else - SWITCH_POSITION="invalid" - fi -} - -check_switch +# Check for switch position to make it easier for us. +source bunny_helpers.sh if [ -f "/root/udisk/payloads/${SWITCH_POSITION}/ducky_script.txt" ]; then QUACK ${SWITCH_POSITION}/ducky_script.txt