2024-01-22 13:29:57 +00:00
id : privesc-node
info :
name : Node - Privilege Escalation
author : daffainfo
severity : high
description : |
Node.js is a popular open-source, cross-platform JavaScript runtime environment that executes JavaScript code outside of a web browser. It is commonly used for building scalable network applications and is known for its event-driven, non-blocking I/O model. Node.js is widely used for server-side scripting and has a large ecosystem of libraries and frameworks.
reference :
- https://gtfobins.github.io/gtfobins/node/
metadata :
2024-01-29 11:58:34 +00:00
max-request : 4
2024-01-22 13:29:57 +00:00
verified : true
tags : code,linux,node,privesc
self-contained : true
code :
- engine :
- sh
- bash
source : |
whoami
- engine :
- sh
- bash
source : |
node -e 'require("child_process").spawn("whoami", {stdio: [0, 1, 2]})'
- engine :
- sh
- bash
source : |
sudo node -e 'require("child_process").spawn("whoami", {stdio: [0, 1, 2]})'
- engine :
- sh
- bash
source : |
node -e 'process.setuid(0); require("child_process").spawn("whoami", {stdio: [0, 1, 2]})'
matchers-condition : and
matchers :
- type : word
part : code_1_response
words :
- "root"
negative : true
- type : dsl
dsl :
- 'contains(code_2_response, "root")'
- 'contains(code_3_response, "root")'
- 'contains(code_4_response, "root")'
2024-01-22 16:20:01 +00:00
condition : or
# digest: 4a0a00473045022100dcb589afe5b82d4c95a8a103942bdfa4ffdeca24be83816bda1013e2efdb0648022067f67aba51dd433b67493daa6970d379d08bf8c91351375fac26c6c2a54f0999:922c64590222798bb761d5b6d8e72950