<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hector</title>
    <description>The latest articles on DEV Community by Hector (@hector1).</description>
    <link>https://dev.to/hector1</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4269224%2Fc8af6a51-6862-4b98-8298-bb9f1631baf2.png</url>
      <title>DEV Community: Hector</title>
      <link>https://dev.to/hector1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hector1"/>
    <language>en</language>
    <item>
      <title>How I Tuned Wazuh SIEM &amp; Tested a 3-Stage Atomic Red Team Attack</title>
      <dc:creator>Hector</dc:creator>
      <pubDate>Fri, 27 Nov 2026 15:15:02 +0000</pubDate>
      <link>https://dev.to/hector1/how-i-tuned-wazuh-siem-tested-a-3-stage-atomic-red-team-attack-3imo</link>
      <guid>https://dev.to/hector1/how-i-tuned-wazuh-siem-tested-a-3-stage-atomic-red-team-attack-3imo</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Setting up a SIEM is only half the battle—if your endpoints aren't logging the right details, attacks happen right under your nose. In this post, I share how I upgraded my Windows Active Directory server (&lt;code&gt;ad01&lt;/code&gt;) to capture hidden PowerShell activity, tested my defenses with three Atomic Red Team attacks, and learned the hard way why checking a config file first can save your whole lab.&lt;br&gt;
Hi, I’m Hector Franco, and I’m excited to share my very first technical blog post as I transition into the cybersecurity field! What drew me to cybersecurity is the detective work—taking thousands of noisy system logs and piecing them together to uncover what an attacker actually did behind the scenes. I hope fellow students and aspiring SOC analysts find my setup journey, mistakes, and test results both fun and useful.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setup&lt;br&gt;
Upgrading Windows PowerShell &amp;amp; Security Logging on ad01&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before testing any attacks, I started with my baseline lab in Cloudshare: a central &lt;strong&gt;Wazuh SIEM server&lt;/strong&gt; (&lt;code&gt;10.170.0.99&lt;/code&gt;), a &lt;strong&gt;Linux server&lt;/strong&gt; (&lt;code&gt;observer&lt;/code&gt;), a &lt;strong&gt;Windows Active Directory server&lt;/strong&gt; (&lt;code&gt;ad01&lt;/code&gt;), an &lt;strong&gt;ART Workstation&lt;/strong&gt; for running simulated attacks, and a &lt;strong&gt;Blue-Team Workstation&lt;/strong&gt; for viewing alerts.&lt;/p&gt;

&lt;p&gt;My Modification: Turning on PowerShell &amp;amp; Command-Line Logs&lt;br&gt;
Out of the box, Windows only sends basic logs to Wazuh and hides the exact scripts run inside PowerShell. Since &lt;code&gt;ad01&lt;/code&gt; is our most important server, I wanted Wazuh to capture full PowerShell script activity (&lt;strong&gt;Event ID &lt;code&gt;4104&lt;/code&gt;&lt;/strong&gt;) and detailed program command lines (&lt;strong&gt;Event ID &lt;code&gt;4688&lt;/code&gt;&lt;/strong&gt;).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Enabled detailed logging in Windows&lt;/strong&gt;: I opened &lt;strong&gt;PowerShell as Administrator&lt;/strong&gt; on &lt;code&gt;ad01&lt;/code&gt; and ran these commands to turn on PowerShell Script Block Logging and Process Command-Line Auditing:&lt;br&gt;
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ModuleLogging" -Force | Out-Null&lt;br&gt;
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ModuleLogging" -Name "EnableModuleLogging" -Value 1 -Type DWord&lt;/p&gt;

&lt;p&gt;New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging" -Force | Out-Null&lt;br&gt;
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging" -Name "EnableScriptBlockLogging" -Value 1 -Type DWord&lt;/p&gt;

