Class: SSLScan::Commands::Host

Inherits:
Command
  • Object
show all
Defined in:
lib/ssl_scan/commands/host.rb

Instance Attribute Summary collapse

Attributes inherited from Command

#results

Instance Method Summary collapse

Methods inherited from Command

#display_ciphers, #display_header

Constructor Details

#initialize(hostname, options) ⇒ Host

Returns a new instance of Host.



6
7
8
9
10
# File 'lib/ssl_scan/commands/host.rb', line 6

def initialize(hostname, options)
  super()
  @hostname = hostname
  @options  = options
end

Instance Attribute Details

#hostnameObject

Returns the value of attribute hostname.



4
5
6
# File 'lib/ssl_scan/commands/host.rb', line 4

def hostname
  @hostname
end

#optionsObject

Returns the value of attribute options.



4
5
6
# File 'lib/ssl_scan/commands/host.rb', line 4

def options
  @options
end

Instance Method Details

#executeObject



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/ssl_scan/commands/host.rb', line 12

def execute
  parts = hostname.split(":")
  if parts.length == 2
    display_header(parts[0], parts[1])
    scanner = SSLScan::Scanner.new(parts[0], parts[1].to_i)
  else
    display_header(parts[0])
    scanner = SSLScan::Scanner.new(parts[0])
  end
  display_ciphers(scanner)
  @results << scanner.results
end