Merge pull request #995 from bcoles/update_print

Update print methods
This commit is contained in:
Brendan Coles
2014-04-20 20:20:18 +10:00
2 changed files with 19 additions and 1 deletions

View File

@@ -110,7 +110,7 @@ module BeEF
if @configuration.get('beef.http.https.enable') == true
openssl_version = OpenSSL::OPENSSL_VERSION
if openssl_version =~ / 1\.0\.1([a-f])/
print_error "Warning: #{openssl_version} is vulnerable to Heartbleed (CVE-2014-0160)."
print_warning "Warning: #{openssl_version} is vulnerable to Heartbleed (CVE-2014-0160)."
print_more "Upgrade OpenSSL to version 1.0.1g or newer."
end
@http_server.ssl = true

View File

@@ -16,6 +16,18 @@ def print_info(s)
puts Time.now.localtime.strftime("[%k:%M:%S]")+'[*]'.blue+' '+s
end
# Function used to print information to the console (wraps print_info)
# @param [String] s String to be printed
def print_status(s)
print_info(s)
end
# Function used to print warning information
# @param [String] s String to be printed
def print_warning(s)
puts Time.now.localtime.strftime("[%k:%M:%S]")+'[!]'.yellow+' '+s.to_s
end
# Function used to print debug information
# @param [String] s String to be printed
# @note This function will only print messages if the debug flag is set to true
@@ -32,6 +44,12 @@ def print_success(s)
puts Time.now.localtime.strftime("[%k:%M:%S]")+'[+]'.green+' '+s
end
# Function used to print successes to the console (wraps print_success)
# @param [String] s String to be printed
def print_good(s)
print_success(s)
end
# Print multiple lines with decoration split by the return character
# @param [String] s String to be printed
# @note The string passed needs to be separated by the "\n" for multiple lines to be printed