&lt;p&gt;auditpol /set /subcategory:"Process Creation" /success:enable /failure:enable&lt;br&gt;
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit" -Force | Out-Null&lt;br&gt;
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit" -Name "ProcessCreationIncludeCmdLine_Enabled" -Value 1 -Type DWord&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Told the Wazuh agent to forward the new logs&lt;/strong&gt;: I opened &lt;code&gt;C:\Program Files (x86)\ossec-agent\ossec.conf&lt;/code&gt; in Notepad and added this block right above :&lt;br&gt;
xml&lt;br&gt;
  &lt;br&gt;
    Microsoft-Windows-PowerShell/Operational&lt;br&gt;
    eventchannel&lt;br&gt;
  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Restarted Wazuh &amp;amp; verified it worked&lt;/strong&gt;: I saved the file, ran &lt;code&gt;Restart-Service -Name wazuh&lt;/code&gt;, and ran &lt;code&gt;Get-Process | Select-Object -First 3&lt;/code&gt; in PowerShell. Over in &lt;strong&gt;Wazuh Discover&lt;/strong&gt;, &lt;strong&gt;Event ID &lt;code&gt;4104&lt;/code&gt;&lt;/strong&gt; popped up right away showing my exact command.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My Setup Mistake &amp;amp; How I Fixed It&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When I first opened &lt;code&gt;ossec.conf&lt;/code&gt; in Notepad, I pressed &lt;code&gt;Ctrl + F&lt;/code&gt; and searched for &lt;code&gt;Sysmon&lt;/code&gt; so I could paste my new PowerShell block right underneath it—and Notepad popped up with &lt;strong&gt;"Cannot find 'Sysmon'."&lt;/strong&gt; For a second I was super confused, because I had already set up Sysmon earlier!&lt;/p&gt;

&lt;p&gt;Instead of guessing, I scrolled to the top of the file and searched for instead. That’s when I realized the Cloudshare lab VM had reset &lt;code&gt;ossec.conf&lt;/code&gt; back to default between sessions, wiping out my Sysmon line! Catching that early saved my whole project—I pasted &lt;strong&gt;both&lt;/strong&gt; the &lt;code&gt;Microsoft-Windows-Sysmon/Operational&lt;/code&gt; and &lt;code&gt;Microsoft-Windows-PowerShell/Operational&lt;/code&gt; blocks back into &lt;code&gt;ossec.conf&lt;/code&gt;, restarted Wazuh, and verified both were sending logs.&lt;/p&gt;

&lt;p&gt;Experiment Time! Testing a 3-Stage Attack Chain&lt;/p&gt;

&lt;p&gt;With my new PowerShell and Security logs working, I used Atomic Red Team from ART Workstation to simulate three real-world attacker techniques against ad01 and see what showed up in Wazuh Discover.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Experiment #1: Scheduled Task Persistence (T1053.005)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;• What I ran: Attackers often create Windows Scheduled Tasks so their malicious programs run automatically. On ART Workstation, I loaded Atomic Red Team and ran Test #2 (Scheduled task Local) against ad01, then ran cleanup right after:&lt;br&gt;
Import-Module "C:\AtomicRedTeam\invoke-atomicredteam\Invoke-AtomicRedTeam.psd1" -Force&lt;br&gt;
$sess = New-PSSession -ComputerName ad01&lt;br&gt;
Invoke-AtomicTest T1053.005 -TestNumbers 2 -Session $sess&lt;br&gt;
Invoke-AtomicTest T1053.005 -TestNumbers 2 -cleanup -Session $sess&lt;/p&gt;

