mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2025-12-30 22:50:43 -08:00
Y
This commit is contained in:
@@ -945,10 +945,6 @@ Get-AzDenyAssignment # Get from current subscription
|
||||
Get-AzDenyAssignment -Scope '/subscriptions/96231a05-34ce-4eb4-aa6a-70759cbb5e83/resourcegroups/testRG/providers/Microsoft.Web/sites/site1'
|
||||
```
|
||||
|
||||
{{#endtab }}
|
||||
{{#endtabs }}
|
||||
```
|
||||
|
||||
{{#endtab }}
|
||||
|
||||
{{#tab name="Raw" }}
|
||||
|
||||
@@ -18,16 +18,16 @@ There aren't permissions assigned to this service, therefore the aren't privileg
|
||||
|
||||
## References
|
||||
|
||||
* [https://learn.microsoft.com/en-us/azure/cloud-shell/overview](https://learn.microsoft.com/en-us/azure/cloud-shell/overview)
|
||||
* [https://learn.microsoft.com/en-us/azure/cloud-shell/features](https://learn.microsoft.com/en-us/azure/cloud-shell/features)
|
||||
* [https://learn.microsoft.com/en-us/azure/cloud-shell/using-the-shell-window](https://learn.microsoft.com/en-us/azure/cloud-shell/using-the-shell-window)
|
||||
- [https://learn.microsoft.com/en-us/azure/cloud-shell/overview](https://learn.microsoft.com/en-us/azure/cloud-shell/overview)
|
||||
- [https://learn.microsoft.com/en-us/azure/cloud-shell/features](https://learn.microsoft.com/en-us/azure/cloud-shell/features)
|
||||
- [https://learn.microsoft.com/en-us/azure/cloud-shell/using-the-shell-window](https://learn.microsoft.com/en-us/azure/cloud-shell/using-the-shell-window)
|
||||
|
||||
|
||||
## Persistence
|
||||
|
||||
{% content-ref url="../az-privilege-escalation/az-cloud-shell-persistence.md" %}
|
||||
[az-cloud-shell-persistence.md](../az-privilege-escalation/az-cloud-shell-persistence.md)
|
||||
{% endcontent-ref %}
|
||||
{{#ref}}
|
||||
../az-persistence/az-cloud-shell-persistence.md
|
||||
{{#endref}}
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
|
||||
@@ -13,11 +13,9 @@ One key aspect of CosmosDB is Azure Cosmos Account. **Azure Cosmos Account**, ac
|
||||
### NoSQL (sql)
|
||||
The Azure Cosmos DB NoSQL API is a document-based API that uses JSON as its data format. It provides a SQL-like query syntax for querying JSON objects, making it suitable for working with structured and semi-structured data. The endpoint of the service is:
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```bash
|
||||
https://<Account-Name>.documents.azure.com:443/
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
#### Databases
|
||||
Within an account, you can create one or more databases, which serve as logical groupings of containers. A database acts as a boundary for resource management and user permissions. Databases can either share provisioned throughput across their containers or allocate dedicated throughput to individual containers.
|
||||
@@ -28,9 +26,8 @@ The core unit of data storage is the container, which holds JSON documents and i
|
||||
|
||||
#### Enumeration
|
||||
|
||||
{% tabs %}
|
||||
{% tab title="az cli" %}
|
||||
{% code overflow="wrap" %}
|
||||
{{#tabs }}
|
||||
{{#tab name="az cli" }}
|
||||
```bash
|
||||
# CosmoDB Account
|
||||
## List Azure Cosmos DB database accounts.
|
||||
@@ -66,11 +63,9 @@ az cosmosdb sql trigger list --account-name <AccountName> --container-name <Cont
|
||||
az cosmosdb sql user-defined-function list --account-name <AccountName> --container-name <ContainerName> --database-name <DatabaseName> --resource-group <ResourceGroupName>
|
||||
|
||||
```
|
||||
{% endcode %}
|
||||
{% endtab %}
|
||||
{{#endtab }}
|
||||
|
||||
{% tab title="Az PowerShell" %}
|
||||
{% code overflow="wrap" %}
|
||||
{{#tab name="Az Powershell" }}
|
||||
```bash
|
||||
Get-Command -Module Az.CosmosD
|
||||
|
||||
@@ -113,14 +108,12 @@ Get-AzCosmosDBSqlTrigger -ResourceGroupName "<ResourceGroupName>" -AccountName "
|
||||
# List all user-defined functions (UDFs) in a specific Cosmos DB SQL container.
|
||||
Get-AzCosmosDBSqlUserDefinedFunction -ResourceGroupName "<ResourceGroupName>" -AccountName "<AccountName>" -DatabaseName "<DatabaseName>" -ContainerName "<ContainerName>"
|
||||
```
|
||||
{% endcode %}
|
||||
{% endtab %}
|
||||
{% endtabs %}
|
||||
{{#endtab }}
|
||||
{{#endtabs }}
|
||||
|
||||
#### Connection
|
||||
|
||||
To connect the azure-cosmosDB (pip install azure-cosmos) library is needed. Additionally the endpoint and the key are crutial components to make the connection.
|
||||
{% code overflow="wrap" %}
|
||||
```python
|
||||
from azure.cosmos import CosmosClient, PartitionKey
|
||||
|
||||
@@ -159,11 +152,9 @@ print("All items in the container:")
|
||||
for item in all_items:
|
||||
print(item)
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
Another way of stablishing a connection is to use the **DefaultAzureCredential()**. Just need to login (az login) with the account that has the permissions and execute it. For this case a role assigment must be done, giving the necesary permissions (see for mor)
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```python
|
||||
from azure.identity import DefaultAzureCredential
|
||||
from azure.cosmos import CosmosClient
|
||||
@@ -188,16 +179,13 @@ item = {
|
||||
container.create_item(item)
|
||||
print("Document inserted.")
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
### MongoDB
|
||||
The MongoDB NoSQL API is a document-based API that uses JSON-like BSON (Binary JSON) as its data format. It provides a query language with aggregation capabilities, making it suitable for working with structured, semi-structured, and unstructured data. The endpoint of the service typically follows this format:
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```bash
|
||||
mongodb://<hostname>:<port>/<database>
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
#### Databases
|
||||
In MongoDB, you can create one or more databases within an instance. Each database serves as a logical grouping of collections and provides a boundary for resource organization and management. Databases help separate and manage data logically, such as for different applications or projects.
|
||||
@@ -207,9 +195,8 @@ The core unit of data storage in MongoDB is the collection, which holds document
|
||||
|
||||
#### Enumeration
|
||||
|
||||
{% tabs %}
|
||||
{% tab title="az cli" %}
|
||||
{% code overflow="wrap" %}
|
||||
{{#tabs }}
|
||||
{{#tab name="az cli" }}
|
||||
```bash
|
||||
# CosmoDB Account
|
||||
## List Azure Cosmos DB database accounts.
|
||||
@@ -236,11 +223,9 @@ az cosmosdb mongodb role definition list --account-name <AccountName> --resource
|
||||
# List all user definitions for MongoDB within an Azure Cosmos DB account
|
||||
az cosmosdb mongodb user definition list --account-name <AccountName> --resource-group <ResourceGroupName>
|
||||
```
|
||||
{% endcode %}
|
||||
{% endtab %}
|
||||
{{#endtab }}
|
||||
|
||||
{% tab title="Az PowerShell" %}
|
||||
{% code overflow="wrap" %}
|
||||
{{#tab name="Az Powershell" }}
|
||||
```bash
|
||||
Get-Command -Module Az.CosmosDB
|
||||
|
||||
@@ -272,14 +257,12 @@ Get-AzCosmosDBMongoDBDatabaseThroughput -AccountName <account-name> -ResourceGro
|
||||
Get-AzCosmosDBMongoDBRoleDefinition -AccountName <account-name> -ResourceGroupName <resource-group-name>
|
||||
|
||||
```
|
||||
{% endcode %}
|
||||
{% endtab %}
|
||||
{% endtabs %}
|
||||
{{#endtab }}
|
||||
{{#endtabs }}
|
||||
|
||||
#### Connection
|
||||
|
||||
Here the password you can find them with the keys or with the method decribed in the privesc section.
|
||||
{% code overflow="wrap" %}
|
||||
```python
|
||||
from pymongo import MongoClient
|
||||
|
||||
@@ -312,26 +295,25 @@ document = {
|
||||
result = collection.insert_one(document)
|
||||
print(f"Inserted document with ID: {result.inserted_id}")
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
## References
|
||||
|
||||
* [https://learn.microsoft.com/en-us/azure/cosmos-db/choose-api](https://learn.microsoft.com/en-us/azure/cosmos-db/choose-api)
|
||||
* [https://learn.microsoft.com/en-us/azure/cosmos-db/](https://learn.microsoft.com/en-us/azure/cosmos-db/)
|
||||
* [https://learn.microsoft.com/en-us/azure/cosmos-db/introduction](https://learn.microsoft.com/en-us/azure/cosmos-db/introduction)
|
||||
* [https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/security/how-to-grant-data-plane-role-based-access?tabs=built-in-definition%2Ccsharp&pivots=azure-interface-cli](https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/security/how-to-grant-data-plane-role-based-access?tabs=built-in-definition%2Ccsharp&pivots=azure-interface-cli)
|
||||
- [https://learn.microsoft.com/en-us/azure/cosmos-db/choose-api](https://learn.microsoft.com/en-us/azure/cosmos-db/choose-api)
|
||||
- [https://learn.microsoft.com/en-us/azure/cosmos-db/](https://learn.microsoft.com/en-us/azure/cosmos-db/)
|
||||
- [https://learn.microsoft.com/en-us/azure/cosmos-db/introduction](https://learn.microsoft.com/en-us/azure/cosmos-db/introduction)
|
||||
- [https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/security/how-to-grant-data-plane-role-based-access?tabs=built-in-definition%2Ccsharp&pivots=azure-interface-cli](https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/security/how-to-grant-data-plane-role-based-access?tabs=built-in-definition%2Ccsharp&pivots=azure-interface-cli)
|
||||
|
||||
## Privilege Escalation
|
||||
|
||||
{% content-ref url="../az-privilege-escalation/az-cosmosDB-privesc.md" %}
|
||||
[az-cosmosDB-privesc.md](../az-privilege-escalation/az-cosmosDB-privesc.md)
|
||||
{% endcontent-ref %}
|
||||
{{#ref}}
|
||||
../az-privilege-escalation/az-cosmosDB-privesc.md
|
||||
{{#endref}}
|
||||
|
||||
## Post Exploitation
|
||||
|
||||
{% content-ref url="../az-post-exploitation/az-cosmosDB-post-exploitation.md" %}
|
||||
[az-cosmosDB-post-exploitation.md](../az-post-exploitation/az-sql-post-exploitation.md)
|
||||
{% endcontent-ref %}
|
||||
{{#ref}}
|
||||
../az-post-exploitation/az-sql-post-exploitation.md
|
||||
{{#endref}}
|
||||
|
||||
## ToDo
|
||||
|
||||
|
||||
@@ -30,9 +30,8 @@
|
||||
|
||||
## Enumeration
|
||||
|
||||
{{#tabs}}
|
||||
{{#tab name="az cli"}}
|
||||
|
||||
{{#tabs }}
|
||||
{{#tab name="az" }}
|
||||
```bash
|
||||
# Get storage accounts
|
||||
az storage account list #Get the account name from here
|
||||
@@ -60,9 +59,9 @@ az storage file list --account-name <name> --share-name <share-name> --snapshot
|
||||
az storage file download-batch -d . --account-name <name> --source <share-name> --snapshot <snapshot-version>
|
||||
```
|
||||
|
||||
{{#endtab}}
|
||||
{{#endtab }}
|
||||
|
||||
{{#tab name="Az PowerShell"}}
|
||||
{{#tab name="Az Powershell" }}
|
||||
|
||||
```bash
|
||||
Get-AzStorageAccount
|
||||
@@ -85,8 +84,8 @@ Get-AzStorageFile -ShareName "<share-name>" -Context (New-AzStorageContext -Stor
|
||||
|
||||
```
|
||||
|
||||
{{#endtab}}
|
||||
{{#endtabs}}
|
||||
{{#endtab }}
|
||||
{{#endtabs }}
|
||||
|
||||
> [!NOTE]
|
||||
> By default `az` cli will use an account key to sign a key and perform the action. To use the Entra ID principal privileges use the parameters `--auth-mode login --enable-file-backup-request-intent`.
|
||||
|
||||
@@ -207,9 +207,9 @@ Moreover, **no source code will be stored in the storage** account related to th
|
||||
|
||||
## Enumeration
|
||||
|
||||
{% tabs %}
|
||||
{% tab title="az cli" %}
|
||||
{% code overflow="wrap" %}
|
||||
{{#tabs }}
|
||||
{{#tab name="az cli" }}
|
||||
|
||||
```bash
|
||||
# List all the functions
|
||||
az functionapp list
|
||||
@@ -255,11 +255,9 @@ curl "https://newfuncttest123.azurewebsites.net/admin/vfs/home/site/wwwroot/func
|
||||
# Get source code
|
||||
az rest --url "https://management.azure.com/<subscription>/resourceGroups/<res-group>/providers/Microsoft.Web/sites/<app-name>/hostruntime/admin/vfs/function_app.py?relativePath=1&api-version=2022-03-01"
|
||||
```
|
||||
{% endcode %}
|
||||
{% endtab %}
|
||||
{{#endtab }}
|
||||
|
||||
{% tab title="Az PowerShell" %}
|
||||
{% code overflow="wrap" %}
|
||||
{{#tab name="Az Powershell" }}
|
||||
```powershell
|
||||
Get-Command -Module Az.Functions
|
||||
|
||||
@@ -275,9 +273,9 @@ Get-AzFunctionAppPlan -ResourceGroupName <String> -Name <String>
|
||||
# Retrieves the app settings for a specific Azure Function App.
|
||||
Get-AzFunctionAppSetting -Name <FunctionAppName> -ResourceGroupName <ResourceGroupName>
|
||||
```
|
||||
{% endcode %}
|
||||
{% endtab %}
|
||||
{% endtabs %}
|
||||
{{#endtab }}
|
||||
{{#endtabs }}
|
||||
|
||||
|
||||
## Privilege Escalation
|
||||
|
||||
|
||||
@@ -45,9 +45,8 @@ There are several hosting options:
|
||||
|
||||
### Enumeration
|
||||
|
||||
{% tabs %}
|
||||
{% tab title="az cli" %}
|
||||
{% code overflow="wrap" %}
|
||||
{{#tabs }}
|
||||
{{#tab name="az cli" }}
|
||||
```bash
|
||||
# List
|
||||
az logic workflow list --resource-group <ResourceGroupName>
|
||||
@@ -110,11 +109,9 @@ az logicapp show --name <LogicAppName> --resource-group <ResourceGroupName>
|
||||
# List all application settings for a specific Logic App
|
||||
az logicapp config appsettings list --name <LogicAppName> --resource-group <ResourceGroupName>
|
||||
```
|
||||
{% endcode %}
|
||||
{% endtab %}
|
||||
{{#endtab }}
|
||||
|
||||
{% tab title="Az PowerShell" %}
|
||||
{% code overflow="wrap" %}
|
||||
{{#tab name="Az Powershell" }}
|
||||
|
||||
```bash
|
||||
Get-Command -Module Az.LogicApp
|
||||
@@ -140,9 +137,8 @@ Get-AzLogicAppTriggerCallbackUrl -ResourceGroupName "<ResourceGroupName>" -LName
|
||||
Get-AzLogicAppTriggerHistory -ResourceGroupName "<ResourceGroupName>" -Name "<LogicAppName>" -TriggerName "<TriggerName>"
|
||||
|
||||
```
|
||||
{% endcode %}
|
||||
{% endtab %}
|
||||
{% endtabs %}
|
||||
{{#endtab }}
|
||||
{{#endtabs }}
|
||||
|
||||
|
||||
|
||||
@@ -160,9 +156,8 @@ Get-AzLogicAppTriggerHistory -ResourceGroupName "<ResourceGroupName>" -Name "<Lo
|
||||
|
||||
#### Enumeration
|
||||
|
||||
{% tabs %}
|
||||
{% tab title="az cli" %}
|
||||
{% code overflow="wrap" %}
|
||||
{{#tabs }}
|
||||
{{#tab name="az cli" }}
|
||||
```bash
|
||||
# Integration account
|
||||
az logic integration-account list --resource-group <resource-group-name>
|
||||
@@ -222,11 +217,9 @@ az logic integration-account assembly show \
|
||||
|
||||
|
||||
```
|
||||
{% endcode %}
|
||||
{% endtab %}
|
||||
{{#endtab }}
|
||||
|
||||
{% tab title="Az PowerShell" %}
|
||||
{% code overflow="wrap" %}
|
||||
{{#tab name="Az Powershell" }}
|
||||
```powershell
|
||||
Get-Command -Module Az.LogicApp
|
||||
|
||||
@@ -257,24 +250,23 @@ Get-AzIntegrationAccountPartner -ResourceGroupName <resource-group-name> -Integr
|
||||
# Retrieve details of a specific schema in an integration account
|
||||
Get-AzIntegrationAccountSchema -ResourceGroupName <resource-group-name> -IntegrationAccountName <integration-account-name> -Name <schema-name>
|
||||
```
|
||||
{% endcode %}
|
||||
{% endtab %}
|
||||
{% endtabs %}
|
||||
{{#endtab }}
|
||||
{{#endtabs }}
|
||||
|
||||
|
||||
## Privilege Escalation
|
||||
|
||||
Same as logic apps privesc:
|
||||
|
||||
{% content-ref url="../az-privilege-escalation/az-logic-apps-privesc.md" %}
|
||||
[az-logic-apps-privesc.md](../az-privilege-escalation/az-logic-apps-privesc.md)
|
||||
{% endcontent-ref %}
|
||||
{{#ref}}
|
||||
../az-privilege-escalation/az-logic-apps-privesc.md
|
||||
{{#endref}}
|
||||
|
||||
## Post Exploitation
|
||||
|
||||
{% content-ref url="../az-post-exploitation/az-logic-apps-post-exploitation.md" %}
|
||||
[az-logic-apps-post-exploitation.md](../az-post-exploitation/az-logic-apps-post-exploitation.md)
|
||||
{% endcontent-ref %}
|
||||
{{#ref}}
|
||||
../az-post-exploitation/az-logic-apps-post-exploitation.md
|
||||
{{#endref}}
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
|
||||
@@ -23,9 +23,8 @@ Azure Database for MySQL is a fully managed relational database service based on
|
||||
|
||||
### Enumeration
|
||||
|
||||
{% tabs %}
|
||||
{% tab title="az cli" %}
|
||||
{% code overflow="wrap" %}
|
||||
{{#tabs }}
|
||||
{{#tab name="az cli" }}
|
||||
```bash
|
||||
# List all flexible-servers
|
||||
az mysql flexible-server db list --resource-group <resource-group-name>
|
||||
@@ -55,11 +54,9 @@ az mysql flexible-server maintenance list --resource-group <resource-group-name>
|
||||
az mysql flexible-server server-logs list --resource-group <resource-group-name> --server-name <server_name>
|
||||
|
||||
```
|
||||
{% endcode %}
|
||||
{% endtab %}
|
||||
{{#endtab }}
|
||||
|
||||
{% tab title="Az PowerShell" %}
|
||||
{% code overflow="wrap" %}
|
||||
{{#tab name="Az Powershell" }}
|
||||
```bash
|
||||
Get-Command -Module Az.MySql
|
||||
|
||||
@@ -95,15 +92,13 @@ Get-AzMySqlFlexibleServerMaintenanceWindow -ResourceGroupName <resource-group-na
|
||||
# List log files for a server
|
||||
Get-AzMySqlFlexibleServerLog -ResourceGroupName <resource-group-name> -ServerName <server_name>
|
||||
```
|
||||
{% endcode %}
|
||||
{% endtab %}
|
||||
{% endtabs %}
|
||||
{{#endtab }}
|
||||
{{#endtabs }}
|
||||
|
||||
### Connection
|
||||
|
||||
With the extension rdbms-connect you can access the database with:
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```bash
|
||||
az mysql flexible-server connect -n <server-name> -u <username> -p <password> --interactive
|
||||
|
||||
@@ -116,17 +111,13 @@ az mysql flexible-server execute \
|
||||
--querytext "SELECT * FROM <table-name>;"
|
||||
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
Or with the MySQL native extension plugin
|
||||
{% code overflow="wrap" %}
|
||||
```bash
|
||||
mysql -h <server-name>.mysql.database.azure.com -P 3306 -u <username> -p
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
Also you can execute queries with github but the password and user are also needed. You need to set up a sql file with the query to run and then:
|
||||
{% code overflow="wrap" %}
|
||||
```bash
|
||||
# Setup
|
||||
az mysql flexible-server deploy setup \
|
||||
@@ -145,19 +136,18 @@ az mysql flexible-server deploy run \
|
||||
--action-name <action-name> \
|
||||
--branch <branch-name>
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
## Privilege Escalation
|
||||
|
||||
{% content-ref url="../az-privilege-escalation/az-mysql-privesc.md" %}
|
||||
[az-mysql-privesc.md](../az-privilege-escalation/az-mysql-privesc.md)
|
||||
{% endcontent-ref %}
|
||||
{{#ref}}
|
||||
../az-privilege-escalation/az-mysql-privesc.md
|
||||
{{#endref}}
|
||||
|
||||
## Post Exploitation
|
||||
|
||||
{% content-ref url="../az-post-exploitation/az-mysql-post-exploitation.md" %}
|
||||
[az-sql-mysql-exploitation.md](../az-post-exploitation/az-mysql-post-exploitation.md)
|
||||
{% endcontent-ref %}
|
||||
{{#ref}}
|
||||
../az-post-exploitation/az-mysql-post-exploitation.md
|
||||
{{#endref}}
|
||||
|
||||
## ToDo
|
||||
|
||||
|
||||
@@ -26,9 +26,8 @@
|
||||
|
||||
### Enumeration
|
||||
|
||||
{% tabs %}
|
||||
{% tab title="az cli" %}
|
||||
{% code overflow="wrap" %}
|
||||
{{#tabs }}
|
||||
{{#tab name="az cli" }}
|
||||
```bash
|
||||
# List servers in a resource group
|
||||
az postgres flexible-server list --resource-group <resource-group-name>
|
||||
@@ -64,11 +63,9 @@ az postgres flexible-server maintenance list --resource-group <resource-group-na
|
||||
az postgres flexible-server server-logs list --resource-group <resource-group-name> --server-name <server_name>
|
||||
|
||||
```
|
||||
{% endcode %}
|
||||
{% endtab %}
|
||||
{{#endtab }}
|
||||
|
||||
{% tab title="Az PowerShell" %}
|
||||
{% code overflow="wrap" %}
|
||||
{{#tab name="Az Powershell" }}
|
||||
```bash
|
||||
Get-Command -Module Az.PostgreSql
|
||||
|
||||
@@ -91,15 +88,13 @@ Get-AzPostgreSqlFlexibleServerLocationBasedCapability -Location <location>
|
||||
Get-AzPostgreSqlServer -ResourceGroupName <resource-group-name>
|
||||
|
||||
```
|
||||
{% endcode %}
|
||||
{% endtab %}
|
||||
{% endtabs %}
|
||||
{{#endtab }}
|
||||
{{#endtabs }}
|
||||
|
||||
### Connection
|
||||
|
||||
With the extension rdbms-connect you can access the database with:
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```bash
|
||||
az postgres flexible-server connect -n <server-name> -u <username> -p <password> --interactive
|
||||
|
||||
@@ -112,32 +107,29 @@ az postgres flexible-server execute \
|
||||
--querytext "SELECT * FROM <table-name>;"
|
||||
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
Or
|
||||
{% code overflow="wrap" %}
|
||||
```bash
|
||||
psql -h testpostgresserver1994.postgres.database.azure.com -p 5432 -U adminuser <database-name>
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
## References
|
||||
|
||||
* [https://learn.microsoft.com/en-us/azure/postgresql/](https://learn.microsoft.com/en-us/azure/postgresql/)
|
||||
* [https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/service-overview](https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/service-overview)
|
||||
* [https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/overview](https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/overview)
|
||||
- [https://learn.microsoft.com/en-us/azure/postgresql/](https://learn.microsoft.com/en-us/azure/postgresql/)
|
||||
- [https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/service-overview](https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/service-overview)
|
||||
- [https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/overview](https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/overview)
|
||||
|
||||
## Privilege Escalation
|
||||
|
||||
{% content-ref url="../az-privilege-escalation/az-postgresql-privesc.md" %}
|
||||
[az-postgresql-privesc.md](../az-privilege-escalation/az-postgresql-privesc.md)
|
||||
{% endcontent-ref %}
|
||||
{{#ref}}
|
||||
../az-privilege-escalation/az-postgresql-privesc.md
|
||||
{{#endref}}
|
||||
|
||||
## Post Exploitation
|
||||
|
||||
{% content-ref url="../az-post-exploitation/az-postgresql-post-exploitation.md" %}
|
||||
[az-postgresql-post-exploitation.md](../az-post-exploitation/az-postgresql-post-exploitation.md)
|
||||
{% endcontent-ref %}
|
||||
{{#ref}}
|
||||
../az-post-exploitation/az-postgresql-post-exploitation.md
|
||||
{{#endref}}
|
||||
|
||||
## ToDo
|
||||
|
||||
|
||||
@@ -13,19 +13,19 @@ Azure Queue Storage is a service in Microsoft's Azure cloud platform designed fo
|
||||
|
||||
```bash
|
||||
# You need to know the --account-name of the storage (az storage account list)
|
||||
az storage queue list --account-name <storage_account>
|
||||
az storage queue list --account-name <storage_account> # --auth-mode login
|
||||
|
||||
# Queue Metadata
|
||||
az storage queue metadata show --name <queue_name> --account-name <storage_account>
|
||||
az storage queue metadata show --name <queue_name> --account-name <storage_account> # --auth-mode login
|
||||
|
||||
#Get ACL
|
||||
az storage queue policy list --queue-name <queue_name> --account-name <storage_account>
|
||||
az storage queue policy list --queue-name <queue_name> --account-name <storage_account> # --auth-mode login
|
||||
|
||||
# Get Messages (getting a message deletes it)
|
||||
az storage message get --queue-name <queue_name> --account-name <storage_account>
|
||||
az storage message get --queue-name <queue_name> --account-name <storage_account> # --auth-mode login
|
||||
|
||||
# Peek Messages
|
||||
az storage message peek --queue-name <queue_name> --account-name <storage_account>
|
||||
az storage message peek --queue-name <queue_name> --account-name <storage_account> # --auth-mode login
|
||||
```
|
||||
|
||||
{{#endtab }}
|
||||
|
||||
@@ -51,9 +51,8 @@ sku, authrorization rule,
|
||||
|
||||
### Enumeration
|
||||
|
||||
{% tabs %}
|
||||
{% tab title="az cli" %}
|
||||
{% code overflow="wrap" %}
|
||||
{{#tabs }}
|
||||
{{#tab name="az cli" }}
|
||||
```bash
|
||||
# Queue Enumeration
|
||||
az servicebus queue list --resource-group <MyResourceGroup> --namespace-name <MyNamespace>
|
||||
@@ -81,11 +80,9 @@ az servicebus queue authorization-rule list --resource-group <MyResourceGroup> -
|
||||
az servicebus topic authorization-rule list --resource-group <MyResourceGroup> --namespace-name <MyNamespace> --topic-name <MyTopic>
|
||||
az servicebus namespace authorization-rule keys list --resource-group <MyResourceGroup> --namespace-name <MyNamespace> --name <MyAuthRule>
|
||||
```
|
||||
{% endcode %}
|
||||
{% endtab %}
|
||||
{{#endtab }}
|
||||
|
||||
{% tab title="Az PowerShell" %}
|
||||
{% code overflow="wrap" %}
|
||||
{{#tab name="Az Powershell" }}
|
||||
```powershell
|
||||
Get-Command -Module Az.ServiceBus
|
||||
|
||||
@@ -128,9 +125,8 @@ Get-AzServiceBusSubscription -ResourceGroupName <ResourceGroupName> -NamespaceNa
|
||||
# Retrieves details of a specified topic in a Service Bus namespace.
|
||||
Get-AzServiceBusTopic -ResourceGroupName <ResourceGroupName> -NamespaceName <NamespaceName>
|
||||
```
|
||||
{% endcode %}
|
||||
{% endtab %}
|
||||
{% endtabs %}
|
||||
{{#endtab }}
|
||||
{{#endtabs }}
|
||||
|
||||
|
||||
### Privilege Escalation
|
||||
@@ -147,9 +143,9 @@ Get-AzServiceBusTopic -ResourceGroupName <ResourceGroupName> -NamespaceName <Nam
|
||||
|
||||
## References
|
||||
|
||||
- https://learn.microsoft.com/en-us/powershell/module/az.servicebus/?view=azps-13.0.0
|
||||
- https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-messaging-overview
|
||||
- https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-quickstart-cli
|
||||
- [https://learn.microsoft.com/en-us/powershell/module/az.servicebus/?view=azps-13.0.0](https://learn.microsoft.com/en-us/powershell/module/az.servicebus/?view=azps-13.0.0)
|
||||
- [https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-messaging-overview](https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-messaging-overview)
|
||||
- [https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-quickstart-cli](https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-quickstart-cli)
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
|
||||
@@ -213,6 +213,8 @@ https://book.hacktricks.wiki/en/pentesting-web/ssrf-server-side-request-forgery/
|
||||
|
||||
## VM Enumeration
|
||||
|
||||
{{#tabs}}
|
||||
{{#tab name="az cli"}}
|
||||
```bash
|
||||
# VMs
|
||||
## List all VMs and get info about one
|
||||
@@ -348,7 +350,9 @@ az resource list --resource-type "Microsoft.Compute/virtualMachines" --query "[]
|
||||
# List all available run commands for virtual machines
|
||||
az vm run-command list --output table
|
||||
```
|
||||
{{#endtab }}
|
||||
|
||||
{{#tab name="Az Powershell" }}
|
||||
```bash
|
||||
# Get readable VMs
|
||||
Get-AzVM | fl
|
||||
@@ -441,6 +445,9 @@ Get-AzVMExtension -VMName <VmName> -ResourceGroupName <ResourceGroupName>
|
||||
|
||||
```
|
||||
|
||||
{{#endtab }}
|
||||
{{#endtabs }}
|
||||
|
||||
## Code Execution in VMs
|
||||
|
||||
### VM Extensions
|
||||
|
||||
@@ -103,8 +103,9 @@ Azure Firewall is a **managed network security service** in Azure that protects
|
||||
|
||||
It is available in three SKUs—**Basic**, **Standard**, and **Premium**, each tailored for specific customer needs:
|
||||
|
||||
| **Recommended Use Case** | Small/Medium Businesses (SMBs) with limited needs | General enterprise use, Layer 3–7 filtering | Highly sensitive environments (e.g., payment processing) |
|
||||
| Criteria/Feature | Option 1 | Option 2 | Option 3 |
|
||||
| ------------------------------ | ------------------------------------------------- | ------------------------------------------- | --------------------------------------------------------- |
|
||||
| **Recommended Use Case** | Small/Medium Businesses (SMBs) with limited needs | General enterprise use, Layer 3–7 filtering | Highly sensitive environments (e.g., payment processing) |
|
||||
| **Performance** | Up to 250 Mbps throughput | Up to 30 Gbps throughput | Up to 100 Gbps throughput |
|
||||
| **Threat Intelligence** | Alerts only | Alerts and blocking (malicious IPs/domains) | Alerts and blocking (advanced threat intelligence) |
|
||||
| **L3–L7 Filtering** | Basic filtering | Stateful filtering across protocols | Stateful filtering with advanced inspection |
|
||||
|
||||
Reference in New Issue
Block a user