Exercise 2 – Using Wazuh to add PowerShell Script Block Logging
In this exercise, we are going to add PowerShell Script Block logs to the Wazuh collection capabilities set. PowerShell Script Block Logging is a feature that comes with later versions of PowerShell (PowerShell v5+). It allows us to instruct Windows to create an event log for every command run in the PowerShell Terminal. A recent trend sees attackers moving away from traditional means of targeting systems through specialized tools and applications, and favoring a living-off-the-land approach, where they use native tools present on the computer systems being attacked instead. These renewed tactics make monitoring for and blocking of malicious tools more difficult—what are you going to do: block cmd.exe
or powershell.exe
? So, being able to record every command run on these native tools is a welcome addition to security monitoring and is often the only way to detect malicious activities.
As an added bonus...