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 #