Windows Script File Execution via Wscript/Cscript Using Script File Extensions
Flags wscript.exe or cscript.exe executing common script file types via command-line extensions on Windows.
- Product
- windows
- Category
- process_creation
- Author
- Michael Haag (SigmaHQ), DRL 1.1
- Published
- 2019-01-16
- Updated
- 2026-07-31
ATT&CK techniques
ExecutionRecon
Resource Dev
Initial Access
Persistence
Priv Esc
Defense Evasion
Cred Access
Discovery
Lateral Movement
Collection
C2
Exfiltration
Impact
What it detects
This rule identifies Windows process executions of wscript.exe or cscript.exe where the command line contains script file extensions such as .js, .jse, .vba, .vbe, .vbs, .wsf, or .wsh. Attackers can use WSH to run script-based payloads and facilitate execution from script files. Detection relies on Windows process creation telemetry, specifically the OriginalFileName, image path ending with wscript.exe/cscript.exe, and command-line contents.
Reporting behind it
- thedfirreport.comhttps://thedfirreport.com/2023/10/30/netsupport-intrusion-results-in-domain-compromise/
- redcanary.comhttps://redcanary.com/blog/gootloader/
- github.comhttps://github.com/SigmaHQ/sigma/blob/master/rules-threat-hunting/windows/process_creation/proc_creation_win_wscript_cscript_script_exec.yml
Changelog
v5- v5Candidate ingested via manual entry.2026-07-31
- v4Candidate ingested via manual entry.2026-07-31
- v3Candidate ingested via manual entry.2026-07-31
- v2Candidate ingested via manual entry.2026-07-31
- v1No changelog recorded for this version.2026-07-30
Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.
title: Windows Script File Execution via Wscript/Cscript Using Script File Extensions
id: 99cfe7a1-7c7b-4077-ab80-69bad2d72a1a
related:
- id: 23250293-eed5-4c39-b57a-841c8933a57d
type: obsolete
- id: cea72823-df4d-4567-950c-0b579eaf0846
type: derived
- id: 1e33157c-53b1-41ad-bbcc-780b80b58288
type: derived
status: test
description: This rule identifies Windows process executions of wscript.exe or cscript.exe where the command line contains script file extensions such as .js, .jse, .vba, .vbe, .vbs, .wsf, or .wsh. Attackers can use WSH to run script-based payloads and facilitate execution from script files. Detection relies on Windows process creation telemetry, specifically the OriginalFileName, image path ending with wscript.exe/cscript.exe, and command-line contents.
references:
- https://thedfirreport.com/2023/10/30/netsupport-intrusion-results-in-domain-compromise/
- https://redcanary.com/blog/gootloader/
- https://github.com/SigmaHQ/sigma/blob/master/rules-threat-hunting/windows/process_creation/proc_creation_win_wscript_cscript_script_exec.yml
author: Michael Haag, Huntrule Team
date: 2019-01-16
modified: 2026-02-17
tags:
- attack.execution
- attack.t1059.005
- attack.t1059.007
- detection.threat-hunting
logsource:
category: process_creation
product: windows
detection:
selection_img:
- OriginalFileName:
- wscript.exe
- cscript.exe
- Image|endswith:
- \wscript.exe
- \cscript.exe
selection_cli:
CommandLine|contains:
- .js
- .jse
- .vba
- .vbe
- .vbs
- .wsf
- .wsh
condition: all of selection_*
falsepositives:
- Some additional tuning is required. It is recommended to add the user profile path in CommandLine if it is getting too noisy.
level: medium
license: DRL-1.1