Module: Msf::Payload::Windows::VerifySsl

Included in:
Handler::ReverseHttp, ReverseWinHttps, ReverseWinHttps_x64
Defined in:
lib/msf/core/payload/windows/verify_ssl.rb

Overview

Implements SSL validation check options

Instance Method Summary collapse

Instance Method Details

#get_ssl_cert_hash(verify_cert, handler_cert) ⇒ Object

Get the SSL hash from the certificate, if required.


19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/msf/core/payload/windows/verify_ssl.rb', line 19

def get_ssl_cert_hash(verify_cert, handler_cert)
  unless verify_cert.to_s =~ /^(t|y|1)/i
    return nil
  end

  unless handler_cert
    raise ArgumentError, "Verifying SSL cert is enabled but no handler cert is configured"
  end

  hash = Rex::Socket::X509Certificate.get_cert_file_hash(handler_cert)
  print_status("Meterpreter will verify SSL Certificate with SHA1 hash #{hash.unpack("H*").first}")
  hash
end