-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extension: Send Files Through Dropbox - Windows #399
base: master
Are you sure you want to change the base?
Conversation
This extension can be used to send one or more files through the Dropbox API without having to copy and paste reused code every time, but standardizing a methodology that avoids errors.
DEFINE #DROPBOX_ACCESS_TOKEN 0 | ||
DEFINE #SINGLE-FILE FALSE | ||
DEFINE #SINGLE-PATH 0 | ||
DEFINE #MULTIPLE-FILES TRUE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the only options are
SINGLE-FILE
| MULTIPLE-FILES
I would suggest refactoring this so that there is only one flag to toggle; this eliminates the possibility of a user setting both to true, or both to false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realize i commented on the exmaple, but this suggestion is meant for the extension itself lol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right note, I thank you for the report.
I will fix this issue in the next commit.
STRINGLN #CREATE-HEADERS | ||
STRINGLN #HEADERS-ADD-AUTH | ||
|
||
IF ( #SINGLE-PATH != 0 ) THEN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while technically correct
for compile-time configuration you should use IF_DEFINED_TRUE
This will tell the compiler to conditionally include/exclude code from the inject.bin at compile time rather than forcing the duck to do a check at runtime
https://docs.hak5.org/hak5-usb-rubber-ducky/advanced-features/conditional-compilation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after second review, i might be misreading this lol
disregard; i believe this is just a default value check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The #SINGLE-PATH
variable was created to give the user the ability to set before compilation the exact path to the single file to be exfiltrated.
In the case where the user does not know the exact path (e.g., because he does not know the machine name or he has to search for a file following a generalized procedure) he can configure the payload respecting the characteristics given in the description.
This is to say that basically for the single file one can use either the static version via the #SINGLE-PATH
variable or the dynamic version by modifying the payload appropriately.
The use of the IF
truth value ( #SINGLE-PATH != 0 )
is due to the fact that there cannot be an absolute path equal to the string 0
and, therefore, in the case where a change is detected it implies that the static mode has been used and that therefore the #SINGLE-PATH
variable contains the absolute value of the file path. (I thought of this solution to reduce the extension of a variable/flag, namely #GENERALIZED
)
In the extension description I realized an error, the use of the variable #SINGLE-FILE
instead of #SINGLE-PATH
, but I solved this problem as you will see in the next commit so I ask you to re-evaluate based on the utl latest update since I am making several changes and you might find the answer to the note you made.
@@ -0,0 +1,10 @@ | |||
$uploadUrl = "https://content.dropboxapi.com/2/files/upload" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file isnt required for use is it?
(if not, remove it please)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided to declare the constant "https://content.dropboxapi.com/2/files/upload" for two reasons:
- Technical: This is a constant that falls within the proper formatting of the URL that issues the request, read more.
- Graphics: It makes the code more readable and does not result in a block to just execute but allows users to see piece by piece what the extension does, kind of like block programming.
@@ -0,0 +1,109 @@ | |||
EXTENSION SEND_FILES_THROUGH_DROPBOX_WINDOWS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extension file name should be the name of the extension
SEND_FILES_THROUGH_DROPBOX_WINDOWS.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right note, I thank you for the report.
I will fix this issue in the next commit.
[+] Added a Flag instead of the two variables [+] Extensioe renamed appropriately
@dallaswinger I would like to take this opportunity to thank you for the notes you pointed out and to ask you, do you think it might be preferable to create a more complex version that provides for the use of this extension on other operating systems than Windows? Edit#1: You would then have N operating systems for M exfiltration methods. imho: Probably this enormity would not be functional since in any case 1 system with 1 method would be used... |
Creation of the extension "SAVE FILES IN RUBBER DUCKY STORAGE" based on the old proposal "Send Files Through Dropbox - Windows"[1] [1] hak5#399
This extension can be used to send one or more files through the Dropbox API without having to copy and paste reused code every time, but standardizing a methodology that avoids errors.