Splunk Enterprise

Drop Temporary SCCM scripts in Windows Events

Lynn_01
Engager

On the universal forwarders, I need a regex pattern to drop Powershell temporary script events in splunk.  I'm trying to use the "Message" object to filter out the following example:

Script Name = C:\\WINDOWS\\CCM\\SystemTemp\\1b71bac2-99a4-4075-a96e-9ecc803443f5.ps1

So far, my blacklist stanza is:  
blacklist1 = EventCode = "4103" Message="C:\\\\WINDOWS\\\\CCM\\\\SystemTemp\\\\.*\.ps1"

But this does not seem to work.  Help please!

 

Labels (1)

cartergray70543
Path Finder

Your regex looks close, but the Message field may not match the exact path format.  Before and after the path, and verify the raw event to confirm how Message is stored. Testing the regex against the raw event usually reveals the mismatch.

0 Karma

livehybrid
SplunkTrust
SplunkTrust

Hi @Lynn_01 

I think you need to adjust the formatting of your blacklist entry in inputs.conf.

Remove the spaces around the inner = characters and the over-escaping of the backslashes.

[WinEventLog://Microsoft-Windows-PowerShell/Operational]
...
... blacklist1 = EventCode="4103" Message="C:\\WINDOWS\\CCM\\SystemTemp\\.*\.ps1 

 

🌟 Did this answer help you? If so, please consider:

    • Adding karma to show it was useful
    • Marking it as the solution if it resolved your issue
    • Commenting if you need any clarification

Your feedback encourages the volunteers in this community to continue contributing.

0 Karma

Lynn_01
Engager

Thank you for the response.

Do you think:

blacklist1 = EventCode="4103" Message="C:\\WINDOWS\\CCM\\SystemTemp\\[0-9|a-z]{8}\-([0-9|a-z]{4}\-){3}[0-9|a-z]{12}\.ps1

Would work to only filter out the specific number/word character syntax these temporary scripts use and allow other .ps1 scripts to be ingested?

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Agentic SOC Triage: Investigating Splunk ES Notables with MCP Server and a Local LLM

The Problem: Too Many Alerts, Too Little Context Security operations teams running Splunk Enterprise Security ...

All Work and No Play? Not at .conf26! Unwind at These Evening Events

Between hands-on technical sessions, keynote reveals, and diving into live architectures, .conf26 is packed ...

Join the Hackathon at .conf26 and build a No-Code AI agent

Join us for the AI Agent Buildathon, an in-person, three-hour hands-on Hackathon where you’ll use Splunk Agent ...