SlideShare a Scribd company logo
ATTACKING AZURE ENVIRONMENTS
WITH POWERSHELL
KARL FOSAAEN
2 Confidential & Proprietary
WHO AM I
Karl Fosaaen
 Pen Tester
 Password Cracker
 Social Engineer
 Blogger
 Cloud Enthusiast
 Homebrewer
https://github.com/netspi
https://blog.netspi.com/
Twitter - @kfosaaen
3 Confidential & Proprietary
TALK OVERVIEW
 Outline
 Intro to Dumping Azure Data
− Why/How
 Azure Services Covered
− AzureAD Users and Groups
− Storage Accounts
− AzureSQL
− Passwords
 Demos/Questions
− Sample Escalation Process
4 Confidential & Proprietary4 Confidential & Proprietary
DUMPING AZURE DATA
5 Confidential & Proprietary
DUMPING AZURE DATA
 Why do we want to dump data from Azure?
 We frequently get Azure creds during assessments
− Integrated AD (DCSync) + Fall2018 = Azure Access
 Regular domain users can usually list info about Azure
− Not regularly locked down
 Azure infrastructure audits
 Why can we do this?
 Azure management is available over the internet
 Frequently without MFA
 Why do we want to automate this?
 Doing a million PS commands by hand is annoying
6 Confidential & Proprietary
DUMPING AZURE DATA
 MicroBurst
 GitHub Link - https://github.com/NetSPI/MicroBurst
 Current Functions:
▪ Invoke-EnumerateAzureBlobs
▪ Invoke-EnumerateAzureSubDomains
▪ Get-AzurePasswords
▪ Get-AzureDomainInfo
▪ Get-MSOLDomainInfo
 Module Dependencies:
− Azure
− AzureRM
− MSOnline
7 Confidential & Proprietary
AZURE PERMISSIONS
 Permissions
 Three Important Levels
− Owner
− Contributor
− Reader
 Additional Roles
− Different Administrative/Reader Roles
− Not hugely important here
8 Confidential & Proprietary
DUMPING AZURE DATA
 Ways to dump data from Azure
 Azure Portal
− Pros – Graphical interface, easy to look at for review
− Cons – Not great at scale
 REST APIs
− Pros – Structured, JSON return data
− Cons – Authentication pain points, JSON data formatting
 PowerShell Cmdlets
− Pros
− Integrated Auth
− Data returned as pipeline-able objects
− Easier output
− Can handle data at scale
− Cons
− Limited threading options
9 Confidential & Proprietary
DUMPING AZURE DATA
 PowerShell Cmdlet Modules
 Azure Service Management (ASM)
− Older style of Azure Administration
 AzureRM
− Newer option for Resource Management
 AZ
− Latest option, currently in preview
− Will eventually replace AzureRM
 MSOnline
− Office 365 Administration
− When you don’t have rights to run the others
10 Confidential & Proprietary
DUMPING AZURE DATA
 Existing Tools
− Azucar - https://github.com/nccgroup/azucar/
− Didn’t quite fit my use cases
− Didn’t work well with several of the environments I tried
− AzuriteExplorer - https://github.com/mwrlabs/Azurite
− Similar functionality
− Doesn’t appear to be actively maintained (broken AzureRM cmdlets)
11 Confidential & Proprietary
DUMPING AZURE DATA
 Required Reading
 Pentesting Azure Applications - Matt Burrough
− https://nostarch.com/azure
 Clearly outlines testing process
 Explains why you should be doing this
 Good example scripts
12 Confidential & Proprietary12 Confidential & Proprietary
AZURE SERVICES
13 Confidential & Proprietary
AZURE SERVICES
 Here are some of the services that we’ll cover in this talk
 MicroBurst dumps more data than this, but we don’t have time
to cover everything
− Authenticated
− AzureAD Users and Groups
− Storage Accounts
− App Services
− AzureSQL
− NSG/Firewall Rules
− RBAC Roles
− Passwords
− Unauthenticated
− Azure Blob Storage Enumeration
− General Azure Services Enumeration
14 Confidential & Proprietary
AZURE SERVICES
 AzureAD
 Users and Groups
