Detection rules › Splunk

Wscript_Cscript Execution (Windows Event Log)

Group by
_time, host
Source
github.com/anvilogic-forge/armory

Monitor the execution of wscript or cscript processes as these are commonly utilized by threat actors to run malicious VBScript or JScript code

MITRE ATT&CK coverage

References

Telemetry coverage

Rule body

id: '1029.1034'
title: Wscript_Cscript Execution
description: 'Monitor the execution of wscript or cscript processes as these are commonly
  utilized by threat actors to run malicious VBScript or JScript code Threat Actor
  Association: Actinium/Gamaredon/Primitive Bear, Andariel, Antlion, APT10/menuPass,
  APT28/Fancy Bear, APT29/Nobelium/Cozy Bear, APT31, APT33, APT35, APT37/Chinotto,
  APT43, Blind Eagle/APT-C-36, Carbanak, Evilnum, FIN7, Gamaredon Group/Shuckworm,
  Kimsuky, Mustang Panda (aka. Stately Taurus//Earth Preta/BRONZE PRESIDENT/TA416/RedDelta),
  NewsPenguin, Prophet Spider, TA2541, TA428, TA551, UAC-0057 (GhostWriter), WIRTE,
  Witchetty Software Association: Agent Tesla, Astaroth, Avaddon, Black Basta, BazarLoader,
  Cring, DarkGate, MirrorBlast, NanoCore, PoetRAT, QakBot, RATDispenser, SquirrelWaffle,
  Trickbot, Remcos RAT, WhisperGate, Zloader Atomics T1105 Test #11 Atomics T1059.005
  Test #1 Atomics T1082 Test #9 Atomics T1547.001 Test #5 -- #TrendingThreat #Russia
  #Ukraine'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR
  "<EventID>4688<" OR Type=Process) ("cscript.exe" OR "WScript.exe" OR "cscript" OR
  "wscript") | regex process="(?i)(w|c)script.{1,}?\.\w{2,4}" | table _time, host,
  user process, process_*, parent_*, signature_id | bin span=1s | stats values(*)
  as * by _time, host '
techniques:
- execution:command and scripting interpreter:visual basic
- execution:command and scripting interpreter:javascript
technique_id:
- T1059.007
- T1059.005
data_category:
- Windows event logs
references:
- https://secure.anvilogic.com/use_cases?id=AVL_UC1029

Stages and Predicates

Stage 1: search

`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR "<EventID>4688<" OR Type=Process) ("cscript.exe" OR "WScript.exe" OR "cscript" OR "wscript")

Stage 2: regex

| regex process="(?i)(w|c)script.{1,}?\.\w{2,4}"

Stage 3: table

| table _time, host, user process, process_*, parent_*, signature_id

Stage 4: bucket

| bin span=1s

Stage 5: stats

| stats values(*) as * by _time, host

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
EventCodeeq
  • 4688 corpus 317 (splunk 283, kusto 33, elastic 1)
field:"EventID" kind:eq value:"4688"
processregex_match
  • "(?i)(w|c)script.{1,}?.\w{2,4}" corpus 2 (splunk 2)
field:"CommandLine" kind:regex_match

Search terms

These SPL tokens match against raw event text.

StageTerm
1"<EventID>4688<"
1"cscript.exe"
1"WScript.exe"
1"cscript"
1"wscript"