Class: SslscanWrapper::Scanner

Inherits:
Object
  • Object
show all
Defined in:
lib/sslscan_wrapper/scanner.rb

Constant Summary collapse

@@SSL_SCAN_FLAGS =
[ :ipv4, :ipv6, :ssl2, :ssl3, :tls10, :tls11, :tls12, :tlsall, :ocsp, :xmpp_server, :http, :bugs ]
@@SSL_SCAN_OPTIONS =
[ :sleep, :timeout, :sni_name, :pk, :pkpass ]
@@SSL_SCAN_ARGS =
[ '--xml=-', '--no-colour' ]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ Scanner

Initialize a new SslscanWrapper::Scanner object

Examples

scan = SslscanWrapper::Scanner.new do |s|
  s.ipv4 = true
end

Returns a SslscanWrapper::Scanner object

Yields:

  • (_self)

Yield Parameters:



59
60
61
62
63
# File 'lib/sslscan_wrapper/scanner.rb', line 59

def initialize
  @command = 'sslscan'
  @port = 443
  yield self if block_given?
end

Instance Attribute Details

#bugsObject

Enable SSL implementation bug work-arounds



40
41
42
# File 'lib/sslscan_wrapper/scanner.rb', line 40

def bugs
  @bugs
end

#commandObject

sslscan executable



7
8
9
# File 'lib/sslscan_wrapper/scanner.rb', line 7

def command
  @command
end

#httpObject

Test a HTTP connection



36
37
38
# File 'lib/sslscan_wrapper/scanner.rb', line 36

def http
  @http
end

#ipv4Object

Only use IPv4



12
13
14
# File 'lib/sslscan_wrapper/scanner.rb', line 12

def ipv4
  @ipv4
end

#ipv6Object

Only use IPv6



14
15
16
# File 'lib/sslscan_wrapper/scanner.rb', line 14

def ipv6
  @ipv6
end

#ocspObject

Request OCSP response from server



28
29
30
# File 'lib/sslscan_wrapper/scanner.rb', line 28

def ocsp
  @ocsp
end

#pkObject

A file containing the private key or a PKCS12 file containing a private key/certificate pair



30
31
32
# File 'lib/sslscan_wrapper/scanner.rb', line 30

def pk
  @pk
end

#pkpassObject

The password for the private key or PKCS12 file certs=<file> A file containing PEM/ASN1 formatted client certificates



32
33
34
# File 'lib/sslscan_wrapper/scanner.rb', line 32

def pkpass
  @pkpass
end

#rdpObject

Send RDP preamble before starting scan



38
39
40
# File 'lib/sslscan_wrapper/scanner.rb', line 38

def rdp
  @rdp
end

#sleepObject

Pause between connection request. Default is disabled



44
45
46
# File 'lib/sslscan_wrapper/scanner.rb', line 44

def sleep
  @sleep
end

#sni_nameObject

Hostname for SNI



10
11
12
# File 'lib/sslscan_wrapper/scanner.rb', line 10

def sni_name
  @sni_name
end

#ssl2Object

Only check SSLv2 ciphers



16
17
18
# File 'lib/sslscan_wrapper/scanner.rb', line 16

def ssl2
  @ssl2
end

#ssl3Object

Only check SSLv3 ciphers



18
19
20
# File 'lib/sslscan_wrapper/scanner.rb', line 18

def ssl3
  @ssl3
end

#timeoutObject

Set socket timeout. Default is 3s



42
43
44
# File 'lib/sslscan_wrapper/scanner.rb', line 42

def timeout
  @timeout
end

#tls10Object

Only check TLSv1.0 ciphers



20
21
22
# File 'lib/sslscan_wrapper/scanner.rb', line 20

def tls10
  @tls10
end

#tls11Object

Only check TLSv1.1 ciphers



22
23
24
# File 'lib/sslscan_wrapper/scanner.rb', line 22

def tls11
  @tls11
end

#tls12Object

Only check TLSv1.2 ciphers



24
25
26
# File 'lib/sslscan_wrapper/scanner.rb', line 24

def tls12
  @tls12
end

#tlsallObject

Only check TLS ciphers (all versions)



26
27
28
# File 'lib/sslscan_wrapper/scanner.rb', line 26

def tlsall
  @tlsall
end

#xmpp_serverObject

Use a server-to-server XMPP handshake



34
35
36
# File 'lib/sslscan_wrapper/scanner.rb', line 34

def xmpp_server
  @xmpp_server
end

Instance Method Details

#scan(host, port) ⇒ Object

Scan a target

Returns a SslscanWrapper::Report object



68
69
70
# File 'lib/sslscan_wrapper/scanner.rb', line 68

def scan(host, port)
  execute(host, port)
end