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
references:
  - https://www.carbonblack.com/2017/03/15/attackers-leverage-excel-powershell-dns-latest-non-malware-attack/
date: 2019/01/16
modified: 2022/01/07
logsource:
  category: process_creation
  product: windows
detection:
  selection:
    ParentImage|endswith:
      - '\wscript.exe'
      - '\cscript.exe'
      - '\word.exe'
      - '\excel.exe'
    Image|endswith: '\powershell.exe'
  falsepositive:
    CurrentDirectory|contains: '\Health Service State\'
  condition: selection and not falsepositive
fields:
  - CommandLine
  - ParentCommandLine
falsepositives:
  - Microsoft Operations Manager (MOM)
  - Other scripts
level: medium
tags:
  - 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. 

[1] https://github.com/SigmaHQ/sigma
[2] https://docs.microsoft.com/en-us/mem/configmgr/apps/deploy-use/create-deploy-scripts
[3] https://wtfbins.wtf

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

0 comment(s)

Comments


Diary Archives