Suspicious Remote Javascript Evaluation via Nodejs
Description
Detects when Node.js makes an outbound network connection followed immediately by the command line evaluation of JavaScript. Threat actors will host a remote JavaScript payload that will be fetched and executed via the Node.js evaluate flag.
Query · eql
sequence with maxspan=20s
[network where event.action == "connection_attempted" and process.name == "node" and
not destination.domain in ("registry.npmjs.org", "classic.yarnpkg.com", "platform.claude.com", "api.anthropic.com", "registry.yarnpkg.com", "api.z.ai",
"telemetry.nuxt.com", "api.fontshare.com", "yarnpkg.com", "telemetry-staging.elastic.co", "elastic.litellm-prod.ai",
"chatgpt.com", "bedrock-runtime.us-east-1.amazonaws.com")] by process.entity_id
[process where event.type == "start" and event.action == "exec" and process.name == "node" and
process.args == "-e" and process.args_count == 3 and
not process.command_line : ("*try*require*postinstall*catch*", "*import*postinstall*catch*")] by process.parent.entity_id