&lt;p&gt;• What Wazuh caught: In Wazuh Discover, searching for &lt;em&gt;schtasks&lt;/em&gt; on ad01 brought up Sysmon Event ID 1 (Process Creation) showing C:\Windows\System32\schtasks.exe and the cleanup command SCHTASKS /Delete /TN spawn /F.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My Experiment Mistake &amp;amp; How I Fixed It&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;During my first try at Experiment #1, PowerShell said SUCCESS: The scheduled task "spawn" has been successfully created, so I jumped over to Wazuh Discover—and got 0 results!&lt;br&gt;
After checking my terminal windows, I realized what happened: I had accidentally run $sess = New-PSSession -ComputerName ad01 inside ad01's PowerShell instead of ART Workstation. Because $sess was blank on ART Workstation, the test ran locally on ART Workstation (which has no Wazuh agent). Once I created $sess properly on ART Workstation, checked that it said State: Opened, and re-ran the test with -Session $sess (using &lt;em&gt;schtasks&lt;/em&gt; wildcards in Wazuh's search bar), the alert showed up right away!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Experiment #2: Brute Force — Password Guessing (T1110.001)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;• What I ran: This test simulates an attacker guessing common passwords against a Windows account over SMB (IPC$). Before running it, I checked -ShowDetails and noticed it defaulted to my active Administrator username—which could have locked me out! Instead, I passed a fake username (fakeuser) so I could test it safely:&lt;/p&gt;

&lt;p&gt;Invoke-AtomicTest T1110.001 -TestNumbers 1 -InputArgs @{"user"="fakeuser"} -Session $sess&lt;br&gt;
Invoke-AtomicTest T1110.001 -TestNumbers 1 -cleanup -Session $sess&lt;/p&gt;

&lt;p&gt;What Wazuh caught: Searching for 4625 in Wazuh Discover immediately revealed a spike of Windows Security Event ID 4625 ("An account failed to log on") targeting fakeuser, showing how loud brute-force attacks look in SIEM logs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Experiment #3: Network Service Discovery (T1046)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;• What I ran: Attackers scan internal networks to find open ports like SMB (445) and RDP (3389). To keep Test #10 (Port-Scanning /24 Subnet with PowerShell) fast instead of scanning 254 IP addresses, I targeted just two lab IPs (10.170.0.99 and 127.0.0.1):&lt;/p&gt;

&lt;p&gt;Invoke-AtomicTest T1046 -TestNumbers 10 -InputArgs @{"ip_address"="10.170.0.99,127.0.0.1"} -Session $sess&lt;/p&gt;

&lt;p&gt;What Wazuh caught: Searching for 4104 in Wazuh Discover surfaced the PowerShell Operational Script Block log (Event ID 4104) on ad01—proving that my Setup modification directly caught the PowerShell port-scanning script.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Building and testing this Wazuh SIEM deployment showed me how important it is to fine-tune endpoint logging before an attack happens. Across my three Atomic Red Team experiments on ad01, every stage of the simulated attack left a clear trail once the right log channels were active:&lt;br&gt;
• &lt;strong&gt;Experiment #1 (T1053.005 — Scheduled Task Persistence): **Caught in Sysmon Event ID 1 (Process Creation), showing both the creation and deletion of the "spawn" scheduled task via schtasks.exe.&lt;br&gt;
• **Experiment #2 (T1110.001 — Brute Force: Password Guessing):&lt;/strong&gt; Caught as a spike of Windows Security Event ID 4625 ("An account failed to log on") events targeting my safe test account (fakeuser).&lt;br&gt;
• &lt;strong&gt;Experiment #3 (T1046 — Network Service Discovery):&lt;/strong&gt; Caught directly by my new PowerShell Event ID 4104 (Script Block Logging) setup modification as it scanned ports 445 and 3389.&lt;br&gt;
&lt;strong&gt;How to Avoid My Mistakes:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Always check ossec.conf after a lab reset: Before testing, verify that your  entries (like Sysmon and PowerShell) are still saved above &amp;lt;!-- Policy monitoring --&amp;gt; so you don't lose telemetry.&lt;/li&gt;
&lt;li&gt;Verify your remote session ($sess) on your attacking VM: Make sure you create $sess on ART Workstation and confirm it shows State: Opened before firing tests, otherwise Atomic Red Team will run locally on an unmonitored box.&lt;/li&gt;
&lt;li&gt;Preview tests with -ShowDetails first: Checking parameters ahead of time lets you use safe dummy inputs (like fakeuser) so you don't accidentally lock out your Administrator account or trigger a timeout.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;**Final Thoughts&lt;/p&gt;