− Additional Recon Info
− Phone Numbers
− Enrolled Devices
− Third Party Apps (SSO Integration)
− Guest Users
 Practical Examples
− Password Guessing Attacks
− Phishing
− Accessing third party apps (AWS, WebEx, HR/Expense systems)
− Office365
15 Confidential & Proprietary
AZURE SERVICES
 Storage Accounts
 Naming Structure - netspiazure.*Service*.core.windows.net
 Data Types
− Blobs (blob)
− File Services (file)
− Data Tables (table)
− Queues (queue)
16 Confidential & Proprietary
AZURE SERVICES
 Anonymous Blob Enumeration
 Enumerate Storage Accounts
− DNS lookups on keywords
− Bing Searches to expand the scope
 Enumerate Public Folders
− Azure REST APIs
 Practical Examples
− Config files
− VHD files
− PII/Passwords
− Hosting Payloads
 Blog Post - https://blog.netspi.com/anonymously-enumerating-azure-file-resources/
17 Confidential & Proprietary
AZURE SERVICES
 Azure SQL
 Microsoft SQL – In the Cloud
 Data Access
− Firewall rules requirements
− SQL Management Studio
− Direct Portal Access
 Azure SQL as a C2 -------------→
 Practical Examples
− Dev ENV
− Open FW rules
− Weak SA Password
18 Confidential & Proprietary
AZURE SERVICES
 Passwords
 Key Vaults
− Keys
− Certs
− Passwords
 App Services Configurations
− Deployment Credentials
− Database Connection Strings
 Automation Accounts
− Credentials for Azure Automation accounts
 Blog Post - https://blog.netspi.com/get-azurepasswords/
19 Confidential & Proprietary
AZURE SERVICES
 Passwords
 Automation Accounts
− Credentials for Azure Automation accounts
− Process:
− Create Automation Script
− Import Automation Script
− Run Automation Script
− Get Automation Script Output
− Delete Automation Script
 Blog Post - https://blog.netspi.com/get-azurepasswords/
20 Confidential & Proprietary
MICROBURST USAGE
 MicroBurst
 How to Run the Tools
− Import the Module
− Import-Module C:MicroBurstMicroBurst.psm1 -Verbose
 CMD Examples
− Invoke-EnumerateAzureBlobs -Base microburst
− Invoke-EnumerateAzureSubDomains -Base microburst –Verbose
− Get-AzurePasswords -Verbose | Out-GridView
− Get-AzureDomainInfo –folder MicroBurst –Verbose
− Get-MSOLDomainInfo –folder MicroBurst –Verbose
21 Confidential & Proprietary21 Confidential & Proprietary
DEMO
22 Confidential & Proprietary
DEMO
 Sample Escalation
 Anonymously enumerate a public blob storage container (Invoke-EnumerateAzureBlobs)
− List files
− Download VHD
− Parse credentials from VHD file
− Crack hashes for Local Creds and Cached Creds
− Run VHD locally
− Login to VM (via RDP)
− Login to Azure with the cracked domain creds
 Connect as domain user and dump domain info (Get-AzureDomainInfo)
− List out users/services/etc.
 Dump remaining domain passwords for Azure subscription (Get-AzurePasswords)
− Get VPN access, pivot to internal domain/network
 Execute Commands on all Azure VMs (as nt authoritySYSTEM)
23 Confidential & Proprietary
24 Confidential & Proprietary
25 Confidential & Proprietary
CRACKING LOCAL ADMIN
26 Confidential & Proprietary
LOCAL ADMIN -> LOAD VHD IN HYPER-V
27 Confidential & Proprietary
LOCAL ADMIN -> RDP -> MIMIKATZ
*Ideal Situation
ktest also happens to be a DA
RDP is open to everywhere
28 Confidential & Proprietary
GRABBING CACHED CREDENTIALS
*Slightly more realistic situation
RDP is not open
But the system is domain joined
29 Confidential & Proprietary
CRACKING CACHED CREDENTIALS
*Slightly more realistic situation
RDP is not open
But the system is domain joined
30 Confidential & Proprietary
31 Confidential & Proprietary
32 Confidential & Proprietary
DEMO - CODE EXECUTION
 Execute Commands on all Azure VMs (as nt authoritySYSTEM)
