Skip to content

Commit

Permalink
Updated Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
hausec committed Dec 12, 2021
1 parent 4d4f372 commit a64edc6
Showing 1 changed file with 10 additions and 37 deletions.
47 changes: 10 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,55 +10,28 @@ PowerZure is a PowerShell project created to assess and exploit resources within
Microsoft’s cloud platform, Azure. PowerZure was created out of the need for a
framework that can both perform reconnaissance **and** exploitation of Azure, AzureAD, and the associated resources.

## CLI vs. Portal

A common question is why use PowerZure or command line at all when you can just
login to the Azure web portal?

This is a fair question and to be honest, you can accomplish 90% of the
functionality in PowerZure through clicking around in the portal, however by
using the Azure PowerShell modules, you can perform tasks programmatically that
are tedious in the portal. E.g, listing the groups a user belongs to. In
addition, the ability to programmatically upload exploits instead of tinkering
around with the messy web UI. Finally, if you compromise a user who has used the
PowerShell module for Azure before and are able to steal the accesstoken.json
file, you can impersonate that user which effectively bypasses multi-factor
authentication.

## Why PowerShell?

While the offensive security industry has seen a decline in PowerShell usage due
to the advancements of defensive products and solutions, this project does not
contain any malicious code. PowerZure does not exploit bugs within Azure, it
exploits misconfigurations.

C\# was also explored for creating this project but there were two main
problems:

1. There were at least four different APIs being used for the project. MSOL,
Azure REST, Azure SDK, Graph.

2. The documentation for these APIs simply was too poor to continue. Entire
methods missing, namespaces typo’d, and other problems begged the question
of what advantage did C\# give over PowerShell (Answer: none)

Realistically, there is zero reason to ever run PowerZure on a victim’s machine.
Authentication is done by using an existing accesstoken file lifted from a victim's computer or by logging
in interactively with Az PowerShell (Connect-AzAccount).

## Requirements

The "Az" [Azure PowerShell](https://docs.microsoft.com/en-us/powershell/azure/?view=azps-4.2.0) module is the primary module used in PowerZure, as it handles most requests interacting with Azure resources. The Az module interacts using the Azure REST API.

The AzureAD PowerShell Module is also used and is for handling AzureAD requests. The AzureAD module uses the Microsoft Graph API.


## Usage

RTFM: https://powerzure.readthedocs.io

`ipmo C:\path\to\PowerZure.psd1`

If you have multiple subscriptions, you must set the main subscription with `Set-AzureSubscription`. If you do not do this, things will fail.

## Additional Resources

You can type `Show-AzureCurrentUser` to view the current signed-in user's roles in Azure and Azure AD.

You can also type `Get-AzureTargets` to compare your current signed-in user's roles and their scope to resources within Azure.

For target finding, I recommend using [AzureHound](https://posts.specterops.io/introducing-bloodhound-4-0-the-azure-update-9b2b26c5e350), the Azure component to [BloodHound](https://github.com/BloodHoundAD/BloodHound).

## Author & License

Author: Ryan Hausknecht (@haus3c)
Expand Down

0 comments on commit a64edc6

Please sign in to comment.