INNER CODE UNIT · Ruby

check_ssl

Hackplayers/evil-winrm · evil-winrm.rb:536

  def check_ssl(pub_key, priv_key)
    pub_key = pub_key.to_s
    priv_key = priv_key.to_s
    if $ssl
      unless pub_key.empty? && priv_key.empty? then
        unless [pub_key, priv_key].all? {|f| File.exist?(f) } then
          print_message("Path to provided public certificate file \"#{pub_key}\" can't be found. Check filename or path", TYPE_ERROR, true, $logger) unless File.exist?(pub_key)

          print_message("Path to provided private certificate file \"#{priv_key}\" can't be found. Check filename or path", TYPE_ERROR, true, $logger) unless File.exist?(priv_key)

          custom_exit(1)
        end
      end
      print_message('SSL enabled', TYPE_WARNING)
    else
      print_message("Useless cert/s provided, SSL is not enabled", TYPE_WARNING, true, $logger) unless pub_key.empty? && priv_key.empty?
    end
  end

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…