Class: Watobo::Plugin::Sqlmap::Gui

Inherits:
Watobo::Plugin2
  • Object
show all
Includes:
Responder
Defined in:
plugins/sqlmap/gui/main.rb

Constant Summary

Constants included from Constants

Constants::AC_GROUP_APACHE, Constants::AC_GROUP_DOMINO, Constants::AC_GROUP_ENUMERATION, Constants::AC_GROUP_FILE_INCLUSION, Constants::AC_GROUP_FLASH, Constants::AC_GROUP_GENERIC, Constants::AC_GROUP_JBOSS, Constants::AC_GROUP_JOOMLA, Constants::AC_GROUP_SAP, Constants::AC_GROUP_SQL, Constants::AC_GROUP_TYPO3, Constants::AC_GROUP_XSS, Constants::AUTH_TYPE_BASIC, Constants::AUTH_TYPE_DIGEST, Constants::AUTH_TYPE_NONE, Constants::AUTH_TYPE_NTLM, Constants::CHAT_SOURCE_AUTO_SCAN, Constants::CHAT_SOURCE_FUZZER, Constants::CHAT_SOURCE_INTERCEPT, Constants::CHAT_SOURCE_MANUAL, Constants::CHAT_SOURCE_MANUAL_SCAN, Constants::CHAT_SOURCE_PROXY, Constants::CHAT_SOURCE_UNDEF, Constants::DEFAULT_PORT_HTTP, Constants::DEFAULT_PORT_HTTPS, Constants::FINDING_TYPE_HINT, Constants::FINDING_TYPE_INFO, Constants::FINDING_TYPE_UNDEFINED, Constants::FINDING_TYPE_VULN, Constants::FIRST_TIME_FILE, Constants::GUI_REGULAR_FONT_SIZE, Constants::GUI_SMALL_FONT_SIZE, Constants::ICON_PATH, Constants::LOG_DEBUG, Constants::LOG_INFO, Constants::SCAN_CANCELED, Constants::SCAN_FINISHED, Constants::SCAN_PAUSED, Constants::SCAN_STARTED, Constants::TE_CHUNKED, Constants::TE_COMPRESS, Constants::TE_DEFLATE, Constants::TE_GZIP, Constants::TE_IDENTITY, Constants::TE_NONE, Constants::VULN_RATING_CRITICAL, Constants::VULN_RATING_HIGH, Constants::VULN_RATING_INFO, Constants::VULN_RATING_LOW, Constants::VULN_RATING_MEDIUM, Constants::VULN_RATING_UNDEFINED

Constants included from Gui::Icons

