From efad3c3d23d91c965f767a3cb2cf04305e3522e9 Mon Sep 17 00:00:00 2001 From: Grant Burgess Date: Fri, 10 Jan 2020 14:42:35 +1000 Subject: [PATCH] Made 404 error responses constants to use with UI --- core/main/router/error_responses.rb | 68 +++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 core/main/router/error_responses.rb diff --git a/core/main/router/error_responses.rb b/core/main/router/error_responses.rb new file mode 100644 index 000000000..584e5ef80 --- /dev/null +++ b/core/main/router/error_responses.rb @@ -0,0 +1,68 @@ +module BeEF + module Core + module Router + + config = BeEF::Core::Configuration.instance + + APACHE_HEADER = { "Server" => "Apache/2.2.3 (CentOS)", + "Content-Type" => "text/html; charset=UTF-8" } + APACHE_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 + + "" + IIS_HEADER = {"Server" => "Microsoft-IIS/6.0", + "X-Powered-By" => "ASP.NET", + "Content-Type" => "text/html; charset=UTF-8"} + IIS_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 + + "" + NGINX_HEADER = {"Server" => "nginx", + "Content-Type" => "text/html"} + NGINX_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" + + end + end +end