diff --git a/config.yaml b/config.yaml index 7972955a3..2205e3f3c 100644 --- a/config.yaml +++ b/config.yaml @@ -27,6 +27,8 @@ beef: # subnet of IP addresses that can connect to the admin UI #permitted_ui_subnet: "127.0.0.1/32" permitted_ui_subnet: "0.0.0.0/0" + # slow API calls to 1 every api_attempt_delay seconds + api_attempt_delay: "0.05" # HTTP server http: diff --git a/core/main/rest/api.rb b/core/main/rest/api.rb index 1b046a3b0..ae8754742 100644 --- a/core/main/rest/api.rb +++ b/core/main/rest/api.rb @@ -63,7 +63,7 @@ module BeEF # This is from extensions/admin_ui/controllers/authentication/authentication.rb # def self.permitted_source?(ip) - # get permitted subnet + # get permitted subnet permitted_ui_subnet = BeEF::Core::Configuration.instance.get("beef.restrictions.permitted_ui_subnet") target_network = IPAddr.new(permitted_ui_subnet) @@ -74,6 +74,31 @@ module BeEF return target_network.include?(ip) end + # + # Rate limit through timeout + # This is from extensions/admin_ui/controllers/authentication/ + # + # Brute Force Mitigation + # Only one login request per config_delay_id seconds + # + # @param config_delay_id configuration name for the timeout + # @param last_time_attempt