2024-01-22 18:59:57 +05:30
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 18:59:57 +05:30
verified : true
2024-01-31 23:11:31 +05:30
tags : code,linux,node,privesc,local
2024-01-22 18:59:57 +05:30
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
2024-01-31 17:43:39 +00:00
# digest: 4b0a00483046022100e32f25ba4a83d9d265aa187532f0090ba2fdf1beb89235113b4caeed36413ac30221008ecd529618da3ad2ed65e939b4233529614a005b87fd760bbeeb95de2e78746f:922c64590222798bb761d5b6d8e72950