Silent NPM Package Install Command


Description

Detects when Node or NPM is used to install a package or packages using options to hide the installation using the following options: "--no-warnings", "--no-progress", and "--loglevel silent". Malicious packages will install required dependencies in order to function and will use these options in order to hide it from the user.

Query · eql

process where event.type == "start" and process.name in ("node", "npm", "npx") and 
 process.args in ("install", "i", "in", "ins", "inst", "instal", "add", "isnt", "isnta", "isntal", "isntall") and 
 process.args == "--no-save" and 
 process.args == "--no-progress" and 
 ((process.args == "--loglevel" and process.args == "silent") or 
  (process.args in ("-s", "--silent")))
Raw source Silent NPM Package Install Command · Elastic TOML
Esc
Published by elastic/protections-artifacts ↗, licensed under Elastic License 2.0 ↗. Reproduced here unmodified.
[rule]
description = """
Detects when Node or NPM is used to install a package or packages using options to hide the installation using the
following options: "--no-warnings", "--no-progress", and "--loglevel silent". Malicious packages will install required
dependencies in order to function and will use these options in order to hide it from the user.
"""
id = "539488cc-baf9-465f-9700-f978b93b3f62"
license = "Elastic License v2"
name = "Silent NPM Package Install Command"
os_list = ["linux", "macos"]
reference = ["https://jp.security.ntt/tech_blog/contagious-interview-ottercookie"]
version = "1.0.3"

query = '''
process where event.type == "start" and process.name in ("node", "npm", "npx") and 
 process.args in ("install", "i", "in", "ins", "inst", "instal", "add", "isnt", "isnta", "isntal", "isntall") and 
 process.args == "--no-save" and 
 process.args == "--no-progress" and 
 ((process.args == "--loglevel" and process.args == "silent") or 
  (process.args in ("-s", "--silent")))
'''

min_endpoint_version = "8.11.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.003"
name = "Windows Command Shell"
reference = "https://attack.mitre.org/techniques/T1059/003/"

[[threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"



[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"

[internal]
min_endpoint_version = "8.11.0"

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.