You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/pentesting-cloud/azure-security/README.md
+3-247Lines changed: 3 additions & 247 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -95,7 +95,7 @@ az account management-group list #Not allowed by default
95
95
96
96
{{#tab name="AzureAD" }}
97
97
98
-
```powershell
98
+
```bash
99
99
#Get the current session state
100
100
Get-AzureADCurrentSessionInfo
101
101
#Get details of the current tenant
@@ -106,7 +106,7 @@ Get-AzureADTenantDetail
106
106
107
107
{{#tab name="Az PowerShell" }}
108
108
109
-
```powershell
109
+
```bash
110
110
# Get the information about the current context (Account, Tenant, Subscription etc.)
111
111
Get-AzContext
112
112
# List all available contexts
@@ -130,7 +130,7 @@ Get-AzRoleAssignment -SignInName [email protected] # For current user
130
130
>
131
131
> You can get the same info in the **web console** going to [https://portal.azure.com/#view/HubsExtension/BrowseAll](https://portal.azure.com/#view/HubsExtension/BrowseAll) or searching for "All resources"
132
132
133
-
### ENtra ID Enumeration
133
+
### Entra ID Enumeration
134
134
135
135
By default, any user should have **enough permissions to enumerate** things such us, users, groups, roles, service principals... (check [default AzureAD permissions](az-basic-information/index.html#default-user-permissions)).\
136
136
You can find here a guide:
@@ -155,250 +155,6 @@ Use portal.azure.com and select the shell, or use shell.azure.com, for a bash or
155
155
156
156
Azure DevOps is separate from Azure. It has repositories, pipelines (yaml or release), boards, wiki, and more. Variable Groups are used to store variable values and secrets.
157
157
158
-
## Debug | MitM az cli
159
-
160
-
Using the parameter **`--debug`** it's possible to see all the requests the tool **`az`** is sending:
161
-
162
-
```bash
163
-
az account management-group list --output table --debug
164
-
```
165
-
166
-
In order to do a **MitM** to the tool and **check all the requests** it's sending manually you can do:
MATCH p=(m:AZUser)-[r:MemberOf]->(n) WHERE NOT m.objectid CONTAINS 'S-1-5' RETURN p
282
-
## Privileged Service Principals
283
-
MATCH p = (g:AZServicePrincipal)-[r]->(n) RETURN p
284
-
## Owners of Azure Applications
285
-
MATCH p = (n)-[r:AZOwns]->(g:AZApp) RETURN p
286
-
## Paths to VMs
287
-
MATCH p = (n)-[r]->(g: AZVM) RETURN p
288
-
## Paths to KeyVault
289
-
MATCH p = (n)-[r]->(g:AZKeyVault) RETURN p
290
-
## Paths to Azure Resource Group
291
-
MATCH p = (n)-[r]->(g:AZResourceGroup) RETURN p
292
-
## On-Prem users with edges to Azure
293
-
MATCH p=(m:User)-[r:AZResetPassword|AZOwns|AZUserAccessAdministrator|AZContributor|AZAddMembers|AZGlobalAdmin|AZVMContributor|AZOwnsAZAvereContributor]->(n) WHERE m.objectid CONTAINS 'S-1-5-21' RETURN p
294
-
## All Azure AD Groups that are synchronized with On-Premise AD
295
-
MATCH (n:Group) WHERE n.objectid CONTAINS 'S-1-5' AND n.azsyncid IS NOT NULL RETURN n
296
-
```
297
-
298
-
### [Azucar](https://github.com/nccgroup/azucar)
299
-
300
-
```bash
301
-
# You should use an account with at least read-permission on the assets you want to access
#A good place to start is to authenticate with the Get-GraphTokens module. This module will launch a device-code login, allowing you to authenticate the session from a browser session. Access and refresh tokens will be written to the global $tokens variable. To use them with other GraphRunner modules use the Tokens flag (Example. Invoke-DumpApps -Tokens $tokens)
350
-
Import-Module .\GraphRunner.ps1
351
-
Get-GraphTokens
352
-
353
-
#Invoke-GraphRecon
354
-
#This module gathers information about the tenant including the primary contact info, directory sync settings, and user settings such as if users have the ability to create apps, create groups, or consent to apps.
355
-
Invoke-GraphRecon -Tokens $tokens -PermissionEnum
356
-
357
-
#Invoke-DumpCAPS
358
-
#A module to dump conditional access policies from a tenant.
359
-
Invoke-GraphRecon -Tokens $tokens -PermissionEnum
360
-
361
-
#Invoke-DumpCAPS
362
-
#A module to dump conditional access policies from a tenant.
363
-
Invoke-DumpCAPS -Tokens $tokens -ResolveGuids
364
-
365
-
#Invoke-DumpApps
366
-
#This module helps identify malicious app registrations. It will dump a list of Azure app registrations from the tenant including permission scopes and users that have consented to the apps. Additionally, it will list external apps that are not owned by the current tenant or by Microsoft's main app tenant. This is a good way to find third-party external apps that users may have consented to.
367
-
Invoke-DumpApps -Tokens $tokens
368
-
369
-
#Get-AzureADUsers
370
-
#Gather the full list of users from the directory.
#Gets groups that may be able to be modified by the current user
379
-
Get-UpdatableGroups -Tokens $tokens
380
-
381
-
#Get-DynamicGroups
382
-
#Finds dynamic groups and displays membership rules
383
-
Get-DynamicGroups -Tokens $tokens
384
-
385
-
#Get-SharePointSiteURLs
386
-
#Gets a list of SharePoint site URLs visible to the current user
387
-
Get-SharePointSiteURLs -Tokens $tokens
388
-
389
-
#Invoke-GraphOpenInboxFinder
390
-
#This module attempts to locate mailboxes in a tenant that have allowed other users to read them. By providing a userlist the module will attempt to access the inbox of each user and display if it was successful. The access token needs to be scoped to Mail.Read.Shared or Mail.ReadWrite.Shared for this to work.
#This module attempts to gather a tenant ID associated with a domain.
395
-
Get-TenantID -Domain
396
-
397
-
#Invoke-GraphRunner
398
-
#Runs Invoke-GraphRecon, Get-AzureADUsers, Get-SecurityGroups, Invoke-DumpCAPS, Invoke-DumpApps, and then uses the default_detectors.json file to search with Invoke-SearchMailbox, Invoke-SearchSharePointAndOneDrive, and Invoke-SearchTeams.
0 commit comments