− Invoke-AzureRmVMRunCommand
− Requires “Contributor” rights
 Practical Uses
− Mimikatz everything
− Task C2 agents
− Search for data
 Not Practical Uses
− Botnets
− Crypto miners
− Delete everything
 Mileage may vary depending on VM/Region
33 Confidential & Proprietary
DEMO - CODE EXECUTION
34 Confidential & Proprietary34 Confidential & Proprietary
FIXES/CONCLUSIONS
35 Confidential & Proprietary
FIXES / CONCLUSIONS
 Fixes
 Limit Azure Management access for non-admin users
 Watch out for misconfigurations in your Azure environment
 Try to get users to stop using Fall2018 as a password
 Set up MFA for all users with Azure access
 Conclusions
 The cloud is complicated, misconfigurations will happen
 But there are options for mitigating the risks
36 Confidential & Proprietary36 Confidential & Proprietary
QUESTIONS
37 Confidential & Proprietary
Thanks!
NetSPI co-workers for the QA/Testing/Ideas
All of you who came to a Saturday afternoon talk
And all of you watching this on YouTube
38 Confidential & Proprietary
ADDITIONAL INFO
 MicroBurst GitHub - https://github.com/NetSPI/MicroBurst
 NetSPI Blog - https://blog.netspi.com
 MicroBurst Specific Blogs:
 https://blog.netspi.com/get-azurepasswords/
 https://blog.netspi.com/anonymously-enumerating-azure-file-resources/
 https://blog.netspi.com/enumerating-azure-services/
 Twitter - @kfosaaen
 SlideShare - http://www.slideshare.net/kfosaaen
MINNEAPOLIS | NEW YORK | PORTLAND | DENVER | DALLAS
https://www.netspi.com
https://www.facebook.com/netspi
@NetSPI
https://www.slideshare.net/NetSPI

More Related Content

PDF
DerbyCon 8 - Attacking Azure Environments with PowerShell
PDF
Identity Security - Azure Identity Protection
PDF
Demystifying Initial Access in Azure
PDF
初心者でもわかるActive directoryの基本
PDF
[금융고객을 위한 AWS re:Invent 2022 re:Cap] 3.AWS reInvent 2022 Technical Highlights...
DOCX
SIZMA TESTLERİNDE BİLGİ TOPLAMA
PPTX
Azure Site Recovery Bootcamp
PPTX
SCUGJ第27回勉強会:ものすごくざっくりなAzure Filesの話
DerbyCon 8 - Attacking Azure Environments with PowerShell
Identity Security - Azure Identity Protection
Demystifying Initial Access in Azure
初心者でもわかるActive directoryの基本
[금융고객을 위한 AWS re:Invent 2022 re:Cap] 3.AWS reInvent 2022 Technical Highlights...
SIZMA TESTLERİNDE BİLGİ TOPLAMA
Azure Site Recovery Bootcamp
SCUGJ第27回勉強会:ものすごくざっくりなAzure Filesの話

What's hot (20)

