Process

unknown

cscript.exe

cscript.exe is the Windows Script Host in its console form, the program that runs VBScript and JScript files (.vbs, .js, .wsf) from the command line. It writes script output to a terminal instead of dialog boxes, which makes it the host of choice for administrative automation and batch-driven scripts, and a quiet way for attackers to run script non-interactively.

File identity

File details

Not observed.

Signing information

Not observed.

File version0

Not observed.

File size0

Not observed.

Execution context

File paths0

Not observed.

User context0

Not observed.

Integrity level0

Not observed.

Instances0

Not observed.

Session0

Not observed.

Token privileges0

Not observed.

Ancestry

Parents0

Not observed.

Children0

Not observed.

Grandparents0

Not observed.

Grandchildren0

Not observed.

Behavior

Loaded modules0

Not observed.

Named pipes0

Not observed.

Process handles0

Not observed.

Command-line patterns0

Not observed.

LOLBAS1
  • cscript //e:vbscript {PATH_ABSOLUTE}:script.vbsADS · Can be used to evade defensive countermeasures or to hide as a persistence mechanism

Indicators

Hashes

Not observed.

Analysis

About this process

cscript.exe is one of the two front-ends to the Windows Script Host (WSH), the built-in engine that runs scripts written in VBScript and JScript. cscript.exe is the console host: it sends WScript.Echo output to standard out, takes input from the command line, and is the natural choice when a script runs inside a batch file, a scheduled task, or another program. Its windowed twin, wscript.exe, shows the same output in pop-up dialogs. The genuine binary lives at C:\Windows\System32\cscript.exe, with a 32-bit copy under SysWOW64.

The scripting language is chosen by the file extension or the /e: switch, and the host hands scripts the same COM objects as wscript.exe, WScript.Shell, WScript.Network, Scripting.FileSystemObject, and others, which let them run programs, edit the registry, and reach the file system. The difference between the two hosts is only where output goes, not what a script can do.

Legitimately, cscript.exe is started by the Task Scheduler, by logon or Group Policy scripts, by software installers, or by an administrator running a script by hand. It is more common than wscript.exe in server and automation contexts. Its parent and the script named on its command line are what give an instance meaning.

Security notes

cscript.exe runs attacker script just as readily as it runs admin script (T1059.005, T1059.007). Because it is signed and built in, a malicious .vbs or .js executes with the user's privileges and passes path and signature checks, leaving the script it runs and its parent as what to examine. Attackers favor the console host when execution is meant to be silent and non-interactive, driven from a batch file or another process rather than a double-click.

As with wscript.exe, the script is often only a stager. COM objects like MSXML2.XMLHTTP and WScript.Shell.Run let a short script pull down and launch the next payload (T1105), so cscript reaching the network or spawning powershell.exe or cmd.exe is the behavior to run down.

Anomaly signals6
  • Image path other than C:\Windows\System32\cscript.exe or its SysWOW64 copyhigh
  • Parent is an Office application, mshta.exe, or another LOLBINhigh
  • Running a script from a user-writable path (Temp, AppData, Downloads) or a mounted ISO or ZIPhigh
  • cscript spawning cmd.exe, powershell.exe, or other LOLBINshigh
  • Outbound network connections from cscripthigh
  • A script file with an encoded body (.vbe, .jse) or an obfuscated command linemed

Telemetry

OS prevalence0

Not observed.

Observation timeline

Not observed.

References

Subsearch

Hasbeen seen inof cscript.exe?