From 1c4ef22947ec16261c495a50b0d3d633c135a37c Mon Sep 17 00:00:00 2001 From: Grant Burgess Date: Fri, 10 Jan 2020 14:43:51 +1000 Subject: [PATCH] Changed references to constants to modify easily --- core/main/router/router.rb | 65 ++++---------------------------------- 1 file changed, 6 insertions(+), 59 deletions(-) diff --git a/core/main/router/router.rb b/core/main/router/router.rb index 7ea91f611..b092a5f48 100644 --- a/core/main/router/router.rb +++ b/core/main/router/router.rb @@ -24,61 +24,13 @@ module BeEF case type when "apache" #response body - "" + - "" + - "404 Not Found" + - "" + - "

Not Found

" + - "

The requested URL was not found on this server.

" + - "
" + - "
Apache/2.2.3 (CentOS)
" + - ("" if config.get("beef.http.web_server_imitation.hook_404")).to_s + - "" + BeEF::Core::Router::APACHE_BODY when "iis" #response body - "" + - "The page cannot be found" + - "" + - "" + - "
" + - "

The page cannot be found

" + - "The page you are looking for might have been removed, had its name changed, or is temporarily unavailable." + - "
" + - "

Please try the following:

" + - "
    " + - "
  • Make sure that the Web site address displayed in the address bar of your browser is spelled and formatted correctly.
  • " + - "
  • If you reached this page by clicking a link, contact" + - " the Web site administrator to alert them that the link is incorrectly formatted." + - "
  • " + - "
  • Click the Back button to try another link.
  • " + - "
" + - "

HTTP Error 404 - File or directory not found.
Internet Information Services (IIS)

" + - "
" + - "

Technical Information (for support personnel)

" + - "
    " + - "
  • Go to Microsoft Product Support Services and perform a title search for the words HTTP and 404.
  • " + - "
  • Open IIS Help, which is accessible in IIS Manager (inetmgr)," + - "and search for topics titled Web Site Setup, Common Administrative Tasks, and About Custom Error Messages.
  • " + - "
" + - "
" + - ("" if config.get("beef.http.web_server_imitation.hook_404")).to_s + - "" + BeEF::Core::Router::IIS_BODY when "nginx" #response body - "\n"+ - "404 Not Found\n" + - "\n" + - "

404 Not Found

\n" + - "
nginx
\n" + - ("" if config.get("beef.http.web_server_imitation.hook_404")).to_s + - "\n" + - "\n" + BeEF::Core::Router::NGINX_BODY else "Not Found." end @@ -93,16 +45,11 @@ module BeEF type = config.get("beef.http.web_server_imitation.type") case type when "apache" - headers "Server" => "Apache/2.2.3 (CentOS)", - "Content-Type" => "text/html; charset=UTF-8" - + headers BeEF::Core::Router::APACHE_HEADER when "iis" - headers "Server" => "Microsoft-IIS/6.0", - "X-Powered-By" => "ASP.NET", - "Content-Type" => "text/html; charset=UTF-8" + headers BeEF::Core::Router::IIS_HEADER when "nginx" - headers "Server" => "nginx", - "Content-Type" => "text/html" + headers BeEF::Core::Router::NGINX_HEADER else headers "Server" => '', "Content-Type" => "text/html"