PPTX
第15回JSSUG「Azure SQL Database 超入門」
PPTX
Azure AD とアプリケーションを SAML 連携する際に陥る事例と対処方法について
PDF
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
PDF
Web Uygulama Pentest Eğitimi
PDF
IDaaS を正しく活用するための認証基盤設計 ~Azure Active Directory の構成パターン詳細~
PPTX
Secure your M365 resources using Azure AD Identity Governance
PPTX
Azure App Service Deep Dive
PPTX
BTRisk Zararlı Yazılım Analizi Eğitimi Sunumu - Bölüm 2
PDF
【de:code 2020】 今すぐはじめたい SQL Database のかしこい使い分け術 前編
PPTX
AWS Simple Storage Service (s3)
PPTX
Azure - Identity as a service
PPTX
Azure Active Directory - An Introduction
PPTX
AWS S3 | Tutorial For Beginners | AWS S3 Bucket Tutorial | AWS Tutorial For B...
PDF
Access Security - Privileged Identity Management
PDF
Az 104 session 3 azure compute
PPTX
Azure AD Connect
PDF
CML-Personal (VIRL2)のインストールと基本機能
PDF
Insight into Azure Active Directory #02 - Azure AD B2B Collaboration New Feat...
PDF
AWS LambdaとDynamoDBがこんなにツライはずがない #ssmjp
PDF
Az 900 Session 3 Security, privacy, compliance, trust, pricing, SLA and Lifec...
第15回JSSUG「Azure SQL Database 超入門」
Azure AD とアプリケーションを SAML 連携する際に陥る事例と対処方法について
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
Web Uygulama Pentest Eğitimi
IDaaS を正しく活用するための認証基盤設計 ~Azure Active Directory の構成パターン詳細~
Secure your M365 resources using Azure AD Identity Governance
Azure App Service Deep Dive
BTRisk Zararlı Yazılım Analizi Eğitimi Sunumu - Bölüm 2
【de:code 2020】 今すぐはじめたい SQL Database のかしこい使い分け術 前編
AWS Simple Storage Service (s3)
Azure - Identity as a service
Azure Active Directory - An Introduction
AWS S3 | Tutorial For Beginners | AWS S3 Bucket Tutorial | AWS Tutorial For B...
Access Security - Privileged Identity Management
Az 104 session 3 azure compute
Azure AD Connect
CML-Personal (VIRL2)のインストールと基本機能
Insight into Azure Active Directory #02 - Azure AD B2B Collaboration New Feat...
AWS LambdaとDynamoDBがこんなにツライはずがない #ssmjp
Az 900 Session 3 Security, privacy, compliance, trust, pricing, SLA and Lifec...
Ad

Similar to BSides Portland - Attacking Azure Environments with PowerShell (20)

PDF
PoC Azure Administration
PPTX
[Toroman/Kranjac] Red Team vs. Blue Team in Microsoft Cloud
PPTX
Azure Fundamentals Part 3
 
PPTX
Azure Powershell. Azure Automation
PDF
O365Con18 - Red Team vs Blue Team - Sasha Kranjac & Mustafa Toroman
PPTX
Enter The Matrix Securing Azure’s Assets
PDF
Microsoft security compass presentation latest
PPTX
security-compass-presentation-microsft.pptx
PDF
Azure Incident Response Cheat Sheet.pdf
PDF
AZ-900 Summary with all information that
PPTX
Getting Started in Pentesting the Cloud: Azure
PDF
Css sf azure_8-9-17-microsoft_azure_security_overview_babak suzani_msft
PPTX
Introduction to basic governance in Azure - #GABDK
PDF
DEF CON 27 - DIRK JAN MOLLEMA - im in your cloud pwning your azure environment
PDF
Microsoft Windows Azure - Security Best Practices for Developing Windows Azur...
PDF
TechDays Finland 2020: Azuren tietoturva haltuun!
PDF
CSS17: Houston - Azure Shared Security Model Overview
PPTX
Microsoft Azure News - May 2025 - BAUG _
PDF
Presentation adopting cloud computing
PDF
Cortana Analytics Workshop: Cortana Analytics -- Security, Privacy & Compliance
PoC Azure Administration
[Toroman/Kranjac] Red Team vs. Blue Team in Microsoft Cloud
Azure Fundamentals Part 3
 
Azure Powershell. Azure Automation
O365Con18 - Red Team vs Blue Team - Sasha Kranjac & Mustafa Toroman
Enter The Matrix Securing Azure’s Assets
Microsoft security compass presentation latest
security-compass-presentation-microsft.pptx
Azure Incident Response Cheat Sheet.pdf
AZ-900 Summary with all information that
Getting Started in Pentesting the Cloud: Azure
Css sf azure_8-9-17-microsoft_azure_security_overview_babak suzani_msft
Introduction to basic governance in Azure - #GABDK
DEF CON 27 - DIRK JAN MOLLEMA - im in your cloud pwning your azure environment
Microsoft Windows Azure - Security Best Practices for Developing Windows Azur...
TechDays Finland 2020: Azuren tietoturva haltuun!
CSS17: Houston - Azure Shared Security Model Overview
Microsoft Azure News - May 2025 - BAUG _
Presentation adopting cloud computing
Cortana Analytics Workshop: Cortana Analytics -- Security, Privacy & Compliance
Ad

Recently uploaded (20)

