Class: Dvash::Application

Inherits:
Core
  • Object
show all
Defined in:
lib/dvash/application.rb

Overview

Main application methods, the glue that holds it all together

Instance Method Summary collapse

Methods inherited from Core

#client_ip, #load_conf, #load_honeyport, #random_data, #valid_ip?, #valid_user?, #validate_os

Constructor Details

#initialize(paths) ⇒ Application

Methods that should run when [Dvash] is created



12
13
14
15
16
17
18
19
20
21
# File 'lib/dvash/application.rb', line 12

def initialize(paths)
  # Instantiate @honey_threads [Array] to hold all honeyport threads
  @honey_threads = Array.new
  # Load passed [paths]
  @paths = paths
  # Load the configuration file
  load_conf
  # Validate the operating system and load necessary [Dvash] methods
  validate_os
end

Instance Method Details

#startObject

Fire in the hole!



24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/dvash/application.rb', line 24

def start
  # Make sure we are running with elevated privileges
  unless valid_user?
    # TODO: Use [logger] gem to output debug information
    puts "invalid user"
    exit
  end
  # Load all honeyports set true in the configuration file
  load_honeyport
  # Let the user know we're running
  puts "Dvash is running..."
  # Start all loaded threads
  @honey_threads.each { |thr| thr.join }
end