Clean Binaries with Suspicious Behaviour

Published: 2022-03-15
Last Updated: 2022-03-15 06:59:52 UTC
by Xavier Mertens (Version: 1)
0 comment(s)

EDR or "Endpoint Detection & Response" is a key element of many networks today. An agent is installed on all endpoints to track suspicious/malicious activity and (try to) block it. Behavioral monitoring is also a key element in modern SIEM infrastructure: To see a word.exe running is definitively not malicious, same with a Powershell script being launched. But if you monitor parent/child relations, to see a Powershell script launched from a Word process, that is suspicious! Here is a simple Sigma[1] rule to detect this behavior:

title: Suspicious PowerShell Invocation Based on Parent Process
id: 95eadcb2-92e4-4ed1-9031-92547773a6db
status: test
description: Detects suspicious powershell invocations from interpreters or unusual programs
author: Florian Roth
date: 2019/01/16
modified: 2022/01/07
  category: process_creation
  product: windows
      - '\wscript.exe'
      - '\cscript.exe'
      - '\word.exe'
      - '\excel.exe'
    Image|endswith: '\powershell.exe'
    CurrentDirectory|contains: '\Health Service State\'
  condition: selection and not falsepositive
  - CommandLine
  - ParentCommandLine
  - Microsoft Operations Manager (MOM)
  - Other scripts
level: medium
  - attack.execution
  - attack.t1059.001

Note: I modified it to add "word.exe" and "excel.exe".

When you implement this kind of rule in your SIEM, the next mandatory step is the fine-tuning process to reduce the unavoidable false positive alerts. Indeed, to increase the detection of suspicious Powershell invocations, it can be tempting to reduce the list of parent processes. The side effect is an increase in noise generated by the alert. For example, do you know that some Microsoft tools are able to launch Powershell script? ccm.exe is a good example[2]. 

I found an interesting project called "w*fbins"[3]. Unlike "lolbas", which lists official Microsoft tools that can be (ab)used by attackers to perform malicious actions, this project aims to list tools that could be flagged as malicious by rules like the one seen above but... they are not! At this time, the tools list remains small but I'm sure it will grow in the future. 


Xavier Mertens (@xme)
Senior ISC Handler - Freelance Cyber Security Consultant

0 comment(s)


Diary Archives