PDF
SASE Traffic Flow - ZTNA Connector-1.pdf
PPTX
Digital Literacy And Online Safety on internet
PDF
Sims 4 Historia para lo sims 4 para jugar
PPT
Ethics in Information System - Management Information System
PDF
Exploring VPS Hosting Trends for SMBs in 2025
PPTX
E -tech empowerment technologies PowerPoint
PDF
Slides PDF The World Game (s) Eco Economic Epochs.pdf
PPTX
PptxGenJS_Demo_Chart_20250317130215833.pptx
PPTX
SAP Ariba Sourcing PPT for learning material
PPTX
522797556-Unit-2-Temperature-measurement-1-1.pptx
PPTX
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
DOCX
Unit-3 cyber security network security of internet system
PPTX
INTERNET------BASICS-------UPDATED PPT PRESENTATION
PPTX
Mathew Digital SEO Checklist Guidlines 2025
PDF
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
PDF
Unit-1 introduction to cyber security discuss about how to secure a system
PDF
Decoding a Decade: 10 Years of Applied CTI Discipline
PPTX
Slides PPTX World Game (s) Eco Economic Epochs.pptx
PDF
Tenda Login Guide: Access Your Router in 5 Easy Steps
PPTX
newyork.pptxirantrafgshenepalchinachinane
SASE Traffic Flow - ZTNA Connector-1.pdf
Digital Literacy And Online Safety on internet
Sims 4 Historia para lo sims 4 para jugar
Ethics in Information System - Management Information System
Exploring VPS Hosting Trends for SMBs in 2025
E -tech empowerment technologies PowerPoint
Slides PDF The World Game (s) Eco Economic Epochs.pdf
PptxGenJS_Demo_Chart_20250317130215833.pptx
SAP Ariba Sourcing PPT for learning material
522797556-Unit-2-Temperature-measurement-1-1.pptx
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
Unit-3 cyber security network security of internet system
INTERNET------BASICS-------UPDATED PPT PRESENTATION
Mathew Digital SEO Checklist Guidlines 2025
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
Unit-1 introduction to cyber security discuss about how to secure a system
Decoding a Decade: 10 Years of Applied CTI Discipline
Slides PPTX World Game (s) Eco Economic Epochs.pptx
Tenda Login Guide: Access Your Router in 5 Easy Steps
newyork.pptxirantrafgshenepalchinachinane

