Module: Miteru::Commands::Main

Included in:
Miteru::CLI::App
Defined in:
lib/miteru/commands/main.rb

Class Method Summary collapse

Class Method Details

.included(thor) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/miteru/commands/main.rb', line 7

def included(thor)
  thor.class_eval do
    include Concerns::DatabaseConnectable

    method_option :auto_download, type: :boolean, default: false,
      desc: "Enable or disable auto-downloading of phishing kits"
    method_option :directory_traveling, type: :boolean, default: false,
      desc: "Enable or disable directory traveling"
    method_option :download_to, type: :string, default: "/tmp", desc: "Directory to download phishing kits"
    method_option :threads, type: :numeric, desc: "Number of threads to use", default: Parallel.processor_count
    method_option :verbose, type: :boolean, default: true
    desc "execute", "Execute the crawler"
    around :with_db_connection
    def execute
      Miteru.config.tap do |config|
        config.auto_download = options["auto_download"]
        config.directory_traveling = options["directory_traveling"]
        config.download_to = options["download_to"]
        config.threads = options["threads"]
        config.verbose = options["verbose"]
      end

      Orchestrator.call
    end
    default_command :execute
  end
end