Files
hacktricks-cloud/src/pentesting-cloud/azure-security/az-post-exploitation/az-logic-apps-post-exploitation.md

6.9 KiB

Az - Logic Apps Post Exploitation

{{#include ../../../banners/hacktricks-training.md}}

Logic Apps Databasis Post Exploitation

Vir meer inligting oor logika-apps, kyk:

{{#ref}} ../az-services/az-logic-apps.md {{#endref}}

Microsoft.Logic/workflows/read, Microsoft.Logic/workflows/write && Microsoft.ManagedIdentity/userAssignedIdentities/assign/action

Met hierdie toestemmings kan jy Logic App werkvloei verander en hul identiteite bestuur. Spesifiek kan jy stelsels toegewyde en gebruikers toegewyde bestuurde identiteite aan werkvloei toewys of verwyder, wat die Logic App in staat stel om te verifieer en toegang tot ander Azure hulpbronne te verkry sonder eksplisiete akrediteer.

az logic workflow identity remove/assign \
--name <workflow_name> \
--resource-group <resource_group_name> \
--system-assigned true \
--user-assigned "/subscriptions/<subscription_id>/resourceGroups/<resource_group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<identity_name>"

Boonop kan jy met net Microsoft.Logic/workflows/write sommige konfigurasies verander soos Toegelate inkomende IP adresse of Hardloopgeskiedenis behou dae:

az rest --method PUT \
--uri "https://management.azure.com/subscriptions/<subscription_id>/resourceGroups/<resource_group>/providers/Microsoft.Logic/workflows/<workflow_name>?api-version=2019-05-01" \
--headers "Content-Type=application/json" \
--body '{
"location": "<location>",
"properties": {
"state": "Enabled",
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"triggers": {
"<trigger_name>": {
"type": "Request",
"kind": "Http"
}
},
"actions": {},
"outputs": {}
},
"runtimeConfiguration": {
"lifetime": {
"unit": "day",
"count": <count>
}
},
"accessControl": {
"triggers": {
"allowedCallerIpAddresses": []
},
"actions": {
"allowedCallerIpAddresses": []
}
}
}
}'

Microsoft.Web/sites/read, Microsoft.Web/sites/write

Met hierdie toestemmings kan jy Logic Apps skep of opdateer wat op 'n App Service Plan gehosteer word. Dit sluit die aanpassing van instellings in, soos om HTTPS-afdwinging in of uit te skakel.

az logicapp update \
--resource-group <resource_group_name> \
--name <logic_app_name> \
--set httpsOnly=false

Microsoft.Web/sites/stop/action, Microsoft.Web/sites/start/action || Microsoft.Web/sites/restart/action

Met hierdie toestemming kan jy 'n webtoepassing begin/stop/restart, insluitend Logic Apps wat op 'n App Service Plan gehos is. Hierdie aksie verseker dat 'n voorheen gestopte toepassing aanlyn gebring word en sy funksionaliteit hervat. Dit kan werksvloei ontwrig, onbedoelde operasies ontketen, of stilstand veroorsaak deur Logic Apps onverwagte te begin, stop of herbegin.

az webapp start/stop/restart \
--name <logic_app_name> \
--resource-group <resource_group_name>

Microsoft.Web/sites/config/list/action, Microsoft.Web/sites/read && Microsoft.Web/sites/config/write

Met hierdie toestemming kan jy instellings vir webtoepassings konfigureer of wysig, insluitend Logic Apps wat op 'n App Service Plan gehos is. Dit stel veranderinge aan toepassingsinstellings, verbindsstrings, outentikasie-konfigurasies, en meer in staat.

az logicapp config appsettings set \
--name <logic_app_name> \
--resource-group <resource_group_name> \
--settings "<key>=<value>"

Microsoft.Logic/integrationAccounts/write

Met hierdie toestemming kan jy Azure Logic Apps integrasie rekeninge skep, opdateer of verwyder. Dit sluit die bestuur van integrasie rekeningvlak konfigurasies in soos kaarte, skemas, vennote, ooreenkomste, en meer.

az logic integration-account create \
--resource-group <resource_group_name> \
--name <integration_account_name> \
--location <location> \
--sku <Standard|Free> \
--state Enabled

Microsoft.Resources/subscriptions/resourcegroups/read && Microsoft.Logic/integrationAccounts/batchConfigurations/write

Met hierdie toestemming kan jy batchkonfigurasies binne 'n Azure Logic Apps-integrasiesrekening skep of wysig. Batchkonfigurasies definieer hoe Logic Apps inkomende boodskappe verwerk en groepeer vir batchverwerking.

az logic integration-account batch-configuration create \
--resource-group <resource_group_name> \
--integration-account-name <integration_account_name> \
--name <batch_configuration_name> \
--release-criteria '{
"messageCount": 100,
"batchSize": 1048576,
}'

Microsoft.Resources/subscriptions/resourcegroups/read && Microsoft.Logic/integrationAccounts/maps/write

Met hierdie toestemming kan jy kaarte binne 'n Azure Logic Apps integrasie rekening skep of wysig. Kaarte word gebruik om data van een formaat na 'n ander te transformeer, wat naatlose integrasie tussen verskillende stelsels en toepassings moontlik maak.

az logic integration-account map create \
--resource-group <resource_group_name> \
--integration-account-name <integration_account_name> \
--name <map_name> \
--map-type <Xslt|Xslt20|Xslt30> \
--content-type application/xml \
--map-content map-content.xslt

Microsoft.Resources/subscriptions/resourcegroups/read && Microsoft.Logic/integrationAccounts/partners/write

Met hierdie toestemming kan jy vennote in 'n Azure Logic Apps integrasiewerkrekening skep of wysig. Vennote verteenwoordig entiteite of stelsels wat deelneem aan besigheid-tot-besigheid (B2B) werksvloei.

az logic integration-account partner create \
--resource-group <resource_group_name> \
--integration-account-name <integration_account_name> \
--name <partner_name> \
--partner-type <partner-type> \
--content '{
"b2b": {
"businessIdentities": [
{
"qualifier": "ZZ",
"value": "TradingPartner1"
}
]
}
}'

Microsoft.Resources/subscriptions/resourcegroups/read && Microsoft.Logic/integrationAccounts/sessions/write

Met hierdie toestemming kan jy sessies binne 'n Azure Logic Apps integrasietoevoer aanmaak of wysig. Sessies word in B2B werkvloei gebruik om boodskappe te groepeer en verwante transaksies oor 'n gedefinieerde tydperk te volg.

az logic integration-account session create \
--resource-group <resource_group_name> \
--integration-account-name <integration_account_name> \
--name <session_name> \
--content '{
"properties": {
"sessionId": "session123",
"data": {
"key1": "value1",
"key2": "value2"
}
}
}'

Microsoft.Logic/workflows/regenerateAccessKey/action

Gebruikers met hierdie toestemming kan Logic App toegang sleutels hernu, en as dit misbruik word, kan dit lei tot diensonderbrekings.

az rest --method POST \
--uri "https://management.azure.com/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.Logic/workflows/<workflow-name>/regenerateAccessKey?api-version=<api-version>" \
--body '{"keyType": "<key-type>"}' \
--headers "Content-Type=application/json"

"*/delete"

Met hierdie toestemmings kan jy hulpbronne wat verband hou met Azure Logic Apps verwyder.

{{#include ../../../banners/hacktricks-training.md}}