Validate beef.http.public and beef.http.public_port

This commit is contained in:
Brendan Coles
2018-10-01 12:46:22 +00:00
parent 7e010e2e1f
commit 4603612a7b

13
beef
View File

@@ -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
#