BSides Portland - Attacking Azure Environments with PowerShell

  • 1. ATTACKING AZURE ENVIRONMENTS WITH POWERSHELL KARL FOSAAEN
  • 2. 2 Confidential & Proprietary WHO AM I Karl Fosaaen  Pen Tester  Password Cracker  Social Engineer  Blogger  Cloud Enthusiast  Homebrewer https://github.com/netspi https://blog.netspi.com/ Twitter - @kfosaaen
  • 3. 3 Confidential & Proprietary TALK OVERVIEW  Outline  Intro to Dumping Azure Data − Why/How  Azure Services Covered − AzureAD Users and Groups − Storage Accounts − AzureSQL − Passwords  Demos/Questions − Sample Escalation Process
  • 4. 4 Confidential & Proprietary4 Confidential & Proprietary DUMPING AZURE DATA
  • 5. 5 Confidential & Proprietary DUMPING AZURE DATA  Why do we want to dump data from Azure?  We frequently get Azure creds during assessments − Integrated AD (DCSync) + Fall2018 = Azure Access  Regular domain users can usually list info about Azure − Not regularly locked down  Azure infrastructure audits  Why can we do this?  Azure management is available over the internet  Frequently without MFA  Why do we want to automate this?  Doing a million PS commands by hand is annoying
  • 6. 6 Confidential & Proprietary DUMPING AZURE DATA  MicroBurst  GitHub Link - https://github.com/NetSPI/MicroBurst  Current Functions: ▪ Invoke-EnumerateAzureBlobs ▪ Invoke-EnumerateAzureSubDomains ▪ Get-AzurePasswords ▪ Get-AzureDomainInfo ▪ Get-MSOLDomainInfo  Module Dependencies: − Azure − AzureRM − MSOnline
  • 7. 7 Confidential & Proprietary AZURE PERMISSIONS  Permissions  Three Important Levels − Owner − Contributor − Reader  Additional Roles − Different Administrative/Reader Roles − Not hugely important here
  • 8. 8 Confidential & Proprietary DUMPING AZURE DATA  Ways to dump data from Azure  Azure Portal − Pros – Graphical interface, easy to look at for review − Cons – Not great at scale  REST APIs − Pros – Structured, JSON return data − Cons – Authentication pain points, JSON data formatting  PowerShell Cmdlets − Pros − Integrated Auth − Data returned as pipeline-able objects − Easier output − Can handle data at scale − Cons − Limited threading options
  • 9. 9 Confidential & Proprietary DUMPING AZURE DATA  PowerShell Cmdlet Modules  Azure Service Management (ASM) − Older style of Azure Administration  AzureRM − Newer option for Resource Management  AZ − Latest option, currently in preview − Will eventually replace AzureRM  MSOnline − Office 365 Administration − When you don’t have rights to run the others
  • 10. 10 Confidential & Proprietary DUMPING AZURE DATA  Existing Tools − Azucar - https://github.com/nccgroup/azucar/ − Didn’t quite fit my use cases − Didn’t work well with several of the environments I tried − AzuriteExplorer - https://github.com/mwrlabs/Azurite − Similar functionality − Doesn’t appear to be actively maintained (broken AzureRM cmdlets)
  • 11. 11 Confidential & Proprietary DUMPING AZURE DATA  Required Reading  Pentesting Azure Applications - Matt Burrough − https://nostarch.com/azure  Clearly outlines testing process  Explains why you should be doing this  Good example scripts
  • 12. 12 Confidential & Proprietary12 Confidential & Proprietary AZURE SERVICES
  • 13. 13 Confidential & Proprietary AZURE SERVICES  Here are some of the services that we’ll cover in this talk  MicroBurst dumps more data than this, but we don’t have time to cover everything − Authenticated − AzureAD Users and Groups − Storage Accounts − App Services − AzureSQL − NSG/Firewall Rules − RBAC Roles − Passwords − Unauthenticated − Azure Blob Storage Enumeration − General Azure Services Enumeration
  • 14. 14 Confidential & Proprietary AZURE SERVICES  AzureAD  Users and Groups − Additional Recon Info − Phone Numbers − Enrolled Devices − Third Party Apps (SSO Integration) − Guest Users  Practical Examples − Password Guessing Attacks − Phishing − Accessing third party apps (AWS, WebEx, HR/Expense systems) − Office365
  • 15. 15 Confidential & Proprietary AZURE SERVICES  Storage Accounts  Naming Structure - netspiazure.*Service*.core.windows.net  Data Types − Blobs (blob) − File Services (file) − Data Tables (table) − Queues (queue)
  • 16. 16 Confidential & Proprietary AZURE SERVICES  Anonymous Blob Enumeration  Enumerate Storage Accounts − DNS lookups on keywords − Bing Searches to expand the scope  Enumerate Public Folders − Azure REST APIs  Practical Examples − Config files − VHD files − PII/Passwords − Hosting Payloads  Blog Post - https://blog.netspi.com/anonymously-enumerating-azure-file-resources/
  • 17. 17 Confidential & Proprietary AZURE SERVICES  Azure SQL  Microsoft SQL – In the Cloud  Data Access − Firewall rules requirements − SQL Management Studio − Direct Portal Access  Azure SQL as a C2 -------------→  Practical Examples − Dev ENV − Open FW rules − Weak SA Password
  • 18. 18 Confidential & Proprietary AZURE SERVICES  Passwords  Key Vaults − Keys − Certs − Passwords  App Services Configurations − Deployment Credentials − Database Connection Strings  Automation Accounts − Credentials for Azure Automation accounts  Blog Post - https://blog.netspi.com/get-azurepasswords/
  • 19. 19 Confidential & Proprietary AZURE SERVICES  Passwords  Automation Accounts − Credentials for Azure Automation accounts − Process: − Create Automation Script − Import Automation Script − Run Automation Script − Get Automation Script Output − Delete Automation Script  Blog Post - https://blog.netspi.com/get-azurepasswords/
  • 20. 20 Confidential & Proprietary MICROBURST USAGE  MicroBurst  How to Run the Tools − Import the Module − Import-Module C:MicroBurstMicroBurst.psm1 -Verbose  CMD Examples − Invoke-EnumerateAzureBlobs -Base microburst − Invoke-EnumerateAzureSubDomains -Base microburst –Verbose − Get-AzurePasswords -Verbose | Out-GridView − Get-AzureDomainInfo –folder MicroBurst –Verbose − Get-MSOLDomainInfo –folder MicroBurst –Verbose
  • 21. 21 Confidential & Proprietary21 Confidential & Proprietary DEMO
  • 22. 22 Confidential & Proprietary DEMO  Sample Escalation  Anonymously enumerate a public blob storage container (Invoke-EnumerateAzureBlobs) − List files − Download VHD − Parse credentials from VHD file − Crack hashes for Local Creds and Cached Creds − Run VHD locally − Login to VM (via RDP) − Login to Azure with the cracked domain creds  Connect as domain user and dump domain info (Get-AzureDomainInfo) − List out users/services/etc.  Dump remaining domain passwords for Azure subscription (Get-AzurePasswords) − Get VPN access, pivot to internal domain/network  Execute Commands on all Azure VMs (as nt authoritySYSTEM)
  • 23. 23 Confidential & Proprietary
  • 24. 24 Confidential & Proprietary
  • 25. 25 Confidential & Proprietary CRACKING LOCAL ADMIN
  • 26. 26 Confidential & Proprietary LOCAL ADMIN -> LOAD VHD IN HYPER-V
  • 27. 27 Confidential & Proprietary LOCAL ADMIN -> RDP -> MIMIKATZ *Ideal Situation ktest also happens to be a DA RDP is open to everywhere
  • 28. 28 Confidential & Proprietary GRABBING CACHED CREDENTIALS *Slightly more realistic situation RDP is not open But the system is domain joined
  • 29. 29 Confidential & Proprietary CRACKING CACHED CREDENTIALS *Slightly more realistic situation RDP is not open But the system is domain joined
  • 30. 30 Confidential & Proprietary
  • 31. 31 Confidential & Proprietary
  • 32. 32 Confidential & Proprietary DEMO - CODE EXECUTION  Execute Commands on all Azure VMs (as nt authoritySYSTEM) − Invoke-AzureRmVMRunCommand − Requires “Contributor” rights  Practical Uses − Mimikatz everything − Task C2 agents − Search for data  Not Practical Uses − Botnets − Crypto miners − Delete everything  Mileage may vary depending on VM/Region
  • 33. 33 Confidential & Proprietary DEMO - CODE EXECUTION
  • 34. 34 Confidential & Proprietary34 Confidential & Proprietary FIXES/CONCLUSIONS
  • 35. 35 Confidential & Proprietary FIXES / CONCLUSIONS  Fixes  Limit Azure Management access for non-admin users  Watch out for misconfigurations in your Azure environment  Try to get users to stop using Fall2018 as a password  Set up MFA for all users with Azure access  Conclusions  The cloud is complicated, misconfigurations will happen  But there are options for mitigating the risks
  • 36. 36 Confidential & Proprietary36 Confidential & Proprietary QUESTIONS
  • 37. 37 Confidential & Proprietary Thanks! NetSPI co-workers for the QA/Testing/Ideas All of you who came to a Saturday afternoon talk And all of you watching this on YouTube
  • 38. 38 Confidential & Proprietary ADDITIONAL INFO  MicroBurst GitHub - https://github.com/NetSPI/MicroBurst  NetSPI Blog - https://blog.netspi.com  MicroBurst Specific Blogs:  https://blog.netspi.com/get-azurepasswords/  https://blog.netspi.com/anonymously-enumerating-azure-file-resources/  https://blog.netspi.com/enumerating-azure-services/  Twitter - @kfosaaen  SlideShare - http://www.slideshare.net/kfosaaen
  • 39. MINNEAPOLIS | NEW YORK | PORTLAND | DENVER | DALLAS https://www.netspi.com https://www.facebook.com/netspi @NetSPI https://www.slideshare.net/NetSPI