Az - Logic Apps Post Exploitation

Reading time: 6 minutes

tip

AWS 해킹 배우기 및 연습하기:HackTricks Training AWS Red Team Expert (ARTE)
GCP 해킹 배우기 및 연습하기: HackTricks Training GCP Red Team Expert (GRTE) Azure 해킹 배우기 및 연습하기: HackTricks Training Azure Red Team Expert (AzRTE)

HackTricks 지원하기

Logic Apps 데이터베이스 포스트 익스플로이테이션

Logic Apps에 대한 자세한 정보는 다음을 확인하세요:

Az - Logic Apps

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

이 권한을 사용하면 Logic App 워크플로를 수정하고 그들의 ID를 관리할 수 있습니다. 구체적으로, 시스템 할당 및 사용자 할당 관리 ID를 워크플로에 할당하거나 제거할 수 있으며, 이를 통해 Logic App이 명시적인 자격 증명 없이 다른 Azure 리소스에 인증하고 접근할 수 있습니다.

bash
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>"

추가적으로 Microsoft.Logic/workflows/write를 사용하여 허용된 수신 IP 주소나 실행 기록 보존 일수와 같은 일부 구성을 변경할 수 있습니다:

bash
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

이 권한을 사용하면 App Service Plan에 호스팅된 Logic Apps를 생성하거나 업데이트할 수 있습니다. 여기에는 HTTPS 강제 적용을 활성화하거나 비활성화하는 등의 설정 수정이 포함됩니다.

bash
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

이 권한을 사용하면 App Service Plan에서 호스팅되는 Logic Apps를 포함하여 웹 앱을 시작/중지/재시작할 수 있습니다. 이 작업은 이전에 중지된 앱이 온라인으로 전환되고 기능을 재개하도록 보장합니다. 이는 워크플로를 방해하거나 의도하지 않은 작업을 유발하거나 Logic Apps를 예기치 않게 시작, 중지 또는 재시작하여 다운타임을 초래할 수 있습니다.

bash
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

이 권한을 사용하면 App Service Plan에 호스팅된 Logic Apps를 포함하여 웹 앱의 설정을 구성하거나 수정할 수 있습니다. 이를 통해 앱 설정, 연결 문자열, 인증 구성 등을 변경할 수 있습니다.

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

Microsoft.Logic/integrationAccounts/write

이 권한을 사용하면 Azure Logic Apps 통합 계정을 생성, 업데이트 또는 삭제할 수 있습니다. 여기에는 맵, 스키마, 파트너, 계약 등과 같은 통합 계정 수준의 구성을 관리하는 것이 포함됩니다.

bash
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

이 권한을 사용하면 Azure Logic Apps 통합 계정 내에서 배치 구성을 생성하거나 수정할 수 있습니다. 배치 구성은 Logic Apps가 배치 처리를 위해 수신 메시지를 처리하고 그룹화하는 방법을 정의합니다.

bash
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

이 권한을 사용하면 Azure Logic Apps 통합 계정 내에서 맵을 생성하거나 수정할 수 있습니다. 맵은 데이터를 한 형식에서 다른 형식으로 변환하는 데 사용되며, 서로 다른 시스템과 애플리케이션 간의 원활한 통합을 가능하게 합니다.

bash
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

이 권한을 사용하면 Azure Logic Apps 통합 계정에서 파트너를 생성하거나 수정할 수 있습니다. 파트너는 비즈니스 간(B2B) 워크플로에 참여하는 엔터티 또는 시스템을 나타냅니다.

bash
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

이 권한을 사용하면 Azure Logic Apps 통합 계정 내에서 세션을 생성하거나 수정할 수 있습니다. 세션은 B2B 워크플로우에서 메시지를 그룹화하고 정의된 기간 동안 관련 거래를 추적하는 데 사용됩니다.

bash
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

이 권한이 있는 사용자는 Logic App 액세스 키를 재생성할 수 있으며, 잘못 사용될 경우 서비스 중단으로 이어질 수 있습니다.

bash
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"

이 권한으로 Azure Logic Apps와 관련된 리소스를 삭제할 수 있습니다.

tip

AWS 해킹 배우기 및 연습하기:HackTricks Training AWS Red Team Expert (ARTE)
GCP 해킹 배우기 및 연습하기: HackTricks Training GCP Red Team Expert (GRTE) Azure 해킹 배우기 및 연습하기: HackTricks Training Azure Red Team Expert (AzRTE)

HackTricks 지원하기