From ae7e70461650da0d065bd0edda6547a102f8b80d Mon Sep 17 00:00:00 2001 From: HackingMark <88377487+HackingMark@users.noreply.github.com> Date: Tue, 24 Oct 2023 17:02:26 +0200 Subject: [PATCH 1/6] Create Get-DBToken.md Obtains a fresh Authtoken for Dropbox-Upload --- Functions/Get-DBToken.md | 102 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 Functions/Get-DBToken.md diff --git a/Functions/Get-DBToken.md b/Functions/Get-DBToken.md new file mode 100644 index 0000000..7a9ca8e --- /dev/null +++ b/Functions/Get-DBToken.md @@ -0,0 +1,102 @@ +![Logo](https://github.com/I-Am-Jakoby/hak5-submissions/blob/main/Assets/logo-170-px.png?raw=true) + + +
+ Table of Contents +
    +
  1. Description
  2. +
  3. The Function
  4. +
  5. Examples
  6. +
  7. Contact
  8. +
  9. Acknowledgments
  10. +
+
+ +# Get-DBToken + +## Description + +Obtains a fresh Authtoken, prevents Authtoken timeouts after 4h. + +## The Function + +### [GET-DBToken] + +After retreiving a Refreshtoken you could use this function to obtain a fresh Authtoken for the Dropbox Upload function. +This solve the problem of timing out after 4 hours. + +Use e.g. $DBToken=Get-DBToken and use $DBToken instead of your token. + +``` +function Get-DBToken { + $headersDB = New-Object "System.Collections.Generic.Dictionary[[String],[String]]" + $headersDB.Add("grant_type", "refresh_token") + $headersDB.Add("refresh_token", "INSERT YOUR REFRESH TOKEN HERE") + $headersDB.Add("client_id", "YOUR_APP_KEY") + $headersDB.Add("client_secret", "YOUR_APP_SECRET") + + $BodyDB = @{ + grant_type = "refresh_token" + refresh_token = "INSERT YOUR REFRESH TOKEN HERE" + client_id = "YOUR_APP_KEY" + client_secret = "YOUR_APP_SECRET" + + } +Invoke-RestMethod -Uri https://www.dropbox.com/oauth2/token -Method Post -Headers $headersDB -Body $BodyDB +} + +

(back to top)

+ + +## Examples +[//]: # (Examples of scripts that have used your function) +Listed below are payloads that have used one of these functions: + +[Acid Burn](https://github.com/I-Am-Jakoby/hak5-submissions/tree/main/OMG/Payloads/OMG-AcidBurn) + +[JumpScare](https://github.com/I-Am-Jakoby/hak5-submissions/tree/main/OMG/Payloads/OMG-JumpScare) + + +

(back to top)

+ + +## Contact + +I am Jakoby +


+ + + + + + + + + + + + + + + + + + + +

+ + + +

(back to top)

+ + +## Acknowledgments + +* [Hak5](https://hak5.org/) +* [UberGuidoZ](https://github.com/UberGuidoZ) + +*** + +[HOME-PAGE](https://github.com/I-Am-Jakoby/PowerShell-for-Hackers) + +

(back to top)

From 037bcb77aa3f43011f566aff4fe5d45e383ef3a0 Mon Sep 17 00:00:00 2001 From: HackingMark <88377487+HackingMark@users.noreply.github.com> Date: Tue, 24 Oct 2023 17:10:47 +0200 Subject: [PATCH 2/6] Update Get-DBToken.md --- Functions/Get-DBToken.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Functions/Get-DBToken.md b/Functions/Get-DBToken.md index 7a9ca8e..c4c7071 100644 --- a/Functions/Get-DBToken.md +++ b/Functions/Get-DBToken.md @@ -44,7 +44,7 @@ function Get-DBToken { } Invoke-RestMethod -Uri https://www.dropbox.com/oauth2/token -Method Post -Headers $headersDB -Body $BodyDB } - +```

(back to top)

From b0e857728be3d0c4ab7e521f44ae2209e4fbde7a Mon Sep 17 00:00:00 2001 From: HackingMark <88377487+HackingMark@users.noreply.github.com> Date: Tue, 24 Oct 2023 17:16:54 +0200 Subject: [PATCH 3/6] Update Get-DBToken.md --- Functions/Get-DBToken.md | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/Functions/Get-DBToken.md b/Functions/Get-DBToken.md index c4c7071..28e4a54 100644 --- a/Functions/Get-DBToken.md +++ b/Functions/Get-DBToken.md @@ -1,4 +1,4 @@ -![Logo](https://github.com/I-Am-Jakoby/hak5-submissions/blob/main/Assets/logo-170-px.png?raw=true) +
@@ -52,9 +52,7 @@ Invoke-RestMethod -Uri https://www.dropbox.com/oauth2/token -Method Post -Header [//]: # (Examples of scripts that have used your function) Listed below are payloads that have used one of these functions: -[Acid Burn](https://github.com/I-Am-Jakoby/hak5-submissions/tree/main/OMG/Payloads/OMG-AcidBurn) -[JumpScare](https://github.com/I-Am-Jakoby/hak5-submissions/tree/main/OMG/Payloads/OMG-JumpScare)

(back to top)

@@ -62,26 +60,16 @@ Listed below are payloads that have used one of these functions: ## Contact -I am Jakoby +HackingMark


- - + + - - - - - - - - - -

From 35635a7c516b7c813eb6f1e9315746396be41cbe Mon Sep 17 00:00:00 2001 From: HackingMark <88377487+HackingMark@users.noreply.github.com> Date: Wed, 25 Oct 2023 11:32:44 +0200 Subject: [PATCH 4/6] Update Get-DBToken.md --- Functions/Get-DBToken.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Functions/Get-DBToken.md b/Functions/Get-DBToken.md index 28e4a54..45dee0f 100644 --- a/Functions/Get-DBToken.md +++ b/Functions/Get-DBToken.md @@ -1,4 +1,6 @@ - +

+ +

From 20a61adf2d9cd9e81d6fb99e4706f2f6bbb04611 Mon Sep 17 00:00:00 2001 From: HackingMark <88377487+HackingMark@users.noreply.github.com> Date: Wed, 25 Oct 2023 11:33:11 +0200 Subject: [PATCH 5/6] Update Get-DBToken.md --- Functions/Get-DBToken.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Functions/Get-DBToken.md b/Functions/Get-DBToken.md index 45dee0f..70e25cf 100644 --- a/Functions/Get-DBToken.md +++ b/Functions/Get-DBToken.md @@ -1,5 +1,5 @@ -

- +

+

From fc3fd76b08d5aa7dfb02c4a78647d4e885bc273a Mon Sep 17 00:00:00 2001 From: HackingMark <88377487+HackingMark@users.noreply.github.com> Date: Wed, 25 Oct 2023 11:34:51 +0200 Subject: [PATCH 6/6] Update Get-DBToken.md --- Functions/Get-DBToken.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/Functions/Get-DBToken.md b/Functions/Get-DBToken.md index 70e25cf..fb8037e 100644 --- a/Functions/Get-DBToken.md +++ b/Functions/Get-DBToken.md @@ -82,8 +82,6 @@ HackingMark ## Acknowledgments -* [Hak5](https://hak5.org/) -* [UberGuidoZ](https://github.com/UberGuidoZ) ***