Class: SSLScan::Commands::Host
- Defined in:
- lib/ssl_scan/commands/host.rb
Instance Attribute Summary collapse
-
#hostname ⇒ Object
Returns the value of attribute hostname.
-
#options ⇒ Object
Returns the value of attribute options.
Attributes inherited from Command
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(hostname, options = {}, output = nil) ⇒ Host
constructor
A new instance of Host.
Methods inherited from Command
#write_ciphers, #write_header, #write_preferred_ciphers
Constructor Details
#initialize(hostname, options = {}, output = nil) ⇒ Host
Returns a new instance of Host.
6 7 8 9 10 |
# File 'lib/ssl_scan/commands/host.rb', line 6 def initialize(hostname, ={}, output=nil) super([], output) @hostname = hostname @options = end |
Instance Attribute Details
#hostname ⇒ Object
Returns the value of attribute hostname.
4 5 6 |
# File 'lib/ssl_scan/commands/host.rb', line 4 def hostname @hostname end |
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/ssl_scan/commands/host.rb', line 4 def @options end |
Instance Method Details
#execute ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/ssl_scan/commands/host.rb', line 12 def execute parts = hostname.split(":") if parts.length == 2 scanner = SSLScan::Scanner.new(parts[0], parts[1].to_i) else scanner = SSLScan::Scanner.new(parts[0]) end # If we can't get any SSL connection, then don't bother testing # individual ciphers. if [:rejected, :failed].include?(scanner.test_ssl) and [:rejected, :failed].include?(scanner.test_tls) errors << "SSL Connection failed" return false end if parts.length == 2 write_header(parts[0], parts[1]) else write_header(parts[0]) end if .only_cert scanner.get_first_valid_cert @results << scanner.results else write_ciphers(scanner) write_preferred_ciphers(scanner) @results << scanner.results end end |