Gui::Icons::ICON_ADD_PROJECT, Gui::Icons::ICON_BROWSER_MEDIUM, Gui::Icons::ICON_BROWSER_SMALL, Gui::Icons::ICON_BTN_DOWN, Gui::Icons::ICON_BTN_UP, Gui::Icons::ICON_CB_CHECKED, Gui::Icons::ICON_CB_CHECKED_ORANGE, Gui::Icons::ICON_CB_UNCHECKED, Gui::Icons::ICON_CONVERSATION, Gui::Icons::ICON_DASHBOARD, Gui::Icons::ICON_DIFFER, Gui::Icons::ICON_FOLDER, Gui::Icons::ICON_FOLDER_SMALL, Gui::Icons::ICON_FUZZER, Gui::Icons::ICON_FUZZER_MEDIUM, Gui::Icons::ICON_FUZZER_SMALL, Gui::Icons::ICON_FUZZ_FILTER, Gui::Icons::ICON_FUZZ_GENERATOR, Gui::Icons::ICON_FUZZ_TAG, Gui::Icons::ICON_HINTS, Gui::Icons::ICON_HINTS_INFO, Gui::Icons::ICON_HINTS_INFO_SMALL, Gui::Icons::ICON_HINTS_SMALL, Gui::Icons::ICON_INFO, Gui::Icons::ICON_INFO_INFO, Gui::Icons::ICON_INFO_INFO_SMALL, Gui::Icons::ICON_INFO_SMALL, Gui::Icons::ICON_INFO_USER, Gui::Icons::ICON_INFO_USER_SMALL, Gui::Icons::ICON_INTERCEPTOR, Gui::Icons::ICON_LOGIN_WIZZARD, Gui::Icons::ICON_MANUAL_REQUEST, Gui::Icons::ICON_MANUAL_REQUEST_MEDIUM, Gui::Icons::ICON_MANUAL_REQUEST_SMALL, Gui::Icons::ICON_PAUSE, Gui::Icons::ICON_PLUGIN, Gui::Icons::ICON_PROJECT, Gui::Icons::ICON_PROJECT_SMALL, Gui::Icons::ICON_REPORT, Gui::Icons::ICON_REQUEST, Gui::Icons::ICON_REQUEST_SMALL, Gui::Icons::ICON_SEND_REQUEST, Gui::Icons::ICON_SITE, Gui::Icons::ICON_SITE_SMALL, Gui::Icons::ICON_START, Gui::Icons::ICON_STOP, Gui::Icons::ICON_TOKEN, Gui::Icons::ICON_TRANSCODER, Gui::Icons::ICON_VULN, Gui::Icons::ICON_VULN_BP, Gui::Icons::ICON_VULN_BP_SMALL, Gui::Icons::ICON_VULN_CRITICAL, Gui::Icons::ICON_VULN_CRITICAL_SMALL, Gui::Icons::ICON_VULN_HIGH, Gui::Icons::ICON_VULN_HIGH_SMALL, Gui::Icons::ICON_VULN_LOW, Gui::Icons::ICON_VULN_LOW_SMALL, Gui::Icons::ICON_VULN_MEDIUM, Gui::Icons::ICON_VULN_MEDIUM_SMALL, Gui::Icons::ICON_VULN_SMALL, Gui::Icons::ICON_WATOBO, Gui::Icons::SIBERAS_ICON, Gui::Icons::TBL_ICON_LOCK, Gui::Icons::WATOBO_LOGO

Constants included from Gui

Gui::DIFF_TYPE_NEW, Gui::DIFF_TYPE_ORIG, Gui::SEL_TYPE_GREP, Gui::SEL_TYPE_HIGHLIGHT, Gui::TABLE_COL_COMMENT, Gui::TABLE_COL_COOKIE, Gui::TABLE_COL_HOST, Gui::TABLE_COL_METHOD, Gui::TABLE_COL_PARMS, Gui::TABLE_COL_PATH, Gui::TABLE_COL_SSL, Gui::TABLE_COL_STATUS

Constants included from Diff::LCS

Diff::LCS::BalancedCallbacks, Diff::LCS::PATCH_MAP, Diff::LCS::SequenceCallbacks, Diff::LCS::VERSION

Instance Method Summary collapse

Methods included from Diff::LCS

LCS, __diff_direction, __inverse_vector, __lcs, __normalize_patchset, __position_hash, __replace_next_larger, diff, #diff, #lcs, patch, #patch, #patch!, patch!, sdiff, #sdiff, traverse_balanced, #traverse_balanced, traverse_sequences, #traverse_sequences, #unpatch, #unpatch!, unpatch!

Constructor Details

#initialize(owner, project = nil, chat = nil) ⇒ Gui

Returns a new instance of Gui.



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'plugins/sqlmap/gui/main.rb', line 52

