<?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 Yamen Idriss on Medium]]></title>
        <description><![CDATA[Stories by Yamen Idriss on Medium]]></description>
        <link>https://medium.com/@yhamenite?source=rss-f4c36136665c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*SjvaQYAUJGpRy8BwTvs0Ww.jpeg</url>
            <title>Stories by Yamen Idriss on Medium</title>
            <link>https://medium.com/@yhamenite?source=rss-f4c36136665c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 09:48:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yhamenite/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[Enabling Core Windows Telemetry (4688 & 4104)]]></title>
            <link>https://medium.com/@yhamenite/enabling-core-windows-telemetry-4688-4104-abb4d30af12d?source=rss-f4c36136665c------2</link>
            <guid isPermaLink="false">https://medium.com/p/abb4d30af12d</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[offensive-security]]></category>
            <category><![CDATA[defensive-security]]></category>
            <dc:creator><![CDATA[Yamen Idriss]]></dc:creator>
            <pubDate>Sun, 25 Oct 2026 18:00:49 GMT</pubDate>
            <atom:updated>2026-10-25T18:00:49.593Z</atom:updated>
            <content:encoded><![CDATA[<h3>Table of Contents</h3><pre>/<br>├── Table of Contents<br>├── Introduction<br>├── Prerequisites<br>│   ├── Creating an Organizational Unit<br>│   └── Creating a Group Policy Object<br>├── Enable Event 4688 logging<br>├── Enable Event 4104 logging<br>├── Hands-on<br>│   ├── Incident scenario<br>│   └── Reading the logs<br>├── Why is it worth doing<br>└── P.S.</pre><h3>Introduction</h3><p>Windows can record many important events on its own, with no external program installed. A lot of that logging is left off by default, mostly to balance operating-system performance against disk space.</p><p>In this article we turn on logging for event 4688 and event 4104, and we look at why the two of them matter. With this logging enabled, we may be able to do without an endpoint detection and response (EDR) product, or even an external tool such as Sysmon. That depends, above all, on where the system sits and on the context in which it is used.</p><p>The two events are:</p><ul><li><strong>Event ID 4688:</strong> Process Creation Logging</li><li><strong>Event ID 4104:</strong> PowerShell Script Block Logging</li></ul><h3>Prerequisites</h3><h4>Creating an Organizational Unit</h4><p>In this walkthrough, logging is turned on by adding a Group Policy Object (GPO) and linking it to an organizational unit (OU). Start by creating the OU. In Active Directory Users and Computers, for the domain, choose <strong>Organizational Unit</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kMdWuEDxESj4BR8_" /></figure><p>Name the OU, then move every computer that should receive the policy into it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/0*t1p-nM8xN5NCNezH" /></figure><h4>Creating a Group Policy Object</h4><p>A Group Policy Object is what we link to the OU created above. In Group Policy Management, select the right domain, then choose <strong>Create a GPO in this domain, and Link it here…</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/0*JDVIGICKfxSPyfvD" /></figure><p>Name the policy and continue. It is linked to the selected domain immediately.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/0*hyGKdv2uitH_a0lP" /></figure><h3>Enabling Event 4688 logging</h3><p>With those prerequisites in place, turn on logging for event 4688. A new process is then recorded together with its command line, the parent process, and both process IDs.</p><p>Start by enabling logging for new process creation. Edit the policy and follow this path:</p><p>Computer Configuration → Policies → Windows Settings → Security Settings → Advanced Audit Policy Configuration → Audit Policies → Detailed Tracking</p><p>Open <strong>Audit Process Creation</strong>, choose <strong>Configure the following audit events</strong>, check <strong>Success</strong> ( <strong>Failure</strong> is optional), and click <strong>OK</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/0*DuAN4XOPfWELCthr" /></figure><p>Next, record the command line that created the process. Follow this path:</p><p>Computer Configuration → Policies → Administrative Templates → System → Audit Process Creation</p><p>Open <strong>Include command line in process creation events</strong>, set it to <strong>Enabled</strong>, and click <strong>OK</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/0*lhDBHt0dxCW7rmxq" /></figure><h3>Enabling Event 4104 logging</h3><p>Now turn on logging for event 4104, which records PowerShell as it is about to run. Follow this path:</p><p>Computer Configuration → Policies → Administrative Templates → Windows Components → Windows PowerShell</p><p>Open <strong>Turn on PowerShell Script Block Logging</strong>, set it to <strong>Enabled</strong>, and click <strong>OK</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/0*5v7iAi9GabsyaqPr" /></figure><p>When every step above is done, run the following command so the policies apply across the domain.</p><pre>gpupdate /force</pre><h3>Hands-on</h3><h4>Incident scenario</h4><p>To see what event 4688 and event 4104 actually give us, take the following case.</p><p>The monitoring team reports that the user Gascoigne, on the computer WS-01, fell for a ClickFix phishing lure. From the Windows Run dialog he ran an encoded PowerShell command. That encoding matters later.</p><pre>cmd.exe /c &quot;powershell.exe -enc cgB1AG4AZABsAGwAMwAyAC4AZQB4AGUAIABzAGgAZQBsAGwAMwAyAC4AZABsAGwALABTAGgAZQBsAGwAQQBiAG8AdQB0ACAAeAAuAGMAbwBtAC8AWQBoAGEAbQBlAG4AaQB0AGUA&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/0*gVRS7b8UPVK3bP_-" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/0*M8pahVXFdDnup3Md" /></figure><h4>Reading the logs</h4><p>Look at how the events arrive, starting with event 4688:</p><ul><li>The system recorded the parent process and its process ID.</li><li>The system recorded the new process, its process ID, and the command line that created it.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/0*xmKdDbHL13tJk6Mt" /></figure><p>Now look at the same incident through event 4104:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/0*Qd1x-5hPyNOlbwpV" /></figure><h4>Why is it worth doing</h4><p>The practical value of this advanced logging is that it lets us apply defensive ideas such as <strong>Defense-in-Depth</strong>. A detection engineer can write a rule that alerts when an encoded PowerShell command runs, by watching event 4688. The same engineer can write a different rule that looks for the technique itself, by watching event 4104. And God knows best.</p><p>The incident response team contained the incident, and everyone lived happily ever after. :)</p><p>Praise be to God, Lord of the worlds.</p><h4>P.S.</h4><p>This post was translated <strong>as is from this </strong><a href="https://x.com/Yhamenite/status/2111779339347873992"><strong>X post</strong></a><strong>.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=abb4d30af12d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying and Configuring AdaptixC2]]></title>
            <link>https://medium.com/@yhamenite/deploying-and-configuring-adaptixc2-68615f658937?source=rss-f4c36136665c------2</link>
            <guid isPermaLink="false">https://medium.com/p/68615f658937</guid>
            <category><![CDATA[red-teaming]]></category>
            <category><![CDATA[infrastructure]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[offensive-security]]></category>
            <dc:creator><![CDATA[Yamen Idriss]]></dc:creator>
            <pubDate>Sun, 30 Aug 2026 13:02:45 GMT</pubDate>
            <atom:updated>2026-08-30T13:02:45.010Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>This article aims to guide the reader on how to install and configure the free, open-source Command and Control (C2) framework, AdaptixC2, within an environment that simulates Advanced Persistent Threat (APT) group operations on a smaller scale, enabling a better understanding of their infrastructure and more effective defense strategies.</p><p><strong>Warning:</strong> This article is strictly for defensive awareness and educational purposes. It does not serve as an installation or operational guide, nor does it authorize the use of the framework or its techniques outside an authorized legal scope. Any illicit use is solely the responsibility of the actor.</p><h3>Requirements</h3><p>To follow the steps outlined in this article, you must meet the following prerequisites:</p><ul><li>A Virtual Private Server (VPS) with 4 GB RAM and 50 GB storage space.</li><li>A disposable (burner) domain name.</li></ul><h3>Phase 1: Configuring the Teamserver</h3><h4>Step 1.A: Goal</h4><p>This phase aims to properly set up and install the team server while adhering to best practices to achieve the highest level of Operational Security (OPSEC).</p><h4>Step 1.B: Architecture</h4><p>We will prepare an infrastructure which mimics the following graph:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*VDYHNnn4yBqEuVbiDlxmuw.png" /></figure><h4>Step 1.0: Securing the Teamserver</h4><p>The first step is securing the team server (which acts as the attack operations center) and protecting it against all unauthorized access. To begin, we restrict our connection to the server via the SSH protocol to update and upgrade system packages by running the following:</p><blockquote><em>(Note: This command varies based on the OS distribution installed on the team server. This guide specifically applies to Ubuntu 22.04 LTS).</em></blockquote><pre>apt update &amp;&amp; apt upgrade -y</pre><p>Next, we need to determine the public IPv4 addresses of the operators to strictly limit access. We can use curl to display the address by executing:</p><blockquote><em>(In this guide, we will restrict access to a single operator).</em></blockquote><pre>curl -4 ifconfig.me</pre><p>We will now define a set of rules to apply to the cloud provider’s firewall, and then replicate these rules on the Virtual Private Server (VPS) host firewall, as shown in the image above.</p><p>Start configuring the cloud firewall by navigating to: Droplets -&gt; Networking -&gt; Manage -&gt; Firewalls -&gt; Create Firewall</p><blockquote><em>(Note: Steps may vary across cloud providers. While this guide uses DigitalOcean, the overall procedure remains similar across other platforms).</em></blockquote><p>Add the following to the “Inbound Rules”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9ukd_bvUlRasOiCxCKDeKQ.png" /></figure><ul><li>Block internet access to port 4321 (the reason will be explained later).</li><li>Allow all IP addresses to connect to port 443 (typically the HTTPS port).</li><li>Allow all IP addresses to connect to port 80 (typically the HTTP port).</li><li>Allow the operator’s IP addresses to connect to port 22 (typically the SSH port).</li></ul><p>Now, we will replicate the exact same settings on the VPS host firewall using the UFW tool by running the following commands:</p><pre>sudo ufw default deny incoming<br>sudo ufw default allow outgoing<br>sudo ufw allow 80/tcp<br>sudo ufw allow 443/tcp<br>sudo ufw allow from &lt;operator-IPv4&gt; to any port 22 proto tcp</pre><p>To verify that these rules were applied correctly, run the command ufw status verbose and check the output. It should look like this:</p><pre>root@AdaptixC2:/etc/nginx$ ufw status verbose<br>Status: active<br>Logging: on (low)<br>Default: deny (incoming), allow (outgoing), deny (routed)<br>New profiles: skip<br><br>To                         Action      From<br>--                         ------      ----<br>22/tcp                     ALLOW IN    &lt;operator-ip&gt;<br>80/tcp                     ALLOW IN    Anywhere<br>443/tcp                    ALLOW IN    Anywhere<br>80/tcp (v6)                ALLOW IN    Anywhere (v6)<br>443/tcp (v6)               ALLOW IN    Anywhere (v6)</pre><h4>Step 1.1: DNS</h4><p>We will now create a subdomain specifically dedicated to communicating with the team server via the Adaptix client at a later stage. A subdomain is added by creating an ‘A’ record pointing to our team server’s IP address.</p><p>In this guide, I chose the subdomain name “ts”, which stands for “Teamserver”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pWCXFOJoo5v28Omeuph9bw.png" /></figure><blockquote><strong>Crucial Note:</strong> Any proxying must be disabled (DNS only), exactly as shown in the image above.</blockquote><h4>Step 1.2: Docker</h4><p>We will install the AdaptixC2 framework using Docker, saving us the hassle of manually downloading and configuring dependencies. However, the following prerequisites must be installed first:</p><pre>sudo apt install -y ca-certificates curl make</pre><ul><li><strong>curl:</strong> Used to download Docker and its signing key.</li><li><strong>ca-certificates:</strong> Used to manage certificate store verification.</li><li><strong>make:</strong> Used to build Adaptix from the Makefile later on.</li></ul><p>First, create the directory where the signing key will be stored:</p><pre>sudo install -m 0755 -d /etc/apt/keyrings</pre><p>Now, download the GPG signing key and save it to the created directory:</p><pre>sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc</pre><p>Add the Docker repository to the system’s APT package sources:</p><pre>echo &quot;deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release &amp;&amp; echo &quot;$VERSION_CODENAME&quot;) stable&quot; | sudo tee /etc/apt/sources.list.d/docker.list &gt; /dev/null</pre><p>Update the package index using apt update, then run the following command to install the full Docker suite:</p><pre>sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin</pre><p>After installation, add the current user to the docker group (which was created automatically in the previous step):</p><pre>sudo usermod -aG docker &quot;$USER&quot;</pre><p>Enable and start the Docker service via systemctl:</p><pre>sudo systemctl enable --now docker</pre><p>To verify that the setup is functioning correctly, test it by pulling a temporary test container from the official Docker registry:</p><pre>root@AdaptixC2:~# docker run --rm hello-world<br>Unable to find image &#39;hello-world:latest&#39; locally<br>latest: Pulling from library/hello-world<br>4f55086f7dd0: Pull complete<br>d5e71e642bf5: Download complete<br>Digest: sha256:5dd0d3e6e255913fc30f90b9f2b1d359cc2cbdb48090cc4b65f1676e203243cc<br>Status: Downloaded newer image for hello-world:latest<br>Hello from Docker!<br>This message shows that your installation appears to be working correctly.To generate this message, Docker took the following steps:<br> 1. The Docker client contacted the Docker daemon.<br> 2. The Docker daemon pulled the &quot;hello-world&quot; image from the Docker Hub.<br>    (amd64)<br> 3. The Docker daemon created a new container from that image which runs the<br>    executable that produces the output you are currently reading.<br> 4. The Docker daemon streamed that output to the Docker client, which sent it<br>    to your terminal.<br><br>To try something more ambitious, you can run an Ubuntu container with:<br> $ docker run -it ubuntu bash<br>Share images, automate workflows, and more with a free Docker ID:<br> https://hub.docker.com/<br>For more examples and ideas, visit:<br> https://docs.docker.com/get-started/<br>root@AdaptixC2:~#</pre><h4>Step 1.3: Building</h4><p>n this step, we will build AdaptixServer using Docker. We start by cloning the repository from the official AdaptixC2 GitHub page:</p><pre>cd ~<br>git clone https://github.com/Adaptix-Framework/AdaptixC2.git<br>cd AdaptixC2</pre><p>Notice the presence of a Makefile, which provides several options for building the application. In this guide, we will build the server along with all extensions using the following command:</p><pre>root@AdaptixC2:~/AdaptixC2# make docker-build-server-ext<br>[+] build 1/1 ✔ Image adaptixc2-server-ext-builder Built                                                                            1115.2s<br>[+] up 2/2 <br> ✔ Network adaptixc2_default            Created                                                                           0.1s<br> ✔ Container adaptix-server-ext-builder Created                                                                           0.2s<br>Attaching to adaptix-server-ext-builder<br>adaptix-server-ext-builder exited with code 0<br>Aborting on container exit...<br>Container adaptix-server-ext-builder Stopping<br>Container adaptix-server-ext-builder Stopped<br>[+] down 2/2 <br> ✔ Container adaptix-server-ext-builder Removed                                                                           0.0s<br> ✔ Network adaptixc2_default            Removed                                                                           0.1s<br>[+] Server and extenders built via Docker<br>root@AdaptixC2:~/AdaptixC2#<br>```&quot;</pre><h4>Step 1.4: Nginx Configurations</h4><p>Nginx will be used as a reverse proxy to enhance Operational Security (OPSEC) by avoiding direct exposure of the Adaptix server to the public internet. Additionally, we will leverage domain-based routing to direct traffic to the correct service. First, install Nginx:</p><pre>sudo apt install -y nginx</pre><p>Edit the configuration file located at /etc/nginx/sites-available/default and add the following:</p><pre>map $http_upgrade $connection_upgrade {<br>    default upgrade;<br>    &#39;&#39;      close;<br>}<br>server {<br>    listen 80;<br>    listen [::]:80;<br>    server_name ts.proactive-learning.net;<br>location /.well-known/acme-challenge/ {<br>        root /var/www/html;<br>    }<br>   location / {<br>        return 301 https://$host$request_uri;<br>    }<br>}<br>server {<br>    listen 443 ssl http2;<br>    listen [::]:443 ssl http2;<br>    server_name ts.proactive-learning.net;<br>   ssl_certificate     /etc/letsencrypt/live/ts.proactive-learning.net/fullchain.pem;<br>    ssl_certificate_key /etc/letsencrypt/live/ts.proactive-learning.net/privkey.pem;<br>    include /etc/letsencrypt/options-ssl-nginx.conf;<br>    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;<br>   server_tokens off;<br>   location / {<br>        proxy_pass https://127.0.0.1:4321;<br>        proxy_ssl_verify off;<br>        proxy_http_version 1.1;<br>        proxy_set_header Host $host;<br>        proxy_set_header Upgrade $http_upgrade;<br>        proxy_set_header Connection $connection_upgrade;<br>        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br>        proxy_set_header X-Forwarded-Proto $scheme;<br>        proxy_read_timeout 3600s;<br>        proxy_send_timeout 3600s;<br>    }<br>}</pre><p>These settings perform the following:</p><ul><li>Redirect HTTP traffic on port 80 to HTTPS on port 443.</li><li>Allow the ACME challenge path for acquiring or renewing SSL certificates.</li><li>Suppress server banner information (server fingerprinting protection).</li><li>Proxy incoming traffic to the internal application (Adaptix Server) running on port 4321.</li></ul><p>To apply these settings, run the following commands:</p><pre>sudo nginx -t<br>sudo systemctl reload nginx</pre><h4>Step 1.5: Let’s Encrypt</h4><p>We can authenticate the subdomain using a free Let’s Encrypt SSL certificate, which is why we exposed HTTP port 80 to the public internet in the previous step. Install the following packages to execute the process:</p><pre>sudo apt install -y certbot python3-certbot-nginx</pre><p>Now, verify that Nginx is properly receiving incoming requests by executing the following command:</p><pre>yamen@Zephyrus:~$ curl -I ts.&lt;REDACTED&gt;.net<br>HTTP/1.1 200 OK<br>Server: nginx/1.18.0 (Ubuntu)<br>Date: &lt;REDACTED&gt; GMT<br>Content-Type: text/html<br>Content-Length: 612</pre><p>We can now use certbot to obtain the SSL certificate:</p><pre>root@AdaptixC2:~/AdaptixC2/AdaptixServer# certbot --nginx -d ts.&lt;REDACTED&gt;.net<br>Saving debug log to /var/log/letsencrypt/letsencrypt.log<br>Enter email address (used for urgent renewal and security notices) (Enter &#39;c&#39; to cancel): &lt;REDACTED&gt;@outlook.com<br>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br>Please read the Terms of Service at<br>https://letsencrypt.org/documents/LE-SA-v1.8-July-06-2026.pdf. You must agree<br>in order to register with the ACME server. Do you agree?<br>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br>(Y)es/(N)o: Y<br>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br>Would you be willing, once your first certificate is successfully issued, to<br>share your email address with the Electronic Frontier Foundation, a founding<br>partner of the Let&#39;s Encrypt project and the non-profit organization that<br>develops Certbot? We&#39;d like to send you email about our work encrypting the web,<br>EFF news, campaigns, and ways to support digital freedom.<br>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br>(Y)es/(N)o: Y<br>Account registered.<br>Requesting a certificate for ts.&lt;REDACTED&gt;.net<br>Successfully received certificate.<br>Certificate is saved at: /etc/letsencrypt/live/ts.&lt;REDACTED&gt;.net/fullchain.pem<br>Key is saved at:         /etc/letsencrypt/live/ts.&lt;REDACTED&gt;.net/privkey.pem<br>This certificate expires on 2026-11-19.<br>These files will be updated when the certificate renews.<br>Certbot has set up a scheduled task to automatically renew this certificate in the background.<br>Deploying certificate<br>Successfully deployed certificate for ts.&lt;REDACTED&gt;.net to /etc/nginx/sites-enabled/default<br>Congratulations! You have successfully enabled HTTPS on https://ts.&lt;REDACTED&gt;.net<br>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br>If you like Certbot, please consider supporting our work by:<br> * Donating to ISRG / Let&#39;s Encrypt:   https://letsencrypt.org/donate<br> * Donating to EFF:                    https://eff.org/donate-le<br>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br>root@AdaptixC2:~/AdaptixC2/AdaptixServer#</pre><h4>Step 1.6: AdaptixServer Configurations</h4><p>First, navigate to the /AdaptixC2/AdaptixServer/server-dist/ directory and create a data directory to store the application database:</p><pre>mkdir data</pre><p>Next, generate the cryptographic keys to be used for self-signing:</p><pre>openssl req -x509 -nodes -newkey rsa:2048 \<br>  -keyout server.rsa.key \<br>  -out server.rsa.crt \<br>  -days 3650 \<br>  -subj &quot;/CN=localhost&quot;</pre><p>Generate a set of random passwords for the server and operators to enable access to the operations center:</p><pre>openssl rand -base64 32</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*c3-2kfKrXR3HNC_cxQ9f4Q.png" /></figure><p>Now, edit the configuration profile located at AdaptixC2/AdaptixServer/server-dist/profile.yaml. Modify the following settings:</p><pre>Teamserver:<br>  interface: &quot;127.0.0.1&quot;<br>  port: 4321<br>  endpoint: &quot;/lab-ts&quot;<br>  password: &quot;PASTE_THE_RANDOM_PASSWORD&quot;<br>  only_password: true<br>  operators:<br>    operator1: &quot;another-long-random&quot;<br>    operator2: &quot;another-long-random&quot;<br>  cert: &quot;server.rsa.crt&quot;<br>  key: &quot;server.rsa.key&quot;<br>  access_token_live_hours: 12<br>  refresh_token_live_hours: 168<br>HttpServer:<br>  error:<br>    status: 404<br>    headers:<br>      Content-Type: &quot;text/html; charset=UTF-8&quot;<br>      Server: &quot;nginx&quot;<br>    page: &quot;404page.html&quot;</pre><p>Summary of changes:</p><ul><li>Change interface: 0.0.0.0 to interface: 127.0.0.1</li><li>Change endpoint: &quot;/endpoint&quot; to endpoint: &quot;/lab-ts&quot;</li><li>Change password: &quot;pass&quot; to password: &quot;&lt;REDACTED&gt;&quot;</li><li>Change operator1: &quot;pass1&quot; to &lt;your-choice&gt;: &quot;&lt;REDACTED&gt;&quot;</li><li>Completely remove AdaptixVersion</li><li>Change Server: &quot;AdaptixC2&quot; to Server: &quot;nginx&quot;</li></ul><p>Save these changes and verify them using cat:</p><pre>cat profile.yaml</pre><p>One critical requirement is customizing the 404page.html file to remove the default behavioral fingerprint of the Adaptix server, which normally looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sGfI0Yds_cEHtq-fTdurXA.png" /></figure><p>Modify the page located at AdaptixC2/AdaptixServer/server-dist/404page.html to:</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>  &lt;meta charset=&quot;UTF-8&quot;&gt;<br>  &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>  &lt;title&gt;404 Not Found&lt;/title&gt;<br>  &lt;style&gt;<br>    @import url(https://medium.com/&#39;https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&amp;display=swap&#39;);<br> * {<br>      margin: 0;<br>      padding: 0;<br>      box-sizing: border-box;<br>    }<br>body {<br>      min-height: 100vh;<br>      display: flex;<br>      align-items: center;<br>      justify-content: center;<br>      background: #0a0a0f;<br>      font-family: &#39;Inter&#39;, system-ui, sans-serif;<br>      color: #f0f0f5;<br>      overflow: hidden;<br>      position: relative;<br>    }<br>body::before {<br>      content: &#39;&#39;;<br>      position: absolute;<br>      inset: 0;<br>      background-image:<br>        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),<br>        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);<br>      background-size: 48px 48px;<br>      mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);<br>      animation: gridPulse 8s ease-in-out infinite;<br>    }<br>@keyframes gridPulse {<br>      0%, 100% { opacity: 0.4; }<br>      50% { opacity: 0.7; }<br>    }<br>.card {<br>      position: relative;<br>      z-index: 1;<br>      text-align: center;<br>      padding: 3.5rem 3rem;<br>      border-radius: 24px;<br>      background: linear-gradient(145deg, rgba(25, 25, 35, 0.9), rgba(15, 15, 22, 0.95));<br>      border: 1px solid rgba(255, 255, 255, 0.08);<br>      box-shadow:<br>        0 0 0 1px rgba(255, 140, 60, 0.08),<br>        0 25px 50px -12px rgba(0, 0, 0, 0.6),<br>        0 0 80px -20px rgba(255, 140, 60, 0.12);<br>      max-width: 440px;<br>      width: 90%;<br>      animation: fadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;<br>    }<br>@keyframes fadeUp {<br>      from {<br>        opacity: 0;<br>        transform: translateY(24px);<br>      }<br>      to {<br>        opacity: 1;<br>        transform: translateY(0);<br>      }<br>    }<br>.icon {<br>      width: 72px;<br>      height: 72px;<br>      margin: 0 auto 1.75rem;<br>      border-radius: 50%;<br>      background: rgba(255, 140, 60, 0.12);<br>      display: flex;<br>      align-items: center;<br>      justify-content: center;<br>      border: 1px solid rgba(255, 150, 70, 0.25);<br>      animation: pulse 2.5s ease-in-out infinite;<br>    }<br>@keyframes pulse {<br>      0%, 100% { box-shadow: 0 0 0 0 rgba(255, 140, 60, 0.25); }<br>      50% { box-shadow: 0 0 0 12px rgba(255, 140, 60, 0); }<br>    }<br>.icon svg {<br>      width: 32px;<br>      height: 32px;<br>      stroke: #ff9a4a;<br>      stroke-width: 1.8;<br>      fill: none;<br>    }<br>.code {<br>      font-size: 0.8rem;<br>      font-weight: 600;<br>      letter-spacing: 0.18em;<br>      text-transform: uppercase;<br>      color: #ff9a4a;<br>      margin-bottom: 0.75rem;<br>    }<br>h1 {<br>      font-size: 1.85rem;<br>      font-weight: 800;<br>      letter-spacing: -0.02em;<br>      line-height: 1.25;<br>      margin-bottom: 0.85rem;<br>      background: linear-gradient(135deg, #ffffff 0%, #d0d0e0 100%);<br>      -webkit-background-clip: text;<br>      -webkit-text-fill-color: transparent;<br>      background-clip: text;<br>    }<br>p {<br>      font-size: 1.05rem;<br>      color: #a0a0b8;<br>      line-height: 1.5;<br>      max-width: 280px;<br>      margin: 0 auto 2rem;<br>    }<br>.badge {<br>      display: inline-flex;<br>      align-items: center;<br>      gap: 0.4rem;<br>      padding: 0.45rem 1rem;<br>      border-radius: 999px;<br>      background: rgba(255, 140, 60, 0.1);<br>      border: 1px solid rgba(255, 150, 70, 0.2);<br>      font-size: 0.8rem;<br>      font-weight: 600;<br>      color: #ffb070;<br>      letter-spacing: 0.03em;<br>    }<br>.badge::before {<br>      content: &#39;&#39;;<br>      width: 6px;<br>      height: 6px;<br>      border-radius: 50%;<br>      background: #ff9a4a;<br>      box-shadow: 0 0 8px #ff9a4a;<br>    }<br>  &lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;div class=&quot;card&quot;&gt;<br>    &lt;div class=&quot;icon&quot;&gt;<br>      &lt;svg viewBox=&quot;0 0 24 24&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;<br>        &lt;circle cx=&quot;11&quot; cy=&quot;11&quot; r=&quot;7&quot; /&gt;<br>        &lt;path d=&quot;M20 20l-3.5-3.5&quot; /&gt;<br>        &lt;path d=&quot;M9 9l4 4M13 9l-4 4&quot; stroke-linecap=&quot;round&quot; /&gt;<br>      &lt;/svg&gt;<br>    &lt;/div&gt;<br>    &lt;div class=&quot;code&quot;&gt;Error 404&lt;/div&gt;<br>    &lt;h1&gt;Page Not Found&lt;/h1&gt;<br>    &lt;p&gt;The page you’re looking for doesn’t exist or has been moved.&lt;/p&gt;<br>    &lt;div class=&quot;badge&quot;&gt;Lost in Space&lt;/div&gt;<br>  &lt;/div&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IE025e13cvzd6zxGeur0dQ.png" /></figure><h4>Step 1.7: Mounting Configurations at Run time</h4><p>To ensure the settings are applied at runtime, edit the docker-compose.yml file located at AdaptixC2/AdaptixServer/server-dist and add the following configurations under adaptix-server-runtime -&gt; volumes:&quot;</p><pre>- ./AdaptixServer/server-dist/server.rsa.crt:/app/server.rsa.crt:ro<br>- ./AdaptixServer/server-dist/server.rsa.key:/app/server.rsa.key:ro<br>- ./AdaptixServer/server-dist/404page.html:/app/404page.html:ro</pre><h4>Step 1.8: Running AdaptixC2</h4><p>After completing all the previous steps, we launch AdaptixServer using Docker:</p><pre>root@AdaptixC2:~/AdaptixC2# make docker-up<br>[*] Starting Adaptix server runtime container...<br>[+] up 1/1 <br> ✔ Container adaptix-server-runtime Started                                                                               0.2s<br>[+] Runtime container started<br>[*] Use &#39;make docker-logs&#39; to view logs<br>[*] Use &#39;make docker-down&#39; to stop container<br>root@AdaptixC2:~/AdaptixC2#</pre><h4>Step 1.9: Compiling the Client</h4><p>To access the operations center on the team server, we must use AdaptixClient, which requires compilation (building from source) first. Follow the official instructions at: <a href="https://github.com/Adaptix-Framework/AdaptixC2">AdaptixC2 Client Installation</a></p><p>Next, run AdaptixClient.exe to log in to the team server operations center:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*Ne2TDwk2Uu6OlWOzDvvalg.png" /></figure><ul><li>Notice the use of /lab-ts—this is the exact endpoint we previously configured to restrict access strictly through this path.</li><li>Click <strong>Connect</strong>.</li></ul><p>If you are greeted with this interface, you have successfully configured everything correctly. Congratulations! :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BIxyEGzQS-VkJi84CIeSNA.png" /></figure><h3>Phase 2: Achieving a Callback</h3><h4>Step 2.A: Goal</h4><p>In this phase, our objective is to establish a callback connection to the Command and Control (C2) center using an HTTPS listener.</p><h4>Step 2.1: DNS</h4><p>Just as we set up a dedicated subdomain for operator interactions with the team server, we will now configure a subdomain for the callbacks received from the implant we create.</p><p>Following the same steps as before, our goal is to add an ‘A’ record pointing to our team server’s IPv4 address. I selected “cdn” as the subdomain to facilitate traffic blending during the post-exploitation phase:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*WqZ_7neR-l1xN9yX-_w1PQ.png" /></figure><h4>Step 2.2 Nginx Configurations</h4><p>Add the following settings to /etc/nginx/sites-available/default to include routing directives for the newly added subdomain:</p><pre>server {<br>    listen 80;<br>    listen [::]:80;<br>    server_name cdn.proactive-learning.net;<br>location /.well-known/acme-challenge/ {<br>        root /var/www/html;<br>    }<br>   location / {<br>        return 301 https://$host$request_uri;<br>    }<br>}<br>server {<br>    listen 443 ssl http2;<br>    listen [::]:443 ssl http2;<br>    server_name cdn.proactive-learning.net;<br>ssl_certificate     /etc/letsencrypt/live/cdn.proactive-learning.net/fullchain.pem;<br>    ssl_certificate_key /etc/letsencrypt/live/cdn.proactive-learning.net/privkey.pem;<br>    include /etc/letsencrypt/options-ssl-nginx.conf;<br>    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;<br>server_tokens off;<br>location / {<br>        proxy_pass https://127.0.0.1:8443;<br>        proxy_ssl_verify off;<br>        proxy_http_version 1.1;<br>        proxy_set_header Host $host;<br>        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br>        proxy_set_header X-Forwarded-Proto $scheme;<br>        proxy_read_timeout 3600s;<br>        proxy_send_timeout 3600s;<br>    }<br>}</pre><p>Then, apply these settings by executing the following commands:</p><pre>sudo nginx -t<br>sudo systemctl reload nginx</pre><h4>Step 2.3: Let’s Ecnrypt</h4><p>Following the same steps as before, we authenticate the subdomain by obtaining a Let’s Encrypt certificate via the ACME challenge:”</p><pre>cd ~/AdaptixC2/AdaptixServer/server-dist<br>certbot --nginx -d cdn.proactive-learning.net</pre><h4>Step 2.4: Listener Creation</h4><p>In this step, we will create a listener that will determine the method of communication with the Command and Control (C2) center. Click on the ‘headset’ icon, click on the empty space, and select ‘Create’. Apply the following settings:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*ezkVkkHZCLPtxGAY0bwiXg.png" /></figure><ul><li>Select external (http).</li><li>You will automatically get BeaconHTTP.</li><li>Name the listener.</li><li>Due to the reverse proxy design established in a previous stage, you must fill in the <strong>Bind</strong> options to exactly match the earlier configuration.</li><li>The callback address is the subdomain name along with port 443.</li><li>Ensure Use SSL is selected.</li></ul><p>Before clicking ‘Create’, select the ‘Page Error’ tab at the top and replace its content with the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*HwUGOgGKC-vhYUsbRy75hw.png" /></figure><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>  &lt;meta charset=&quot;UTF-8&quot;&gt;<br>  &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>  &lt;title&gt;401 Unauthorized&lt;/title&gt;<br>  &lt;style&gt;<br>    @import url(https://medium.com/&#39;https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&amp;display=swap&#39;);<br>* {<br>      margin: 0;<br>      padding: 0;<br>      box-sizing: border-box;<br>    }<br>body {<br>      min-height: 100vh;<br>      display: flex;<br>      align-items: center;<br>      justify-content: center;<br>      background: #0a0a0f;<br>      font-family: &#39;Inter&#39;, system-ui, sans-serif;<br>      color: #f0f0f5;<br>      overflow: hidden;<br>      position: relative;<br>    }<br>/* Subtle animated grid background */<br>    body::before {<br>      content: &#39;&#39;;<br>      position: absolute;<br>      inset: 0;<br>      background-image:<br>        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),<br>        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);<br>      background-size: 48px 48px;<br>      mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);<br>      animation: gridPulse 8s ease-in-out infinite;<br>    }<br>@keyframes gridPulse {<br>      0%, 100% { opacity: 0.4; }<br>      50% { opacity: 0.7; }<br>    }<br>.card {<br>      position: relative;<br>      z-index: 1;<br>      text-align: center;<br>      padding: 3.5rem 3rem;<br>      border-radius: 24px;<br>      background: linear-gradient(145deg, rgba(25, 25, 35, 0.9), rgba(15, 15, 22, 0.95));<br>      border: 1px solid rgba(255, 255, 255, 0.08);<br>      box-shadow:<br>        0 0 0 1px rgba(255, 80, 80, 0.08),<br>        0 25px 50px -12px rgba(0, 0, 0, 0.6),<br>        0 0 80px -20px rgba(255, 60, 60, 0.15);<br>      max-width: 440px;<br>      width: 90%;<br>      animation: fadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;<br>    }<br>@keyframes fadeUp {<br>      from {<br>        opacity: 0;<br>        transform: translateY(24px);<br>      }<br>      to {<br>        opacity: 1;<br>        transform: translateY(0);<br>      }<br>    }<br>.icon {<br>      width: 72px;<br>      height: 72px;<br>      margin: 0 auto 1.75rem;<br>      border-radius: 50%;<br>      background: rgba(255, 70, 70, 0.12);<br>      display: flex;<br>      align-items: center;<br>      justify-content: center;<br>      border: 1px solid rgba(255, 80, 80, 0.25);<br>      animation: pulse 2.5s ease-in-out infinite;<br>    }<br>   @keyframes pulse {<br>      0%, 100% { box-shadow: 0 0 0 0 rgba(255, 70, 70, 0.25); }<br>      50% { box-shadow: 0 0 0 12px rgba(255, 70, 70, 0); }<br>    }<br>.icon svg {<br>      width: 32px;<br>      height: 32px;<br>      stroke: #ff5c5c;<br>      stroke-width: 1.8;<br>      fill: none;<br>    }<br>.code {<br>      font-size: 0.8rem;<br>      font-weight: 600;<br>      letter-spacing: 0.18em;<br>      text-transform: uppercase;<br>      color: #ff6b6b;<br>      margin-bottom: 0.75rem;<br>    }<br>h1 {<br>      font-size: 1.85rem;<br>      font-weight: 800;<br>      letter-spacing: -0.02em;<br>      line-height: 1.25;<br>      margin-bottom: 0.85rem;<br>      background: linear-gradient(135deg, #ffffff 0%, #d0d0e0 100%);<br>      -webkit-background-clip: text;<br>      -webkit-text-fill-color: transparent;<br>      background-clip: text;<br>    }<br>p {<br>      font-size: 1.05rem;<br>      color: #a0a0b8;<br>      line-height: 1.5;<br>      max-width: 280px;<br>      margin: 0 auto 2rem;<br>    }<br>.badge {<br>      display: inline-flex;<br>      align-items: center;<br>      gap: 0.4rem;<br>      padding: 0.45rem 1rem;<br>      border-radius: 999px;<br>      background: rgba(255, 70, 70, 0.1);<br>      border: 1px solid rgba(255, 80, 80, 0.2);<br>      font-size: 0.8rem;<br>      font-weight: 600;<br>      color: #ff8a8a;<br>      letter-spacing: 0.03em;<br>    }<br>.badge::before {<br>      content: &#39;&#39;;<br>      width: 6px;<br>      height: 6px;<br>      border-radius: 50%;<br>      background: #ff5c5c;<br>      box-shadow: 0 0 8px #ff5c5c;<br>    }<br>  &lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;div class=&quot;card&quot;&gt;<br>    &lt;div class=&quot;icon&quot;&gt;<br>      &lt;svg viewBox=&quot;0 0 24 24&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;<br>        &lt;rect x=&quot;5&quot; y=&quot;11&quot; width=&quot;14&quot; height=&quot;10&quot; rx=&quot;2&quot; /&gt;<br>        &lt;path d=&quot;M8 11V7a4 4 0 0 1 8 0v4&quot; /&gt;<br>        &lt;circle cx=&quot;12&quot; cy=&quot;16&quot; r=&quot;1.2&quot; fill=&quot;#ff5c5c&quot; stroke=&quot;none&quot; /&gt;<br>      &lt;/svg&gt;<br>    &lt;/div&gt;<br>    &lt;div class=&quot;code&quot;&gt;Error 401&lt;/div&gt;<br>    &lt;h1&gt;You&#39;re Unauthorized&lt;/h1&gt;<br>    &lt;p&gt;You don’t have permission to access this resource. Authentication is required.&lt;/p&gt;<br>    &lt;div class=&quot;badge&quot;&gt;Access Denied&lt;/div&gt;<br>  &lt;/div&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>This ensures the following page appears when attempting to connect to the subdomain:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8hXacqoo8V7IsACFJrxcmw.png" /></figure><h4>Step 2.5: Callback</h4><p>It is time to fully test our setup! We will generate an implant to verify whether we receive a callback connection to the Command and Control (C2) center. We start by right-clicking on the listener we recently created and selecting ‘Generate’. Apply the following settings:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*9RuV76rn0KOaiQN2W4t_3A.png" /></figure><p>Now, we execute the implant within our test environment to verify if we successfully receive a callback connection:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Q5i2cIDRSWVoyNOYeKjrQ.png" /></figure><p>We have successfully received the connection!”</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=68615f658937" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Who Caught Whom?]]></title>
            <link>https://medium.com/@yhamenite/who-caught-whom-901f02f59a6b?source=rss-f4c36136665c------2</link>
            <guid isPermaLink="false">https://medium.com/p/901f02f59a6b</guid>
            <category><![CDATA[digital-forensics]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[dfir]]></category>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[siem]]></category>
            <dc:creator><![CDATA[Yamen Idriss]]></dc:creator>
            <pubDate>Tue, 23 Jun 2026 08:30:12 GMT</pubDate>
            <atom:updated>2026-06-23T08:30:12.554Z</atom:updated>
            <content:encoded><![CDATA[<p>On the morning of one of the blessed Fridays, I received a high-severity alert on the SIEM (Security Information and Event Management) system indicating a “Malware Prevention” event. The initial data was very strange, and as I dug deeper into the investigation my confusion only grew, because what had been blocked was a “Rename” event on a file. When I looked at the file name, I found it made up of a string of letters and numbers, formatted like this: $R6UAZHV.exe. It occurred to me that this was just a passing event, and I was about to close it without investigating, since noise in certain systems leading to false alerts is a very common occurrence.</p><p>But the way the file was named reminded me that Windows assigns a random 6-character code when a user deletes a file, placing the file’s content in a file beginning with $R, while storing the metadata in a file beginning with $I, inside the Recycle Bin folder belonging to that specific user. In reality, what exposed the user was their very attempt to get rid of the file; the act of deletion itself was the trap! The following image is an approximate illustration of the idea:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qeJXT-cLLImaHPtGeGsqQw.png" /><figcaption>Deleting a file in a Windows operating system</figcaption></figure><p>And because Endpoint Detection and Response (EDR) systems scan files on every “Write,” “Rename,” or “Execute” event, the system scanned the file the moment the user deleted it, and classified its content as “malicious” based on the machine learning (ML) algorithms built into the system. I then extracted the deleted file through the EDR system to carry out further investigation.</p><p>At this point it occurred to me to use a tool from the rifiuti2 package, since it is capable of recovering metadata, which could help bring the investigation to a conclusion. I ran the command apt install rifiuti2, which added two executables to the operating system: rifiuti and rifiuti-vista. We used rifiuti-vista because it parses the records of the $Recycle.Bin folder on modern Windows systems. Upon running the following command, rifiuti-vista \$I6UAZHV.exe, the tool displayed the metadata of the deleted file, showing us the deletion date and time, and the original path the file was deleted from:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1005/1*pOCTQjCmynSaSvkP2DzUAw.png" /></figure><p>From this point, after learning the name of the deleted program, we were able to go back to the logs for further analysis, in addition to pulling more digital forensic evidence that could provide information about how this malicious program reached the device. And it did indeed; we reached the answer and presented it to the department responsible for the employee, which in turn put in place new policies regarding downloading software from the internet. A happy ending :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=901f02f59a6b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CyberDefenders XXE Infiltration]]></title>
            <link>https://medium.com/@yhamenite/cyberdefenders-xxe-infiltration-043613c5e4c3?source=rss-f4c36136665c------2</link>
            <guid isPermaLink="false">https://medium.com/p/043613c5e4c3</guid>
            <category><![CDATA[defensive-security]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[cyberdefender]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Yamen Idriss]]></dc:creator>
            <pubDate>Mon, 01 Jun 2026 08:12:45 GMT</pubDate>
            <atom:updated>2026-06-01T08:12:45.386Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Hello everyone 👋🏻. In this walkthrough, I will be providing steps, tips, and key points to help you successfully complete the <a href="https://cyberdefenders.org/blueteam-ctf-challenges/xxe-infiltration/">CyberDefenders XXE Infiltration</a> lab 🎉.</p><h3>Scenario</h3><p>You are a cybersecurity analyst at PageTurner, a famous online bookstore. An automated alert has detected unusual XML data being processed by the server, indicating a potential XXE (XML External Entity) Injection attack. This raises concerns about the integrity of PageTurner’s customer data and internal systems, prompting an immediate investigation.</p><p>As the lead analyst in this case, you must analyze the network traffic to uncover the nature of the suspicious activity. Your objectives include identifying the attack vector, assessing the scope of any potential data breach, and determining if the attacker gained further access to PageTurner’s internal systems.</p><h3>Questions</h3><h4>Question #1: Can you provide the highest numbered port open on the victim machine?</h4><p>To solve this question, I suggest running Zui (Brim) first since it allows you to write different queries on your PCAP files. But first things first, we need to identify the attacker and the victim machine, this can be done by identifying the odd traffic between hosts using either Zui (Brim) or Wireshark.</p><p>I have decided to use Zui to find such information. After scrolling down enough, we can confidently say that the unusual traffic patterns were observed between two machines, first is the attacker (210.106.114.183) and the second is the compromised web server (50.239.151.185).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BKtbR4PjciMevx81RJpqVg.png" /><figcaption>Attacker machine IP and compromised web server IP</figcaption></figure><p>To figure out the highest open port on the victim web server, we can solve this question backwardly by finding the different open services on the machine and then matching them to their respective port numbers, this can be done by running the following query:</p><pre>id.orig_h==210.106.114.183 | id.resp_h==50.239.151.185 | count() by service</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*TkuRnyzpOm-7vbZ7jCzP5Q.png" /><figcaption>Finding services</figcaption></figure><blockquote>Answer: HTTP is 80 in this case, and MySQL is 3306. Hence the answer is 3306</blockquote><h4>Question 2: What is the complete URI of the PHP script vulnerable to XXE Injection?</h4><p>Now it’s time to run Wireshark, the first thing you notice after quickly inspecting the PCAP, is that the attacker was communicating with the web server over HTTP protocol. We can take advantage of this information to narrow down our displayed packets to look for the vulnerable PHP script (through POST requests <em>HOPEFULLY</em>) by executing the following filter:</p><pre>ip.addr == 210.106.114.183 and http.request.method == POST </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*furp69R2QoTm-YgMmwUUfw.png" /><figcaption>Identifying the complete URI of the PHP script vulnerable to XXE injection</figcaption></figure><blockquote>It’s clear to us that /review/upload.php is the answer</blockquote><h4>Question 3: What’s the name of the first malicious XML file uploaded by the attacker?</h4><p>It’s time to dig deep into these malicious POST request to find the malicious XML files. By examining the first POST request, we can clearly see the name of the uploaded file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bFzJbi6-jMVUaiyLMLgVig.png" /><figcaption>First malicious uploaded XML file</figcaption></figure><blockquote>Filename: TheGreatGatsby.xml</blockquote><h4>Question 4: What’s the name of the web app configuration file the attacker read?</h4><p>By correlating the information gathered from the previous questions, we have to start looking in packets after the packet #88306 since the compromise started from there. But first, we have to expand our packet view by executing the following filter command:</p><pre>(ip.addr == 210.106.114.183 or http.request.method) &amp;&amp; !(_ws.col.protocol == &quot;TCP&quot;)</pre><p>After examining the following packets, we can notice that the attacker made a malicious POST request by uploading a file called ToKillaMockingBird.xml to the web server, attempting to read the config.php configuration file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*r_Y0EIWwIHGS9DJRSlWzHw.png" /><figcaption>Uploading a malicious XML file to read “config.php”</figcaption></figure><blockquote>Filename: config.php</blockquote><h4>Question 5: What’s the password of the compromised database user?</h4><p>It’s common for the database password to be stored in config.php file. Let’s take a look at the response coming from the web server:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*YYDavdKp3ENy4txefG61Ww.png" /><figcaption>Password in cleartext</figcaption></figure><blockquote>Password: Winter2024</blockquote><h4>Question 6: What’s the UTC timestamp of the attacker’s first connection with the MySQL server in attempt to utilize the compromised credentials?</h4><p>The very next two packets (Server Greeting and Login Request packets) reveal the attacker’s first connection to the MySQL server. The UTC time can be found in the “Frame” section within Wireshark:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*NJBBGhtuY6QT0uA5QUu5Rw.png" /><figcaption>UTC time of attacker’s first interaction with the MySQL server</figcaption></figure><p>As we can see, the “UTC Arrival” time is: May 31, 2024 12:08:49.165156000</p><blockquote>UTC Time: 2024–05–31 12:08:49</blockquote><h4>Question 7: Can you identify the name of the web shell the attacker uploaded for remote code execution and persistence?</h4><p>Web shells allow attackers to gain shell access to the web servers. From this shell access, the attacker can execute various commands depending on the granted privilege level.</p><p>We have now to deepen our investigations. By scrolling down enough, we will be able to notice that the attacker is executing “information gathering” commands such as whoami , sudo -l , cat /etc/shadow , etc. from a web shell called booking.php:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/991/1*pOU1OJA6qLTzbH3RlqAuZQ.png" /><figcaption>Web shell</figcaption></figure><blockquote>Web shell name: booking.php</blockquote><h3>Thank you so much 💙!</h3><p>Thank you so much for taking the time to read my post! I truly appreciate your support and hope you found it helpful. Stay tuned for more upcoming security writeups and guides, as I look forward to sharing more insights with you soon 🔜.</p><p>Please feel free to <a href="https://linktr.ee/Yhamenite">contact me</a> 📇.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=043613c5e4c3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Manually Building a Vulnerable Active Directory Homelab from Scratch]]></title>
            <link>https://medium.com/@yhamenite/manually-building-a-vulnerable-active-directory-homelab-from-scratch-51f054f3301f?source=rss-f4c36136665c------2</link>
            <guid isPermaLink="false">https://medium.com/p/51f054f3301f</guid>
            <category><![CDATA[active-directory]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[threat-detection]]></category>
            <category><![CDATA[detection-engineering]]></category>
            <category><![CDATA[defensive-security]]></category>
            <dc:creator><![CDATA[Yamen Idriss]]></dc:creator>
            <pubDate>Sun, 19 Apr 2026 17:52:54 GMT</pubDate>
            <atom:updated>2026-04-19T17:54:12.531Z</atom:updated>
            <content:encoded><![CDATA[<h3>But … why?</h3><p>If you want to learn offensive (or even defensive) security against Active Directory and perform attacks such as Kerberoasting, NTLM relay, Pass-the-Hash, ACL abuse, GPO pivots, <strong>you need a lab where those attacks actually work</strong>. Public CTF boxes are fine for one-shot practice, but nothing beats <strong>owning the infrastructure end-to-end:</strong> you know every user, every share, every misconfiguration, and you can reset it in seconds.</p><p>In this article, we’ll build the foundation:</p><ul><li>A <strong>Windows Server 2022</strong> Domain Controller (with AD DS + AD CS)</li><li>Two <strong>Windows 11 Enterprise</strong> workstations joined to the domain</li><li>A service account with a Kerberoastable SPN</li><li>Abusable SMB shares</li><li>A GPO that kills Windows Defender environment-wide (optional, especailly if you want to practive evasion!)</li><li>Shared local-admin credentials (for PtH / PtP)</li><li>Cross-machine admin rights (for NTLM relay)</li></ul><h3>Prerequisites</h3><ul><li><strong>VMware Workstation Pro</strong> (this is not paid anymore!)</li><li><strong>~80 GB of free disk</strong></li><li><strong>16 GB of host RAM</strong> recommended</li><li><strong>Patience.</strong> A <strong>fresh manual install</strong> takes time. Grab coffee.</li></ul><blockquote><strong><em>Pro tip:</em></strong><em> Take a VMware snapshot after every major milestone (fresh OS, after domain promotion, after joining, etc.). When something breaks (and it will) you’ll thank yourself.</em></blockquote><h3>Topology</h3><p>Here’s what we’re building:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*eY5v2uqwK07mW45Gj1giCw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*t7809_FnJGoFCVa6-H6laA.png" /></figure><p>All three machines live on the same VMnet, with the DC acting as DNS.</p><h3>A Quick Word on Active Directory</h3><p><strong>Active Directory (AD)</strong> is Microsoft’s directory service: a centralized database of users, computers, groups, and policies for Windows networks. If your company has a single username and password that logs you into every machine and file share, you’re using AD.</p><p>A <strong>Domain Controller (DC)</strong> is the server that hosts that directory, authenticates users (via Kerberos or NTLM), and enforces Group Policy. Compromise the DC and, in most environments, you own the business. That’s why AD is the crown jewel of every internal pentest , and why we’re building our own to break.</p><h3>Step 1 — Downloading the ISOs</h3><p>Head to Microsoft’s Evaluation Center: <a href="https://www.microsoft.com/en-us/evalcenter"><strong>https://www.microsoft.com/en-us/evalcenter</strong></a></p><p>Open the pages for <strong>Windows Server 2022</strong> (we’re skipping Server 2025 — still preview) and <strong>Windows 11 Enterprise</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7Zq_QRYziWYoR7qy.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ae-hIe2Ol4w-MA9n.png" /></figure><p>On each page, pick the <strong>ISO</strong> download option.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*a-sXfLWa_goizHKE.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QGXlGvHFuraPCwDP.png" /></figure><p>Microsoft will ask you to register before it hands over the ISO. You can fill in any information — the download page opens regardless.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zjJsJM0SCjDXVf-L.png" /></figure><p>Pick your language and architecture. I’ll go with <strong>English, 64-bit</strong> for both.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TU-iIor62q1eatCv.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/0*oV_QdO8uV-Oi3Um4.png" /></figure><h3>Step 2 — Building the Domain Controller</h3><h3>2a. Create the Server 2022 VM</h3><p>Launch VMware Workstation Pro → <strong>Create a New Virtual Machine</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*MdP_efP96a0zZtwX.png" /></figure><p>Choose <strong>Typical</strong> and click <strong>Next</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/0*Rfna1GM44npioWzo.png" /></figure><p>Point the wizard at the Server 2022 ISO.</p><blockquote><strong><em>Pro tip:</em></strong><em> VMware’s “Easy Install” will try to skip Windows setup screens for you. That’s fine, but if you want full control over partitioning and regional settings, you can uncheck it and step through manually.</em></blockquote><p>Set a username for the Windows install. Leave the product key blank (it’s an evaluation ISO); accept the warning popup and move on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/430/0*k1fyEuwqGX-lK4SL.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/334/0*6B8DSW2HS6INELhg.png" /></figure><p>Pick where to store the VM files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/429/0*4ZR63DIdh5kfa1wy.png" /></figure><p>For disk size, hit the minimum. VMware thin-provisions by default, so the file only grows as you use it, don’t over-allocate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/430/0*oxf3LmVVsWdDz_kJ.png" /></figure><p>Click <strong>Finish</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/430/0*kZXdF3_uks0imc2x.png" /></figure><p>Before powering on, bump the RAM. A rule of thumb: <strong>1/4 to 1/8 of host RAM</strong>. I’m giving this VM <strong>4 GB</strong>. While you’re in the settings, <strong>remove the Floppy drive, </strong>it causes install-time headaches with newer Windows ISOs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/0*DQWB_Eajb7tTY-BL.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/0*87_g5jzXXWjlyURr.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/0*iiWIUYjjStx6ww5Z.png" /></figure><h3>2b. Install Windows Server 2022</h3><p>Boot the VM. When it prompts “Press any key to boot from CD…” — do it quickly, or you’ll loop through a failed boot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hmE8XHN5sa-cjyaN.png" /></figure><p>Choose <strong>Windows Server 2022 Standard Evaluation</strong> → accept the EULA (read it first, of course 😉).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/0*_VncYA1vOOGV7b8E.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1003/0*ROQ7ej9se906X4LP.png" /></figure><p>Pick <strong>Custom: Install Microsoft Server Operating System only (advanced)</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/0*AP487eEuP4HmELO0.png" /></figure><p>Click <strong>New → Apply → Yes</strong> to let Windows auto-partition the disk.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/0*wAHp7jKr2fnlCBX8.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/0*ZLZt1qwoKSngqtjz.png" /></figure><p>Installation will chew for a few minutes, then prompt you to set an Administrator password.</p><blockquote><strong><em>Intentional weakness:</em></strong><em> This is a </em>vulnerable<em> lab. Use a weak-but-valid password like </em><em>P@ssword123 so we can later simulate credential-spraying and offline cracking attacks.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5vTZFVHwSlsMptFr.png" /></figure><p>Click inside the VM, send <strong>Ctrl+Alt+Del</strong> (VMware’s shortcut is the VM menu → Send Ctrl+Alt+Del), and log in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9oNzgoDCxsEf2qLF.png" /></figure><h3>2c. Install VMware Tools</h3><p>You’ll want full-screen, clipboard sharing, and decent graphics. From the VMware menu: <strong>VM → Install VMware Tools</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/0*H6e3VwDsqGnCwUVx.png" /></figure><p>A virtual CD will mount inside Windows. Open it, run <strong>setup64</strong>, and click through the installer (Typical install is fine).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/0*Lncg0c8Qe8nSafGN.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/0*p6EwIcKL565nccij.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/0*2ubogLGsa6TMtOZ9.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/0*R7GFEp0lxxGXG5P9.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/0*ZEKL5MbSodPxhYoP.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*piXlRvncV4xXlpso.png" /></figure><blockquote><strong><em>Don’t reboot yet.</em></strong><em> We’ve got more changes coming that all need one reboot each, batch them into a single restart at the end.</em></blockquote><h3>2d. Rename the Host</h3><p>A server called WIN-XK9B2PLQ isn&#39;t convincing. Let&#39;s pretend we&#39;re inside a real company.</p><p>Search <strong>Rename</strong> in the Start menu → <strong>View your PC name → Rename this PC</strong>. I’m naming mine <strong>DC01</strong> — short for “Domain Controller 01”. Reboot when prompted (reason: <em>Other (Planned)</em>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/0*rn14_ppJ19W590i-.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kTHDplsz4HcicvlY.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/0*X499k7gGUol1cbgC.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/0*Ka7aajHFfSYF62kg.png" /></figure><h3>2e. Snapshot: “Fresh Install”</h3><p>Before we do <em>anything</em> AD-related, snapshot the VM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FzbUgOnd73Kve0lc.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/0*2FRF_jpMkxz8aM0h.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/0*VTV-KzDVfQpjXW1M.png" /></figure><blockquote><strong><em>Tip:</em></strong><em> A good snapshot naming convention — </em><em>01-fresh, </em><em>02-post-dcpromo, </em><em>03-post-adcs, </em><em>04-populated. Your future self will know exactly where to roll back to.</em></blockquote><h3>2f. Install AD DS and Promote to Domain Controller</h3><p>Open <strong>Server Manager → Manage → Add Roles and Features</strong>. Click <strong>Next</strong>, choose <strong>Role-based or feature-based installation</strong>, pick <strong>DC01</strong> from the server pool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mjS-pOjIobETtuuH.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/0*SiDEESGhiRDmOz5w.png" /></figure><p>On the <strong>Server Roles</strong> screen, check <strong>Active Directory Domain Services</strong>. The wizard will prompt to add supporting features — click <strong>Add Features</strong>, then <strong>Next</strong> three times.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/0*35eWjnDT4a4inW9-.png" /></figure><p>On <strong>Confirmation</strong>, check <strong>Restart the destination server automatically if required</strong> and click <strong>Install</strong>.</p><p>Once installation completes, the Results page will show a yellow triangle saying <strong>“Promote this server to a domain controller.”</strong> Click it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/0*XFvQUOO-F-spsW43.png" /></figure><p>Choose <strong>Add a new forest</strong> and enter your <strong>Root domain name</strong>. A FQDN is strongly preferred — something like corp.yamenco.com or ad.yamenco.com.</p><blockquote><strong><em>Warning:</em></strong><em> Don’t pick a domain you use publicly (e.g., don’t use </em><em>google.com). Kerberos and DNS resolution will fight you. Use something you own but only resolve internally, or an invented </em><em>.local-style name.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/0*frH0UtXwYMNo7_nE.png" /></figure><p>For <strong>Domain Controller Options</strong>, set the DSRM password to the same P@ssword123. Click <strong>Next</strong> twice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/0*8CS4V13E3mmXf_qL.png" /></figure><p>Let the <strong>NetBIOS name</strong> auto-populate. Click <strong>Next</strong> twice more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/0*XPCxLDxxnFuzTSOk.png" /></figure><p>The <strong>Prerequisites Check</strong> will throw some warnings about DNS delegation — that’s normal for a standalone forest, ignore them. Click <strong>Install</strong>. The server reboots itself when done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/0*Q3U_UIoy0zyAQZew.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/0*KdHnXqmBJ4YriFqP.png" /></figure><p>After reboot, log in — notice the username is now CORP\Administrator (or whatever your NetBIOS is). Your domain is live.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EBZKBUWW5VY69oB5.png" /></figure><h3>2g. Install AD Certificate Services</h3><p><strong>AD CS</strong> issues certificates to users, computers, and services inside the domain. It’s useful on its own , and it’s also the attack surface behind almost every <strong>ESC1-ESC15</strong> exploit you’ve read about. We want it installed.</p><p>Open <strong>Server Manager → Manage → Add Roles and Features</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*a1Oi88TjobEaL7ki.png" /></figure><p>Click through to <strong>Server Roles</strong> and check <strong>Active Directory Certificate Services</strong> → <strong>Add Features</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/0*UadJGYhSor0lLKJW.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/0*JZb0vaQ2BpRGAkXF.png" /></figure><p>Next through to <strong>Role Services</strong> and make sure <strong>Certification Authority</strong> is checked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/0*LE4_Fm4x3HMXt5f2.png" /></figure><p>On <strong>Confirmation</strong>, tick auto-reboot and click <strong>Install</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/0*Wi8cMO2lJrNF17UA.png" /></figure><p>Once installed, click <strong>Configure Active Directory Certificate Services on the destination server</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/0*JcgAs7EnFO6b8OLk.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/0*U7DwB7FAXct9CTW_.png" /></figure><p>Check <strong>Certification Authority</strong> and click <strong>Next</strong> four times.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/0*__wrq-n4kHqufaKJ.png" /></figure><p>Keep default cryptography settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/0*DQr_uYTu5589eFzU.png" /></figure><p>Click <strong>Configure</strong>. That’s it for the DC.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/0*0vs7tROhkhpdwtLi.png" /></figure><blockquote><strong><em>Snapshot time.</em></strong><em> Take another snapshot — call it </em><em>02-dc-ready. If you break the domain while populating it, you can roll back here instead of rebuilding.</em></blockquote><h3>Step 3 — Building the Workstations</h3><p>We need two Windows 11 Enterprise VMs. I’ll call mine <strong>HR01</strong> and <strong>PR01</strong> — pretend they belong to a Human Resources analyst and a Payroll user. The steps below apply to both; repeat them twice.</p><h3>3a. Create the VM</h3><p>VMware → <strong>Create a New Virtual Machine</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*xeTop1MrhceDTiw6.png" /></figure><p><strong>Typical</strong>, point at the Windows 11 ISO, <strong>Next</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/430/0*1zFzKfGlDa6ma7yw.png" /></figure><p>Name the VM and pick an install location.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/430/0*gIFKDLF4O-iHES8a.png" /></figure><p>Windows 11 requires disk encryption during this wizard — set a memorable password (you won’t need it again after install) and continue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/430/0*g9VObKa_KAoWGW5x.png" /></figure><p>Give it enough disk (60 GB is comfortable).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/430/0*DVdVD_TMVAgqba2u.png" /></figure><p><strong>Uncheck</strong> “Power on this virtual machine after creation”, then <strong>Finish</strong> — we still need to tweak hardware.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/428/0*pXAuGFK74GgAFm4S.png" /></figure><p>In the VM settings, remove the <strong>Floppy</strong> drive (same reason as before) and bump RAM to 4 GB. I renamed the VMware-side machine name to <strong>HR01</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/303/0*t7Akr4SA_jjGXvJE.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/0*5tTsrHkNCmsy2MAs.png" /></figure><h3>3b. Install Windows 11</h3><p>Power on. “Press any key to boot from CD…” — press it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/0*Y3aYSRAknelDO6-Z.png" /></figure><p>Pick language/region → <strong>Install now</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/0*pDZODONKI9Fw4utr.png" /></figure><p>Accept terms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/0*fM7D4B65kidsrXM1.png" /></figure><p>Choose <strong>Custom: Install Windows only (advanced)</strong>, click <strong>New → Apply</strong> to partition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/0*evGVUZP6vmFgSq6c.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/0*L3m5SKjTXNEZrBBC.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/0*27lmSHlbD1O9MYFw.png" /></figure><p>On the OOBE region screen, pick your country → <strong>Yes</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/0*zKE2UgKUtdmBTh9g.png" /></figure><p>Keyboard layout.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/0*fqQaPQS5PsZnyLyx.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/933/0*lTcQvKg9Yw2BDUp9.png" /></figure><blockquote><strong><em>Critical step:</em></strong><em> When Windows 11 demands a Microsoft account, click </em><strong><em>Sign-in options → Domain join instead</em></strong><em>. This unlocks the local-account path. Type a username, click </em><strong><em>Next</em></strong><em>.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/0*kBZB_Cm8vj4WQAZV.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/0*VAsG-YXZXo_lmlmd.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/0*-iArntA2fiQ0PrcK.png" /></figure><p>Set a password. I’ll use Passw0rd123 on this machine (intentionally different from the DC so we can see tools correctly separate user and machine creds later). Fill in the three security questions - anything memorable:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/0*KG_hQEUwM-jY9u8o.png" /></figure><p>Opt out of every piece of telemetry you can. Click <strong>Accept</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/0*tTB90a2oBgZl8Eh4.png" /></figure><p>Windows will grind through updates. Let it finish.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/0*wnma-1G7rQNNMZB7.png" /></figure><p>Rename the machine ( <strong>HR01</strong> for the first, <strong>PR01</strong> for the second) and install VMware Tools exactly as we did on the DC.</p><blockquote><strong><em>Snapshot both workstations</em></strong><em> now, before joining them to the domain. Label: </em><em>01-fresh. </em><strong><em>Repeat every step in Section 3 to build PR01.</em></strong></blockquote><h3>Step 4 — Populating the Domain (Users, Groups, Service Account)</h3><p>Here’s where the lab starts getting interesting. We’re going to:</p><ol><li>Create a standard domain user</li><li>Create a <strong>service account</strong> with a <strong>Kerberoastable SPN</strong></li><li>Create local-user-mirroring domain accounts for HR01 and PR01</li><li>Create an SMB share we’ll later abuse</li><li>Disable Windows Defender across the domain via GPO</li></ol><h3>4a. Open Active Directory Users and Computers (ADUC)</h3><p>On the DC: <strong>Server Manager → Tools → Active Directory Users and Computers</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-q0ukHI20Pa0SQ29.png" /></figure><h3>4b. Clone the Administrator Account (Standard User)</h3><p>Right-click <strong>Administrator → Copy</strong>. This is the fastest way to create a new user with sane defaults.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/0*Bn4MPblL6DQKXOOe.png" /></figure><p>Give it a name. Set the password to P@ssword123, tick <strong>Password never expires</strong>, and click <strong>Next</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/438/0*fjrf0zpOAtG9SKrj.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/436/0*7VXCN8MEmrtEAKVX.png" /></figure><p>Click <strong>Finish</strong> — the new user lands in the <strong>Users</strong> OU.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/0*Ve_Q1AD2cQZw_3tz.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/0*HrD-eimVjaQaKTJX.png" /></figure><h3>4c. Create a Service Account (SPN target)</h3><p>A <strong>service account</strong> is a regular domain user that a Windows service logs in as. In the real world these are often over-privileged and have weak passwords — both of which make them prime <strong>Kerberoasting</strong> targets.</p><p>Copy Administrator again. Name it something service-y, like SQLService. Set a crackable password - I&#39;ll use MYpassword123#.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/0*D8N7hYr2x_gnosne.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/0*bccf8gdj0IcnKLR7.png" /></figure><h3>4d. Create the Domain Users Matching Each Workstation</h3><p>We need the local username on each workstation ( zain on HR01, whatever you chose on PR01) to exist in the domain so it can log in there after joining.</p><p>Right-click empty space in the Users container → <strong>New → User</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qSRh5Ri743OMBR_x.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/0*JVt2odOCBWcfPnt7.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/0*lTdOarSFlm5AEnrf.png" /></figure><p>This share is bait: an NTLM-relay target, a place to drop malicious shortcuts, a trove we’ll exfiltrate. We just need it to exist and be reachable.</p><p><strong>Server Manager → File and Storage Services → Shares → TASKS → New Share</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Fudr5pVubTs7qEFP.png" /></figure><p>Choose <strong>SMB Share — Quick</strong>. Click <strong>Next</strong> twice, give it a name, <strong>Next</strong> three times, <strong>Create</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/0*PMr8ViAuAQ-L7aQ9.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/0*2CbFUvZuMA2hohbb.png" /></figure><h3>4f. Plant a Kerberoastable SPN</h3><p>Here’s the money step. We register a <strong>Service Principal Name (SPN)</strong> on our SQLService user. Any domain user can request a Kerberos TGS ticket encrypted with that service&#39;s NTLM hash - and then crack it offline. This is Kerberoasting, and it&#39;s one of the most common AD attacks in real engagements.</p><p>Open <strong>cmd.exe as Administrator</strong> on the DC and run:</p><pre>setspn -a &lt;DC-HOSTNAME&gt;/&lt;service-name&gt;.&lt;root-domain-name&gt;:PORT &lt;root-domain-name&gt;\&lt;service-name&gt;</pre><p>In my lab that becomes:</p><pre>setspn -a dc01/SQLService.corp.yamenco.com:60111 corp.yamenco.com\SQLService</pre><p>If you see <strong>Updated object</strong> in the output, the SPN is registered.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*DEXDOMITP-JF1seF.png" /></figure><h3>4g. GPO: Disable Windows Defender Domain-Wide (Optional)</h3><p>We’re going to be dropping a lot of noisy tooling onto these workstations in Part 2 (Mimikatz, Rubeus, SharpHound…). Defender will eat them alive. A Group Policy Object that turns Defender off across every domain-joined machine is the cleanest fix for a lab.</p><p>Open <strong>Group Policy Management</strong> (search “GPM” in Start). Locate your domain, right-click → <strong>Create a GPO in this domain, and Link it here</strong>. Name it something like <em>“Disable Defender”</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/0*R9tVHUL5WduaYdLi.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/0*dQAUtoYrp5OrhjaR.png" /></figure><p>Right-click the new GPO → <strong>Edit</strong>. Navigate to:</p><p>Double-click <strong>Turn off Microsoft Defender Antivirus</strong>, set it to <strong>Enabled</strong>, click <strong>OK</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SsGxRbn5Ugi2QaSL.png" /></figure><p>Back in GPM, right-click the GPO and tick <strong>Enforced</strong> to guarantee it wins over any inherited policy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/340/0*rkO61JNCzAyhzRrX.png" /></figure><blockquote><em>⚠️ </em><strong><em>A word on AV evasion:</em></strong><em> Disabling Defender is a </em>lab<em> shortcut. It is </em><strong><em>not</em></strong><em> representative of real engagements — in production environments, AV/EDR is a core part of the attack surface you have to evade, not wish away. We’re removing it only so learners can focus on AD concepts without Defender interfering with every payload. In Part 2 we’ll cover AV-aware tradecraft separately.</em></blockquote><h3>Step 5 — Joining the Workstations to the Domain</h3><h3>5a. Fix DNS First (Read This!)</h3><blockquote><em>🚨 </em><strong><em>This is the #1 thing that breaks for beginners.</em></strong><em> Before a workstation can find your domain, it has to </em><strong><em>use DC01 as its DNS server</em></strong><em>. On the workstation, open </em><strong><em>Network &amp; Internet Settings → Change adapter options → right-click your NIC → Properties → IPv4 → Properties</em></strong><em>, and set </em><strong><em>Preferred DNS server</em></strong><em> to the IP address of DC01.</em></blockquote><blockquote><em>If you skip this, the workstation will try to resolve </em><em>corp.yamenco.com against your ISP and fail. Nothing else in this section will work until DNS is pointed correctly.</em></blockquote><h3>5b. Join the Domain</h3><p>On a workstation (not the DC), search <strong>Domain</strong> → <strong>Access work or school → Connect → Join this device to a local Active Directory domain</strong>. Enter your domain (e.g. corp.yamenco.com).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/0*Dq6E4t8YPC_-Fngs.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gLcagm1r9SKYOOit.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/0*D32ce-5CNmXTQepn.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/0*l_8hFl9cp6CPtV2G.png" /></figure><p>When the domain resolves, you’ll be prompted for domain creds. Log in as a domain user. Choose an account type (Standard is fine) and <strong>restart</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/441/0*s4t40RUTgVtCBgIk.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/0*pxze19n1eIXqzplM.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/0*IHFsOCGb3k2Ok0wr.png" /></figure><h3>5c. Enable and Configure the Local Administrator Account</h3><p>By default, the local Administrator account is disabled on Windows 11. We want it enabled, with a known password <strong>that is identical on both workstations</strong> - that&#39;s what makes Pass-the-Hash and Pass-the-Password work laterally.</p><p>Log in locally and search <strong>Edit local users and groups</strong> → <strong>lusrmgr.msc</strong>.</p><p>Right-click <strong>Administrator → Set Password</strong>. I’ll use Password123! on <strong>both</strong> HR01 and PR01.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/459/0*TmjI6HHZbOIycedk.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/0*HrG9lwfO27xcqDNW.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*o4wRibSV9t4VRNZn.png" /></figure><p>Double-click the <strong>Administrator</strong> account, <strong>uncheck</strong> <em>“Account is disabled”</em>, <strong>Apply → OK</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/0*7gIvKeLHwiAcb_Sy.png" /></figure><p>Head to <strong>Groups</strong>, double-click <strong>Administrators</strong>, click <strong>Add</strong>, and add the domain user of the current host (in my case, zain on HR01). <strong>Apply → OK</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DnWeXAckHdLS54wD.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/459/0*DTATIWQg74nlU6dc.png" /></figure><blockquote><strong><em>Repeat the entire section on PR01 — with the SAME local administrator password</em></strong><em> ( </em><em>Password123!). This is a deliberate misconfiguration: it&#39;s exactly what we want, because a compromised local admin hash on HR01 will now authenticate to PR01.</em></blockquote><h3>5d. The NTLM Relay Setup</h3><p>On <strong>PR01</strong> (the second workstation), add HR01’s domain user ( zain) to the local <strong>Administrators</strong> group in addition to PR01&#39;s own user. This cross-machine local-admin relationship is what enables <strong>NTLM relay</strong> attacks - we can coerce HR01&#39;s user to authenticate to PR01 and get admin access there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/0*U6y0UJNs537fqTgM.png" /></figure><p>Finally, on one of the workstations (ideally the one with both admin accounts enabled), map the SMB share we created earlier. Open <strong>This PC → ⋯ (three dots) → Map network drive</strong>. Enter the share’s UNC path (\\dc01\&lt;sharename&gt;), check all the &quot;reconnect at sign-in&quot; and &quot;connect using different credentials&quot; boxes, and click <strong>Finish</strong>.</p><p>When prompted, authenticate as the DC’s local admin:</p><p>You’ll know you succeeded when the share shows up under <strong>Network locations</strong> in File Explorer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/0*o5TKQR38iNEY7QX_.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/0*0zFHUaAzrtSOWY7p.png" /></figure><blockquote><strong><em>Why bother?</em></strong><em> Cached credentials are their own attack surface. Tools like </em><em>Mimikatz, </em><em>lsassy, and </em><em>SharpDPAPI specifically hunt for mapped-drive and Credential Manager secrets - we want those artifacts to exist on our workstations so the attacks land.</em></blockquote><h3>You’re Done (for Now :D)</h3><p>Take one last snapshot on every VM, labeled 03-lab-complete. You now have:</p><ul><li>✅ A forest (corp.yamenco.com) with a Domain Controller</li><li>✅ AD CS (certificate authority) installed — ready for ESC abuse practice</li><li>✅ A Kerberoastable service account (SQLService)</li><li>✅ Two domain-joined Windows 11 workstations</li><li>✅ Shared local-admin credentials (Pass-the-Hash playground)</li><li>✅ Cross-machine local-admin rights (NTLM relay playground)</li><li>✅ An SMB share with cached DC credentials</li><li>✅ No Defender getting in the way</li></ul><p>This is the same shape of environment we encounter in real internal-network engagements — just condensed into three VMs on your laptop.</p><h3>Resources and References</h3><ul><li><a href="https://tcm-sec.com/academy/practical-ethical-hacking/">Practical Ethical Hacking Course, by TCM</a></li><li><a href="https://academy.hackthebox.com/course/preview/introduction-to-active-directory">Introduction to Active Directory Course, by HackTheBox</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51f054f3301f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>