Added basic web-server imitation (overriding Server response headers, added config.yaml options).
This commit is contained in:
@@ -37,6 +37,11 @@ beef:
|
||||
hook_file: "/hook.js"
|
||||
hook_session_name: "BEEFHOOK"
|
||||
session_cookie_name: "BEEFSESSION"
|
||||
# Imitate a specified web server (default root page, 404 default error page, 'Server' HTTP response header)
|
||||
web_server_imitation:
|
||||
enable: false
|
||||
#supported: apache, iis
|
||||
type: "apache"
|
||||
|
||||
database:
|
||||
# For information on using other databases please read the
|
||||
|
||||
@@ -23,6 +23,29 @@ module BeEF
|
||||
configure do set :show_exceptions, false end
|
||||
not_found do 'Not Found' end
|
||||
|
||||
before do
|
||||
# @note Override Server HTTP response header
|
||||
if config.get("beef.http.web_server_imitation.enable")
|
||||
type = config.get("beef.http.web_server_imitation.type")
|
||||
case type
|
||||
when "apache"
|
||||
headers "Server" => "Apache/2.2.3 (CentOS)"
|
||||
#todo https://github.com/beefproject/beef/issues/98 if web_server imitation is enabled
|
||||
#todo the 404 response will be something like the following:
|
||||
#<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
|
||||
#<html><head>
|
||||
#<title>404 Not Found</title>
|
||||
#</head><body>
|
||||
#<h1>Not Found</h1>
|
||||
#<p>The requested URL /aaaa was not found on this server.</p>
|
||||
# <hr>
|
||||
# <address>Apache/2.2.3 (CentOS)</address>
|
||||
# </body></html>
|
||||
when "iis"
|
||||
headers "Server" => "Microsoft-IIS/7.0"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user