Path: blob/master/payloads/library/prank/Multi_HID_HeyGotAnyGrapes/payload.txt
2968 views
REM TITLE Hey Got Any Grapes?1REM AUTHOR Cribbit2REM DESCRIPTION Get Powershell or MacOS "say" or Linux (ubuntu) "espeak" to speak the opening of the duck song3REM NOTE espeak need to be install on the system for it to work4REM PROP Song by Bryant Oden56EXTENSION OS_DETECTION7REM VERSION 1.089REM USB Rubber Ducky Host OS Detection10REM Generic OS detection at a high view is a moving target11REM results may vary greatly depending12REM on a combination of many variables:13REM - number of testing stages14REM - specific devices and versions tested against15REM - number of systems testing for (scope)16REM - detection techniques (passive/invisible/active/hybrid)17REM - overall speed18REM - overall accuracy1920REM TARGET:21REM DEFAULT - Windows, Mac, Linux22REM ADVANCED_DETECTION - Windows, Mac, Linux, iOS, ChromeOS, Android2324REM USAGE:25REM Uncomment the function call below to run this extension inline (here)26REM or call DETECT_OS() anywhere in your payload after the extension27REM Place this extension and the DETECT_OS() before28REM you would like to first reference $_OS to execute payload code conditionally2930REM CONFIGURATION:31DEFINE VERBOSE FALSE32DEFINE ADVANCED_DETECTION FALSE33DEFINE STARTUP_DELAY 150034DEFINE RESTART_WAIT 100035DEFINE CONNECT_WAIT 100036DEFINE OS_DETECT_MODE HID37DEFINE OS_DETECT_VID VID_05AC38DEFINE OS_DETECT_PID PID_021E39DEFINE WINDOWS_HOST_REQUEST_COUNT 240DEFINE HOST_RESPONSE_TIMEOUT 10004142FUNCTION DETECT_OS()43$_HOST_CONFIGURATION_REQUEST_COUNT = 044ATTACKMODE OS_DETECT_MODE OS_DETECT_VID OS_DETECT_PID45DELAY STARTUP_DELAY46SAVE_HOST_KEYBOARD_LOCK_STATE4748IF VERBOSE THEN49IF ADVANCED_DETECTION THEN50STRING ADVANCED OS DETECT51ELSE52STRING OS DETECT53END_IF5455ENTER56STRING test caps57END_IF5859IF ($_CAPSLOCK_ON == FALSE) THEN60LED_R61CAPSLOCK62DELAY HOST_RESPONSE_TIMEOUT63END_IF64LED_OFF6566IF VERBOSE THEN67ENTER68STRING test done69END_IF7071IF $_RECEIVED_HOST_LOCK_LED_REPLY THEN72IF VERBOSE THEN73ENTER74STRING received led response75END_IF76LED_G77IF ($_HOST_CONFIGURATION_REQUEST_COUNT > WINDOWS_HOST_REQUEST_COUNT) THEN78IF VERBOSE THEN79ENTER80STRING prediction: Windows81END_IF82$_OS = WINDOWS83ELSE84IF VERBOSE THEN85ENTER86STRING prediction: Linux87END_IF88$_OS = LINUX89END_IF90ELSE91IF VERBOSE THEN92ENTER93STRING no led response94ENTER95STRING prediciton: MacOS96END_IF97$_OS = MACOS98END_IF99100IF ADVANCED_DETECTION THEN101IF ( $_OS == LINUX ) THEN102IF VERBOSE THEN103ENTER104STRING soft reconnect105END_IF106ATTACKMODE OFF107DELAY RESTART_WAIT108ATTACKMODE OS_DETECT_MODE OS_DETECT_VID OS_DETECT_PID109DELAY CONNECT_WAIT110IF VERBOSE THEN111ENTER112STRING reconnected113END_IF114IF ($_CAPSLOCK_ON == TRUE) THEN115IF VERBOSE THEN116ENTER117STRING caps led on118ENTER119STRING test numlock120END_IF121NUMLOCK122DELAY HOST_RESPONSE_TIMEOUT123IF VERBOSE THEN124ENTER125STRING test done126END_IF127IF ($_NUMLOCK_ON == FALSE) THEN128IF VERBOSE THEN129ENTER130STRING no numlock led131ENTER132STRING prediciton: ChromeOS133END_IF134$_OS = CHROMEOS135ELSE136IF VERBOSE THEN137ENTER138STRING numlock led on139ENTER140STRING testing scrolllock141END_IF142SCROLLLOCK143DELAY HOST_RESPONSE_TIMEOUT144IF VERBOSE THEN145ENTER146STRING test done147END_IF148IF ($_SCROLLLOCK_ON == TRUE) THEN149IF VERBOSE THEN150ENTER151STRING scrolllock led on152ENTER153STRING prediciton: Android154END_IF155$_OS = ANDROID156ELSE157IF VERBOSE THEN158ENTER159STRING no scrolllock reply160ENTER161STRING prediction: Linux162END_IF163$_OS = LINUX164END_IF165END_IF166END_IF167ELSE IF ($_OS == MACOS) THEN168IF ($_CAPSLOCK_ON == TRUE) THEN169IF VERBOSE THEN170ENTER171STRING caps led on172ENTER173STRING prediction: iOS174END_IF175$_OS = IOS176ELSE177IF VERBOSE THEN178ENTER179STRING no caps reply180ENTER181STRING prediction: MacOS182END_IF183$_OS = MACOS184END_IF185ELSE IF ($_OS == WINDOWS) THEN186IF VERBOSE THEN187ENTER188STRING Confident Windows Prediction189END_IF190$_OS = WINDOWS191END_IF192END_IF193194RESTORE_HOST_KEYBOARD_LOCK_STATE195196IF VERBOSE THEN197ENTER198STRING OS_DETECT complete199ENTER200END_IF201END_FUNCTION202203REM Uncomment the function call below to run this extension inline (here)204REM or call DETECT_OS() anywhere in your payload after the extension205206REM DETECT_OS()207END_EXTENSION208209210DEFINE #DUCKSONG "A duck walked up to a lemonade stand and he said to the man, running the stand. Hey! Bum bum bum. Got any grapes? The man said No we just sell lemonade. But it's cold. And it's fresh. And it's all home-made. Can I get you a Glass? The duck said I'll pass! Then he waddled away. waddle waddle. Til the very next day. Bum bum bum bum bum bumbum"211212DETECT_OS()213214IF ($_OS == WINDOWS) THEN215GUI r216DELAY 200217STRINGLN powershell218DELAY 300219REM the powershell version uses Speech Synthesis Markup Language so the speech can emphasis some words a change pitch for the duck220STRINGLN Add-Type -AssemblyName System.speech;(New-Object System.Speech.Synthesis.SpeechSynthesizer).SpeakSsml('<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="en-US">A duck walked up to a lemonade stand<break time="0.5s"/>And he said to the man, running the stand<break time="0.5s"/><prosody rate="fast"><emphasis>Hey!</emphasis></prosody><prosody pitch="x-low">Bum bum bum</prosody><break time="0.5s"/><prosody rate="fast"><emphasis>Got any grapes?</emphasis></prosody>The man said<break time="0.5s"/>No we just sell lemonade. But it''s cold. And it''s fresh. And it''s all home-made. Can I get you a <emphasis>Glass?</emphasis><break time="0.5s"/>The duck said<break time="0.5s"/><prosody rate="fast">I''ll <emphasis>pass!</emphasis></prosody>Then he waddled away<prosody pitch="x-low">waddle waddle</prosody><break time="0.2s"/>Til the very next day<prosody pitch="x-low">Bum bum bum<break time="0.2s"/>bum bum bumbum</prosody></speak>')221ELSE IF ($_OS == MACOS)222COMMAND SPACE223DELAY 100224STRINGLN terminal225DELAY 100226STRING say227SPACE228STRINGLN #DUCKSONG229ELSE IF ($_OS == LINUX)230CTRL-ALT t231DELAY 300232STRING espeak233SPACE234STRINGLN #DUCKSONG235END_IF236237