File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
lib/msf/core/payload/windows Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ # -*- coding: binary -*-
2
+
3
+ require 'msf/core'
4
+ require 'rex/parser/x509_certificate'
5
+
6
+ module Msf
7
+
8
+ ###
9
+ #
10
+ # Implements SSL validation check options
11
+ #
12
+ ###
13
+
14
+ module Payload ::Windows ::VerifySsl
15
+
16
+ #
17
+ # Get the SSL hash from the certificate, if required.
18
+ #
19
+ def get_ssl_cert_hash ( verify_cert , handler_cert )
20
+ unless verify_cert . to_s =~ /^(t|y|1)/i
21
+ return nil
22
+ end
23
+
24
+ unless handler_cert
25
+ raise ArgumentError , "Verifying SSL cert is enabled but no handler cert is configured"
26
+ end
27
+
28
+ hash = Rex ::Parser ::X509Certificate . get_cert_file_hash ( handler_cert )
29
+ print_status ( "Meterpreter will verify SSL Certificate with SHA1 hash #{ hash . unpack ( "H*" ) . first } " )
30
+ hash
31
+ end
32
+
33
+ end
34
+
35
+ end
36
+
You can’t perform that action at this time.
0 commit comments