Class: Watobo::Plugin::Sqlmap

Inherits:
Object
  • Object
show all
Defined in:
plugins/sqlmap/gui/main.rb,
plugins/sqlmap/lib/sqlmap_ctrl.rb,
plugins/sqlmap/gui/options_frame.rb

Defined Under Namespace

Classes: Gui, OptionsFrame, SettingsTabBook

Class Method Summary collapse

Class Method Details

.load_configObject



94
95
96
97
98
99
100
101
102
103
# File 'plugins/sqlmap/lib/sqlmap_ctrl.rb', line 94

def self.load_config()
  wd = Watobo.working_directory
  dir_name = Watobo::Utils.snakecase self.name.gsub(/.*::/,'')
  path = File.join(wd, "conf", "plugins")
  Dir.mkdir path unless File.exist? path
  conf_dir = File.join(path, dir_name)
  Dir.mkdir conf_dir unless File.exist? conf_dir
  file = File.join(conf_dir, dir_name + "_config.yml")
  config = Watobo::Utils.load_settings(file)
end

.method_missing(name, *args, &block) ⇒ Object



55
56
57
58
59
60
# File 'plugins/sqlmap/lib/sqlmap_ctrl.rb', line 55

def self.method_missing(name, *args, &block)
  iv_name = "@#{name}"
  super unless instance_variable_defined? iv_name

  v = instance_variable_get(iv_name)
end

.run(request, opts) ⇒ Object



74
75
76
# File 'plugins/sqlmap/lib/sqlmap_ctrl.rb', line 74

def self.run(request, opts)

end

.save_configObject



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'plugins/sqlmap/lib/sqlmap_ctrl.rb', line 78

def self.save_config()
  wd = Watobo.working_directory

  dir_name = Watobo::Utils.snakecase self.name.gsub(/.*::/,'')
  path = File.join(wd, "conf", "plugins")
  Dir.mkdir path unless File.exist? path
  conf_dir = File.join(path, dir_name)
  Dir.mkdir conf_dir unless File.exist? conf_dir
  file = File.join(conf_dir, dir_name + "_config.yml")
  config = { 
             :tmp_dir => @tmp_dir,
             :binary_path => @binary_path
             }
  Watobo::Utils.save_settings(file, config)
end

.set_binary_path(path = nil) ⇒ Object

set sqlmap binary path, leave it empty to check well-know-locaitons it returns the path if any or an empty string



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'plugins/sqlmap/lib/sqlmap_ctrl.rb', line 35

def self.set_binary_path(path=nil)
  binary_name = "sqlmap.py"
  @binary_path = ""
  if path.nil?
    @well_known_paths.each do |p|
      bp = File.join(p, binary_name)
      if File.exist? bp
        @binary_path = bp
      break
      end
    end
  else
    @binary_path = path
  end
  
  save_config

  @binary_path
end

.set_tmp_dir(dir = nil) ⇒ Object



62
63
64
65
66
67
68
69
70
71
72
# File 'plugins/sqlmap/lib/sqlmap_ctrl.rb', line 62

def self.set_tmp_dir(dir=nil)
  # get project path
  if dir.nil?
    @tmp_dir = File.join(Watobo.temp_directory,"sqlmap")
    Dir.mkdir @tmp_dir unless File.exist? @tmp_dir
  else
    @tmp_dir = dir if File.exist? dir
  end
  save_config
  @tmp_dir
end