Class: SSLScan::Commands::Targets
- Defined in:
- lib/ssl_scan/commands/targets.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
Returns the value of attribute file.
-
#hosts ⇒ Object
Returns the value of attribute hosts.
Attributes inherited from Command
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(filename = "", options) ⇒ Targets
constructor
A new instance of Targets.
Methods inherited from Command
#display_ciphers, #display_header
Constructor Details
#initialize(filename = "", options) ⇒ Targets
Returns a new instance of Targets.
7 8 9 10 11 12 |
# File 'lib/ssl_scan/commands/targets.rb', line 7 def initialize(filename="", ) super() @file = File.read(filename) @hosts = @file.split("\n").map(&:strip).select { |h| h.length > 0 } @options = end |
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file.
5 6 7 |
# File 'lib/ssl_scan/commands/targets.rb', line 5 def file @file end |
#hosts ⇒ Object
Returns the value of attribute hosts.
5 6 7 |
# File 'lib/ssl_scan/commands/targets.rb', line 5 def hosts @hosts end |
Instance Method Details
#execute ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/ssl_scan/commands/targets.rb', line 14 def execute hosts.each do |host| parts = host.split(":") if parts.length == 2 display_header(parts[0], parts[1]) scanner = SSLScan::Scanner.new(parts[0], parts[1].to_i) else display_header(host) scanner = SSLScan::Scanner.new(parts[0]) end display_ciphers(scanner) @results << scanner.results end end |