Class: Aquatone::Collectors::Dictionary

Inherits:
Aquatone::Collector show all
Defined in:
lib/aquatone/collectors/dictionary.rb

Constant Summary collapse

DEFAULT_DICTIONARY =
File.join(Aquatone::AQUATONE_ROOT, "subdomains.lst").freeze

Constants inherited from Aquatone::Collector

Aquatone::Collector::DEFAULT_PRIORITY

Instance Attribute Summary

Attributes inherited from Aquatone::Collector

#domain, #hosts

Instance Method Summary collapse

Methods inherited from Aquatone::Collector

cli_options, descendants, #execute!, #initialize, meta, meta=, priority, sluggified_name

Constructor Details

This class inherits a constructor from Aquatone::Collector

Instance Method Details

#runObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/aquatone/collectors/dictionary.rb', line 15

def run
  if has_cli_option?("wordlist")
    file = File.expand_path(get_cli_option("wordlist"))
    if !File.readable?(file)
      failure("Wordlist file #{file} is not readable or does not exist")
    end
    dictionary = File.open(file, "r")
  else
    dictionary = File.open(DEFAULT_DICTIONARY, "r")
  end

  dictionary.each_line do |subdomain|
    add_host("#{subdomain.strip}.#{domain.name}")
  end
end