def initialize(owner, project=nil, chat=nil)
  super(owner, "SQLMap", project, :opts => DECOR_ALL, :width=>800, :height=>600)
  @plugin_name = "SQLMap"

  FXMAPFUNC(SEL_COMMAND, ID_ACCEPT, :onAccept)
  
  main = FXVerticalFrame.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
  matrix = FXMatrix.new(main, 3, :opts => MATRIX_BY_COLUMNS|LAYOUT_FILL_X)
  FXLabel.new(matrix, "sqlmap path:")
  # frame = FXHorizontalFrame.new(main, :opts => LAYOUT_FILL_X)
  #  FXLabel.new(frame, "http://")
  @binary_path_txt = FXTextField.new(matrix, 60, nil, 0, :opts => TEXTFIELD_NORMAL|LAYOUT_SIDE_RIGHT|LAYOUT_FILL_X)
  bin_path = Watobo::Plugin::Sqlmap.binary_path
  bin_path ="not defined" if bin_path.empty?
  @binary_path_txt.text = bin_path

  @change_btn = FXButton.new(matrix, "...", :opts => BUTTON_DEFAULT|BUTTON_NORMAL )
  @change_btn.enable

  @change_btn.connect(SEL_COMMAND){
    open_path = nil
    unless @binary_path_txt.text.empty?
      dir_name = File.dirname(@binary_path_txt.text)
      unless dir_name.empty?
      open_path = dir_name unless File.exist? dir_name
      end
    end
    bin_path_old = @binary_path_txt.text
    bin_path = FXFileDialog.getOpenFilename(self, "Select SQLmap Path", open_path)
    unless bin_path.empty?
      @binary_path_txt.text = bin_path
    else              
      @binary_path_txt.text = bin_path_old
      
    end
    if File.exist? @binary_path_txt.text
    Watobo::Plugin::Sqlmap.set_binary_path bin_path
      @accept_btn.enable
    else
      Watobo::Plugin::Sqlmap.set_binary_path ''
      @accept_btn.disable 
    end
  }

  FXLabel.new(matrix, "temp directory:")
  # frame = FXHorizontalFrame.new(main, :opts => LAYOUT_FILL_X)
  #  FXLabel.new(frame, "http://")
  @output_path_txt = FXTextField.new(matrix, 60, nil, 0, :opts => TEXTFIELD_NORMAL|LAYOUT_SIDE_RIGHT|LAYOUT_FILL_X)
  @output_path_txt.text = Watobo::Plugin::Sqlmap.tmp_dir

  @output_path_btn = FXButton.new(matrix, "...", :opts => BUTTON_DEFAULT|BUTTON_NORMAL )
  @output_path_btn.enable

  @output_path_btn.connect(SEL_COMMAND){
    output_path = FXFileDialog.getOpenDirectory(self, "Select Temp Directory", Watobo::Plugin::Sqlmap.tmp_dir)

    #puts ">> #{output_path}"
    unless output_path.empty?
    @output_path_txt.text = output_path
    Watobo::Plugin::Sqlmap.set_tmp_dir output_path
    end
  }

  @settings_tab = SettingsTabBook.new(main)

  unless chat.nil?
  @settings_tab.general.request = chat.request
  end

  # @log_viewer = @settings_tabbook.log_viewer

  buttons = FXHorizontalFrame.new(main, :opts => LAYOUT_SIDE_BOTTOM|LAYOUT_FILL_X|PACK_UNIFORM_WIDTH,
  :padLeft => 40, :padRight => 40, :padTop => 20, :padBottom => 20)
  @accept_btn = FXButton.new(buttons, "&Start", nil, self, ID_ACCEPT,
  FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y)
  @accept_btn.disable
  @accept_btn.enable unless Watobo::Plugin::Sqlmap.binary_path.empty?
  # Cancel
  FXButton.new(buttons, "&Cancel", nil, self, ID_CANCEL,
  FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y)
# Configuration Categories
# =
# Request
# Optimization
# Detection
# Techniques
# Fingerprint
# Enumeration


    
    @accept_btn.disable if @settings_tab.general.request.empty?
    @settings_tab.general.subscribe(:request_changed){
      if @settings_tab.general.request.empty?
        @accept_btn.disable 
      else
        @accept_btn.enable
      end
    }
end

Instance Method Details

#updateViewObject

include Watobo::Plugin::Crawler::Constants



48
49
50
# File 'plugins/sqlmap/gui/main.rb', line 48

def updateView

end