Fix #8675, Add Cache-Control header, also meta tag for BAP2

Hopefully that browsers will respect this.

Fix #8675
bug/bundler_fix
wchen-r7 2017-07-10 16:05:09 -05:00
parent 2ee6df66cf
commit 50b1ec4044
3 changed files with 7 additions and 1 deletions

View File

@ -810,6 +810,7 @@ module Msf
%Q|<html> %Q|<html>
<head> <head>
<meta http-equiv="cache-control" content="no-cache" />
<script> <script>
#{js} #{js}
</script> </script>

View File

@ -32,6 +32,7 @@ module Exploit::Remote::HttpServer
register_evasion_options( register_evasion_options(
[ [
OptBool.new('HTTP::no_cache', [false, 'Disallow the browser to cache HTTP content', false]),
OptBool.new('HTTP::chunked', [false, 'Enable chunking of HTTP responses via "Transfer-Encoding: chunked"', false]), OptBool.new('HTTP::chunked', [false, 'Enable chunking of HTTP responses via "Transfer-Encoding: chunked"', false]),
OptBool.new('HTTP::header_folding', [false, 'Enable folding of HTTP headers', false]), OptBool.new('HTTP::header_folding', [false, 'Enable folding of HTTP headers', false]),
OptBool.new('HTTP::junk_headers', [false, 'Enable insertion of random junk HTTP headers', false]), OptBool.new('HTTP::junk_headers', [false, 'Enable insertion of random junk HTTP headers', false]),
@ -558,6 +559,10 @@ module Exploit::Remote::HttpServer
response.headers.junk_headers = 1 response.headers.junk_headers = 1
end end
if datastore['HTTP::no_cache']
response.headers['Cache-Control'] = 'no-store, no-cache, must-revalidate'
end
headers.each_pair { |k,v| response[k] = v } headers.each_pair { |k,v| response[k] = v }
cli.send_response(response) cli.send_response(response)

View File

@ -74,7 +74,7 @@ class MetasploitModule < Msf::Auxiliary
def on_request_exploit(cli, req, target_info) def on_request_exploit(cli, req, target_info)
print_target_info(cli, target_info) print_target_info(cli, target_info)
send_not_found(cli) send_response(cli, '')
end end
def run def run