&lt;p&gt;5.1 The Coolest Thing I Learned**&lt;/p&gt;

&lt;p&gt;The coolest thing I learned during this project is how raw system events turn into a real detective story once you understand Windows Event IDs and fields. Watching a single command on ART Workstation travel across the network into ad01 and appear seconds later in Wazuh Discover as Event IDs 1, 4104, and 4625 made everything click. Before this lab, logs felt like a wall of confusing text—now I see them as digital footprints that show exactly what happened and when.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5.2 My #1 Piece of Advice for Another Newbie&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Slow down and check your test details (-ShowDetails) before hitting Enter! When I first started, it was tempting to rush straight into firing attacks. Spending just one minute reading what a test actually does—and verifying that your log channels and remote session ($sess) are properly connected—saves you from chasing missing alerts or accidentally locking out your own Administrator account.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;5.3 My Favorite External Resource &amp;amp; Researcher *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;My favorite external resource from this journey is Neo23x0’s sysmon-config repository (forked from SwiftOnSecurity), which I discovered through our Wazuh setup guides. Reading the plain-English comments inside that XML file showed me why defenders monitor specific Windows behaviors—like scheduled tasks, registry changes, and network ports—instead of logging everything blindly.&lt;br&gt;
Finally, I want to thank two external security researchers whose open-source work made this entire lab possible:&lt;br&gt;
• Florian Roth (Neo23x0) — Thank you for maintaining sysmon-config and sharing practical detection rules that map Windows telemetry straight to MITRE ATT&amp;amp;CK.&lt;br&gt;
• Casey Smith (@subTee) &amp;amp; the Red Canary Atomic Red Team Contributors — Thank you for building Atomic Red Team, which gives newcomers a safe, structured way to test real-world attack techniques and learn how SIEM detections work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;MITRE Corporation (2026). MITRE ATT&amp;amp;CK® Enterprise Matrix (T1053.005, T1110.001, and T1046). Available at: &lt;a href="https://mitre.org" rel="noopener noreferrer"&gt;https://mitre.org&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Florian Roth (Neo23x0) &amp;amp; SwiftOnSecurity (2021). sysmon-config: High-Quality Event Tracing Sysmon Configuration. Available at: &lt;a href="https://github.com" rel="noopener noreferrer"&gt;https://github.com&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Microsoft Learn (2025). About Logging Windows (PowerShell Script Block and Module Logging). Available at: &lt;a href="https://microsoft.com" rel="noopener noreferrer"&gt;https://microsoft.com&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Wazuh, Inc. (2025). Wazuh Blog: Detecting PowerShell Exploitation Techniques in Windows Using Wazuh. Available at: &lt;a href="https://wazuh.com" rel="noopener noreferrer"&gt;https://wazuh.com&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Red Canary (2026). Atomic Red Team &amp;amp; Invoke-AtomicRedTeam Execution Framework Wiki. Available at: &lt;a href="https://github.com" rel="noopener noreferrer"&gt;https://github.com&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr3zg9aurmavxgrmyvdl1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr3zg9aurmavxgrmyvdl1.png" alt=" " width="800" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fy1v3sdsirmd7krxti63o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fy1v3sdsirmd7krxti63o.png" alt=" " width="800" height="298"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqaystlq4995ijc29uidl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqaystlq4995ijc29uidl.png" alt=" " width="800" height="289"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fksgdkfzgbof9mabg5o9x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fksgdkfzgbof9mabg5o9x.png" alt=" " width="800" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>infosec</category>
      <category>security</category>
    </item>
  </channel>
</rss>
