Andrew Johnson @secprez | Sacha Faust @sachafaust | Cloud & Enterprise Red T eam
CLOUD POST EXPLOITATION Andrew Johnson @secprez | Sacha Faust - - PowerPoint PPT Presentation
CLOUD POST EXPLOITATION Andrew Johnson @secprez | Sacha Faust - - PowerPoint PPT Presentation
CLOUD POST EXPLOITATION Andrew Johnson @secprez | Sacha Faust @sachafaust | Cloud & Enterprise Red T eam ake Aways Azure Overview Key T Cloud Pivots Trends and Countermeasures 2 eam Red Team Success Culture Collective Growth
Key T ake Aways
2
Azure Overview Cloud Pivots Trends and Countermeasures
C+E Red T eam
- Red Team Success
MTTC + MTTO MTTD + MTTR
- Clear rules of engagement
- P0 focus – break glass
scenarios
- Cloud vs Cloud
- Shift from Operation to
Recovery Games Culture – Collective Growth Mindset
- “Let’s make it harder!”
- Engineering Focused
- Diplomatic
- Operate like Next Generation APT™
3
Crawl Walk Run Adapt Adapt+
Azure Crash Course
Domain Controller SQL Server File Server Application Server Internet Network ACL, Ingress & Egress Monitoring Private Network
Production Domain
Azure VM (IAAS) Azure Storage SQL Azure Azure Analytics (Logging) Azure VNET VM VM Azure Redis Cache Azure PAAS Service Azure Document DB Azure Key Vault
5
Server Domain Domain Admin Pass the Hash Private IPs RDP / SSH
Services
Subscription
Subscription Admin
Credential Pivot Public IPs Management APIs
Cloud Mindset
6
Pivoting
Basic - Storage to VM
Option 1 – Exfil running VM Shadow copy VM Start-AzureStorageBlobCopy Option 2 –override VM when turned
- ff
Research Area – Tamper running VM
8
Attacking Hosted Services - PAAS
- Hosted Services are created from three
elements:
- Certificates hosting in the cloud service
- A configuration file containing secrets and other
service metadata
- A package containing the code and resources
Hosted Service
Certificates Configuration (cscfg) Package (cspkg)
PAAS 101
9
RDP Extension
Step 1 – Get role configuration Get-AzureDeployment Step 2 – Create Extension New- AzureServiceRemoteDesktopExtensi
- nConfig
Step 4 – Remove when done Remove- PAASRemoteAccessExtension Step 3 – Push tampered package Set-AzureDeployment
Remote Desktop
10
Platform As a Service (PAAS)
11
PAAS Certificates
Step 1 – Query management API to get Certificates available Get-AzureDeployment Step 2 – Create custom service package
- Add target certificate thumbprint
- Make service dump certs from OS
and exfil Step 3 – Initiate deployment Set-AzureDeployment with Use upgrade flag to staging slot Step 4 – Wait for cert and pivot
12
PAAS Upgrade
Step 1 - Exfiltrate cspkg file Get Package Get-AzureBlobContent Step 2 – Find/Create elevated task and bootstrap malware Step 3 – Update file hash Step 4 – Push tampered package Set-AzureBlobContent Step 5 – Initiate deployment Set-AzureDeployment with Use upgrade flag
13
Hybrid Pivot
On Premise to Cloud Pivot!
14
Persistence
- Service Principals support
multiple passwords
- App provides rich landscape
Identity
- Subscription administrators
- Management Certificates
Subscription
- Storage Account Key
- Secure Access Url (SAS) key (offline
minting)
Storage Account
- Tamper Deployment
Cloud Service
- OS persistence
- Override
- Shadow copy
Virtual Machine
- Add resource to resource group (VM)
- Modify Network Security Group
Network
Persistence - Pyramid
17
As an operator/attacker, do you have enough visibility in the risks you are accepting? Indicators of
- Monitoring (IOM)
- Detection (IOD)
- Recovery (IOR)
IOM/D Trends
Rise of Anomaly Detection
Azure Security Center Azure Security Center Anomaly Detection API – Cortana Intelligence Gallery https://aka.ms/infiltrate2017-anomalyapi “Anomaly Detection is an API built with Azure Machine Learning that is useful for detecting different types of anomalous patterns in your time series data”
20
IOM/D Trends
Purple Teaming – https://aka.ms/scalingredteam
21
IOM/D Trends
The commoditization of Threat Intel
Azure Security Center
22
IOM/D Trends
“Stealth” features in Defense
VHD Azure Storage VM
DATA PLANE Forensic @Scale Off-Node Analysis
VHD VHD VHD VHD VHD VHD
CONTROL PLANE
23
Trends – Engineering
- Monoculture
- Shift from cost center to
profit
- Used to scale - system
engineering and data scientist
- Used to very high
expectation – Azure 99.9%
https://www.youtube.com/watch?v=R31Ez1XJEeI
Trends – Engineering
Assume Breach mindset
Counter Measures …
26
Specific/sequential targeting Effective reconnaissance Practiced tool usage Sophisticated planning Social engineering Advanced & persistent
Infiltrate 2015 - Data Driven Offence https://vimeo.com/133292422
Diversionary T actics Machine Learning Varied Persistence Intelligence Driven Multi-FrontAssaults
Counter Measures …
27
Thank you
Sacha cha Faust ust @sachafaust achafaust Andr drew ew Joh
- hnson