Moved admin_ui config under beef.extension.admin_ui to ensure consistency
git-svn-id: https://beef.googlecode.com/svn/trunk@910 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
This commit is contained in:
@@ -25,13 +25,6 @@ beef:
|
||||
hook_session_name: "BEEFHOOK"
|
||||
session_cookie_name: "BEEFSESSION"
|
||||
|
||||
ui:
|
||||
username: "beef"
|
||||
password: "beef"
|
||||
favicon_file_name: "favicon.ico"
|
||||
favicon_dir: "/images"
|
||||
login_fail_delay: 1
|
||||
|
||||
database:
|
||||
# please note that the db should exists. Schema will be created automatically.
|
||||
# mysql> create database beef;
|
||||
|
||||
@@ -30,7 +30,7 @@ module API
|
||||
beef_server.mount('/ui/media', true, BeEF::Extension::AdminUI::Handlers::MediaHandler, media_dir)
|
||||
|
||||
# mount the favicon file
|
||||
beef_server.mount('/favicon.ico', true, WEBrick::HTTPServlet::FileHandler, "#{media_dir}#{configuration.get("beef.ui.favicon_dir")}/#{configuration.get("beef.ui.favicon_file_name")}")
|
||||
beef_server.mount('/favicon.ico', true, WEBrick::HTTPServlet::FileHandler, "#{media_dir}#{configuration.get("beef.extension.admin_ui.favicon_dir")}/#{configuration.get("beef.extension.admin_ui.favicon_file_name")}")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -2,4 +2,9 @@ beef:
|
||||
extension:
|
||||
admin_ui:
|
||||
enable: true
|
||||
username: "beef"
|
||||
password: "beef"
|
||||
favicon_file_name: "favicon.ico"
|
||||
favicon_dir: "/images"
|
||||
login_fail_delay: 1
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ class Authentication < BeEF::Extension::AdminUI::HttpController
|
||||
end
|
||||
|
||||
# check username and password
|
||||
if not (username.eql? config.get('beef.ui.username') and password.eql? config.get('beef.ui.password') )
|
||||
if not (username.eql? config.get('beef.extension.admin_ui.username') and password.eql? config.get('beef.extension.admin_ui.password') )
|
||||
BeEF::Core::Logger.instance.register('Authentication', "User with ip #{@request.peeraddr[3]} has failed to authenticate in the application.")
|
||||
return
|
||||
end
|
||||
@@ -126,7 +126,7 @@ class Authentication < BeEF::Extension::AdminUI::HttpController
|
||||
#
|
||||
def timeout?(time)
|
||||
config = BeEF::Core::Configuration.instance
|
||||
login_fail_delay = config.get('beef.ui.login_fail_delay') # get fail delay
|
||||
login_fail_delay = config.get('beef.extension.admin_ui.login_fail_delay') # get fail delay
|
||||
|
||||
# test if the last login attempt was less then login_fail_delay seconds
|
||||
time - @session.get_auth_timestamp > login_fail_delay.to_i
|
||||
|
||||
Reference in New Issue
Block a user