What attackers do. Attackers use JavaScript, or Microsoft's JScript, to run malicious code through script hosts, browsers or runtimes such as Node.js. Malicious JavaScript files are often sent as attachments or served by compromised websites. This serves the Execution tactic.
How to defend. Change default file associations so script files open in a text editor rather than running, restrict script hosts with application control, and keep browsers and runtimes patched. Endpoint detection should watch script hosts and their child processes. Disable Windows Script Host for users who do not need it, which removes a common route for malicious script files.
Signs to look for. Look for script hosts running files from download or email folders, scripts spawning shells or making network connections, and heavily obfuscated scripts. A common gap is that script files in archives bypass attachment filters.