Skip to content

Commit 50b1ec4

Browse files
committed
Fix rapid7#8675, Add Cache-Control header, also meta tag for BAP2
Hopefully that browsers will respect this. Fix rapid7#8675
1 parent 2ee6df6 commit 50b1ec4

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

lib/msf/core/exploit/browser_autopwn2.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,7 @@ def build_html(cli, request)
810810

811811
%Q|<html>
812812
<head>
813+
<meta http-equiv="cache-control" content="no-cache" />
813814
<script>
814815
#{js}
815816
</script>

lib/msf/core/exploit/http/server.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def initialize(info = {})
3232

3333
register_evasion_options(
3434
[
35+
OptBool.new('HTTP::no_cache', [false, 'Disallow the browser to cache HTTP content', false]),
3536
OptBool.new('HTTP::chunked', [false, 'Enable chunking of HTTP responses via "Transfer-Encoding: chunked"', false]),
3637
OptBool.new('HTTP::header_folding', [false, 'Enable folding of HTTP headers', false]),
3738
OptBool.new('HTTP::junk_headers', [false, 'Enable insertion of random junk HTTP headers', false]),
@@ -558,6 +559,10 @@ def send_response(cli, body, headers = {})
558559
response.headers.junk_headers = 1
559560
end
560561

562+
if datastore['HTTP::no_cache']
563+
response.headers['Cache-Control'] = 'no-store, no-cache, must-revalidate'
564+
end
565+
561566
headers.each_pair { |k,v| response[k] = v }
562567

563568
cli.send_response(response)

modules/auxiliary/gather/browser_info.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def print_target_info(cli, target_info)
7474

7575
def on_request_exploit(cli, req, target_info)
7676
print_target_info(cli, target_info)
77-
send_not_found(cli)
77+
send_response(cli, '')
7878
end
7979

8080
def run

0 commit comments

Comments
 (0)