Persistence (TA0003)(external, opens in a new tab or window)
text code block:FROM logs-endpoint.events.process-* METADATA _id, _version, _index | WHERE MV_CONTAINS(event.category, "process") AND MV_CONTAINS(event.type, "start") AND TO_LOWER(process.command_line) LIKE "*--install-extension*" AND TO_LOWER(process.command_line) LIKE "*.vsix*" AND ( ( host.os.type == "windows" AND ( TO_LOWER(process.command_line) RLIKE """.*\\users\\public\\.*|.*\\appdata\\local\\temp\\.*|.*/users/public/.*|.*/appdata/local/temp/.*""" OR TO_LOWER(process.parent.name) IN ( "mshta.exe", "wscript.exe", "cscript.exe", "powershell.exe", "msiexec.exe", "pwsh.exe", "node.exe", "bun.exe", "py.exe" ) OR TO_LOWER(process.parent.name) LIKE "python*" ) ) OR ( host.os.type IN ("macos", "linux") AND ( TO_LOWER(process.command_line) LIKE ( "*/tmp/*", "*/var/tmp/*", "*/private/tmp/*", "*/dev/shm/*", "*/users/shared/*" ) OR TO_LOWER(process.parent.name) IN ( "osascript", "node", "bun" ) OR TO_LOWER(process.parent.name) LIKE "python*" ) ) ) | KEEP _id, _version, _index, data_stream.namespace, @timestamp, host.name, host.id, agent.id, host.os.type, user.name, user.domain, process.name, process.parent.name, process.command_line, process.parent.command_line
Install detection rules in Elastic Security
Detect Suspicious IDE Extension Installation from VSIX in the Elastic Security detection engine by installing this rule into your Elastic Stack.
To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(external, opens in a new tab or window).