From 4603612a7b54f1ed8429930503ad2a91fbd35ac2 Mon Sep 17 00:00:00 2001 From: Brendan Coles Date: Mon, 1 Oct 2018 12:46:22 +0000 Subject: [PATCH] Validate beef.http.public and beef.http.public_port --- beef | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/beef b/beef index 9c440e2b6..8d634972f 100755 --- a/beef +++ b/beef @@ -188,6 +188,19 @@ if config.get("beef.credentials.user").eql?('beef') && config.get("beef.credenti exit 1 end +# +# @note Validate beef.http.public and beef.http.public_port +# +unless BeEF::Filters.is_valid_hostname? config.get('beef.http.public') + print_error "ERROR: Invalid public hostname: #{config.get('beef.http.public')}" + exit 1 +end + +unless BeEF::Filters.is_valid_port? config.get('beef.http.public_port') + print_error "ERROR: Invalid public port: #{config.get('beef.http.public_port')}" + exit 1 +end + # # @note Prints the API key needed to use the RESTful API #