diff --git a/config.yaml b/config.yaml index 679d183f6..08eff1b27 100644 --- a/config.yaml +++ b/config.yaml @@ -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 diff --git a/core/main/router/router.rb b/core/main/router/router.rb index e7bcf9c9f..0dcabdadf 100644 --- a/core/main/router/router.rb +++ b/core/main/router/router.rb @@ -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: + # + #
+ #The requested URL /aaaa was not found on this server.
+ #