From 7e010e2e1fa3b575595c6017a2e754f334dc872d Mon Sep 17 00:00:00 2001 From: Brendan Coles Date: Mon, 1 Oct 2018 12:39:03 +0000 Subject: [PATCH] Disable default credentials --- beef | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/beef b/beef index 0942b0153..9c440e2b6 100755 --- a/beef +++ b/beef @@ -180,14 +180,12 @@ if config.get("beef.extension.console.shell.enable") == true end # -# @note Warn and replace on default credentials +# @note Exit on default credentials # -if config.get("beef.credentials.user").eql?('beef') && - [/beef[0-9]*/, /passw[o0]rd[0-9]*/].select{|pattern| pattern.match(config.get("beef.credentials.passwd"))}.any? - print_warning "Warning: Default username and weak password in use!" - better_phrase = BeEF::Core::Crypto::secure_token(16) - config.set("beef.credentials.passwd", better_phrase) - print_more "New password for this instance: #{better_phrase}" +if config.get("beef.credentials.user").eql?('beef') && config.get("beef.credentials.passwd").eql?('beef') + print_error "ERROR: Default username and password in use!" + print_more "Change the beef.credentials.passwd in config.yaml" + exit 1 end #