-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Technique: Access Virtual Machine using Bastion shareable link (#583
) * Add Azure Bastion shareable link technique * Add delay note for Bastion technique * Add techniqe documentation * Change category to persistence * Fix tf formatting * Error and string handling + technique rename * Update v2/internal/attacktechniques/azure/persistence/create-bastion-shareable-link/main.go Co-authored-by: Christophe Tafani-Dereeper <[email protected]> * Update v2/internal/attacktechniques/azure/persistence/create-bastion-shareable-link/main.go Co-authored-by: Christophe Tafani-Dereeper <[email protected]> * Cosmetic changes * Add shareable link + credentials to output * Fix error handling * autogen docs --------- Co-authored-by: Christophe Tafani-Dereeper <[email protected]> Co-authored-by: Christophe Tafani-Dereeper <[email protected]>
- Loading branch information
1 parent
62d42a6
commit e9d8e96
Showing
10 changed files
with
581 additions
and
3 deletions.
There are no files selected for viewing
84 changes: 84 additions & 0 deletions
84
docs/attack-techniques/azure/azure.create-bastion-shareable-link.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
--- | ||
title: Access Virtual Machine using Bastion shareable link | ||
--- | ||
|
||
# Access Virtual Machine using Bastion shareable link | ||
|
||
<span class="smallcaps w3-badge w3-orange w3-round w3-text-sand" title="This attack technique is slow to warm up and cleanup">slow</span> | ||
|
||
|
||
Platform: Azure | ||
|
||
## MITRE ATT&CK Tactics | ||
|
||
|
||
- Persistence | ||
|
||
## Description | ||
|
||
|
||
By utilizing the 'shareable link' feature on Bastions where it is enabled, an attacker can create a link to allow access to a virtual machine (VM) from untrusted networks. Public links generated for an Azure Bastion can allow VM network access to anyone with the generated URL. | ||
NOTE: This technique will take 10-15 minutes to warmup, and 10-15 minutes to cleanup. This is due to the time to deploy an Azure Bastion. | ||
|
||
References: | ||
|
||
- https://blog.karims.cloud/2022/11/26/yet-another-azure-vm-persistence.html | ||
- https://learn.microsoft.com/en-us/azure/bastion/shareable-link | ||
- https://microsoft.github.io/Azure-Threat-Research-Matrix/Persistence/AZT509/AZT509/ | ||
|
||
<span style="font-variant: small-caps;">Warm-up</span>: | ||
|
||
- Create a VM and VNet | ||
- Create an Azure Bastion host with access to the VM, and shareable links enabled | ||
NOTE: Warm-up and cleanup can each take 10-15 minutes to create and destroy the Azure Bastion instance | ||
|
||
<span style="font-variant: small-caps;">Detonation</span>: | ||
|
||
- Create an Azure Bastion shareable link with access to the VM | ||
|
||
## Instructions | ||
|
||
```bash title="Detonate with Stratus Red Team" | ||
stratus detonate azure.persistence.bastion-shareable-link | ||
``` | ||
## Detection | ||
|
||
Identify Azure events of type <code>Microsoft.Network/bastionHosts/createshareablelinks/action</code> and <code>Microsoft.Network/bastionHosts/getShareablelinks/action</code>. A sample of <code>createshareablelinks</code> is shown below (redacted for clarity). | ||
|
||
```json hl_lines="7" | ||
{ | ||
"category": { | ||
"value": "Administrative", | ||
"localizedValue": "Administrative" | ||
}, | ||
"level": "Informational", | ||
"operationName": { | ||
"value": "Microsoft.Network/bastionHosts/createshareablelinks/action", | ||
"localizedValue": "Creates shareable urls for the VMs under a bastion and returns the urls" | ||
}, | ||
"resourceGroupName": "stratus-red-team-shareable-link-rg-tz6o", | ||
"resourceProviderName": { | ||
"value": "Microsoft.Network", | ||
"localizedValue": "Microsoft.Network" | ||
}, | ||
"resourceType": { | ||
"value": "Microsoft.Network/bastionHosts", | ||
"localizedValue": "Microsoft.Network/bastionHosts" | ||
}, | ||
"resourceId": "[removed]/resourceGroups/stratus-red-team-shareable-link-rg-tz6o/providers/Microsoft.Network/bastionHosts/stratus-red-team-shareable-link-bastion-tz6o", | ||
"status": { | ||
"value": "Succeeded", | ||
"localizedValue": "Succeeded" | ||
}, | ||
"subStatus": { | ||
"value": "", | ||
"localizedValue": "" | ||
}, | ||
"properties": { | ||
"eventCategory": "Administrative", | ||
"entity": "[removed]/resourceGroups/stratus-red-team-shareable-link-rg-tz6o/providers/Microsoft.Network/bastionHosts/stratus-red-team-shareable-link-bastion-tz6o", | ||
"message": "Microsoft.Network/bastionHosts/createshareablelinks/action", | ||
"hierarchy": "[removed]" | ||
}, | ||
} | ||
``` |
89 changes: 89 additions & 0 deletions
89
docs/attack-techniques/azure/azure.persistence.create-bastion-shareable-link.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
--- | ||
title: Create Azure VM Bastion shareable link | ||
--- | ||
|
||
# Create Azure VM Bastion shareable link | ||
|
||
<span class="smallcaps w3-badge w3-orange w3-round w3-text-sand" title="This attack technique might be slow to warm up or detonate">slow</span> | ||
|
||
|
||
Platform: Azure | ||
|
||
## MITRE ATT&CK Tactics | ||
|
||
|
||
- Persistence | ||
|
||
## Description | ||
|
||
|
||
By utilizing the 'shareable link' feature on Bastions where it is enabled, an attacker can create a link to allow access to a virtual machine (VM) from untrusted networks. Public links generated for an Azure Bastion can allow VM network access to anyone with the generated URL. | ||
|
||
References: | ||
|
||
- https://blog.karims.cloud/2022/11/26/yet-another-azure-vm-persistence.html | ||
- https://learn.microsoft.com/en-us/azure/bastion/shareable-link | ||
- https://microsoft.github.io/Azure-Threat-Research-Matrix/Persistence/AZT509/AZT509/ | ||
|
||
<span style="font-variant: small-caps;">Warm-up</span>: | ||
|
||
- Create a VM and VNet | ||
- Create an Azure Bastion host with access to the VM, and shareable links enabled | ||
|
||
NOTE: Warm-up and cleanup can each take 10-15 minutes to create and destroy the Azure Bastion instance | ||
|
||
<span style="font-variant: small-caps;">Detonation</span>: | ||
|
||
- Create an Azure Bastion shareable link with access to the VM | ||
|
||
|
||
## Instructions | ||
|
||
```bash title="Detonate with Stratus Red Team" | ||
stratus detonate azure.persistence.create-bastion-shareable-link | ||
``` | ||
## Detection | ||
|
||
|
||
Identify Azure events of type <code>Microsoft.Network/bastionHosts/createshareablelinks/action</code> and <code>Microsoft.Network/bastionHosts/getShareablelinks/action</code>. A sample of <code>createshareablelinks</code> is shown below (redacted for clarity). | ||
|
||
```json hl_lines="7" | ||
{ | ||
{ | ||
"category": { | ||
"value": "Administrative", | ||
"localizedValue": "Administrative" | ||
}, | ||
"level": "Informational", | ||
"operationName": { | ||
"value": "Microsoft.Network/bastionHosts/createshareablelinks/action", | ||
"localizedValue": "Creates shareable urls for the VMs under a bastion and returns the urls" | ||
}, | ||
"resourceGroupName": "stratus-red-team-shareable-link-rg-tz6o", | ||
"resourceProviderName": { | ||
"value": "Microsoft.Network", | ||
"localizedValue": "Microsoft.Network" | ||
}, | ||
"resourceType": { | ||
"value": "Microsoft.Network/bastionHosts", | ||
"localizedValue": "Microsoft.Network/bastionHosts" | ||
}, | ||
"resourceId": "[removed]/resourceGroups/stratus-red-team-shareable-link-rg-tz6o/providers/Microsoft.Network/bastionHosts/stratus-red-team-shareable-link-bastion-tz6o", | ||
"status": { | ||
"value": "Succeeded", | ||
"localizedValue": "Succeeded" | ||
}, | ||
"subStatus": { | ||
"value": "", | ||
"localizedValue": "" | ||
}, | ||
"properties": { | ||
"eventCategory": "Administrative", | ||
"entity": "[removed]/resourceGroups/stratus-red-team-shareable-link-rg-tz6o/providers/Microsoft.Network/bastionHosts/stratus-red-team-shareable-link-bastion-tz6o", | ||
"message": "Microsoft.Network/bastionHosts/createshareablelinks/action", | ||
"hierarchy": "[removed]" | ||
}, | ||
} | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.