watobo 0.9.10 → 0.9.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -1,4 +1,13 @@
1
+ = Version 0.9.11
2
+ == NEW
3
+ * [FileFinder] pimped the interface, added save-settings
4
+
5
+ == Fixes
6
+ * [ConversationTable] Request-/Resoponse View is updated when navigating with arrow-keys
7
+ * [INTERCEPOR] fixed bug in parsing intercepted responses
8
+
1
9
  = Version 0.9.10
10
+ == Fixes
2
11
  * fixed sqlmap temp directory
3
12
 
4
13
  = Version 0.9.9
@@ -200,11 +200,27 @@ module Watobo
200
200
  notify(:error, "#{$!}")
201
201
  rescue => bang
202
202
  puts bang
203
+ puts bang.backtrace if $DEBUG
203
204
  notify(:error, "Could not parse request: #{$!}")
204
205
  end
205
206
 
206
207
  return nil
207
208
  end
209
+
210
+ def to_response(prefs={})
211
+ begin
212
+ return @textbox.to_response(prefs)
213
+ rescue SyntaxError, LocalJumpError, NameError
214
+ # puts bang
215
+ # puts bang.backtrace if $DEBUG
216
+ notify(:error, "#{$!}")
217
+ rescue => bang
218
+ puts bang
219
+ notify(:error, "Could not parse request: #{$!}")
220
+ end
221
+
222
+ return nil
223
+ end
208
224
 
209
225
  private
210
226
 
@@ -547,6 +563,7 @@ module Watobo
547
563
  # request_frame = FXVerticalFrame.new(request_frame_outer, LAYOUT_FILL_X|LAYOUT_FILL_Y)
548
564
 
549
565
  @requestbox = Watobo::Gui::InterceptEditor.new(request_frame_outer, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
566
+
550
567
 
551
568
  @response_tab = FXTabItem.new(@tabBook, "Response (0)", nil)
552
569
  response_frame_outer = FXVerticalFrame.new(@tabBook, LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_RAISED)
@@ -646,8 +663,10 @@ module Watobo
646
663
  response = @response_list.first
647
664
  if not response.nil?
648
665
  response[:response].clear
649
- new_response = @responsebox.parseRequest(:update_content_length => true)
666
+ new_response = @responsebox.to_response(:update_content_length => true)
667
+ puts new_response.class
650
668
  response[:response].concat new_response
669
+ puts new_response
651
670
  response[:thread].run
652
671
  @responsebox.clear
653
672
  @response_list.shift
@@ -658,6 +677,7 @@ module Watobo
658
677
  rescue => bang
659
678
  puts "!!! Error"
660
679
  puts bang
680
+ puts bang.backtrace
661
681
  end
662
682
  end
663
683
 
@@ -1147,6 +1147,9 @@ module Watobo
1147
1147
 
1148
1148
  self.icon = ICON_WATOBO
1149
1149
  self.show(PLACEMENT_MAXIMIZED)
1150
+
1151
+ self.extend Watobo::Gui::Settings
1152
+
1150
1153
  self.connect(SEL_CLOSE, method(:onClose))
1151
1154
 
1152
1155
  @project = nil
@@ -1393,7 +1396,10 @@ module Watobo
1393
1396
  # R E Q U E S T I N F O
1394
1397
  requestInfo = FXVerticalFrame.new(@switcher, :opts => LAYOUT_FILL_X|LAYOUT_FILL_X|LAYOUT_FILL_Y, :padding => 0)
1395
1398
  request_splitter = FXSplitter.new(requestInfo, :opts => LAYOUT_SIDE_TOP|SPLITTER_HORIZONTAL|LAYOUT_FILL_Y|LAYOUT_FILL_X|SPLITTER_TRACKING|SPLITTER_REVERSED)
1396
-
1399
+ request_splitter.connect(SEL_COMMAND){
1400
+ puts "Request Splitter Resized!"
1401
+
1402
+ }
1397
1403
 
1398
1404
  # C H A T T A B L E C O N T R O L L E R
1399
1405
  @conversation_table_ctrl = ConversationTableCtrl.new(request_splitter, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN)
@@ -1421,6 +1427,15 @@ module Watobo
1421
1427
  open_manual_request_editor(chat)
1422
1428
  end
1423
1429
  end
1430
+
1431
+ @chatTable.connect(SEL_CHANGED){ |sender, sel, item|
1432
+ #puts item.row
1433
+ @chatTable.selectRow(item.row, false)
1434
+ chatid = @chatTable.getRowText(item.row).to_i
1435
+ chat = @project.getChat(chatid)
1436
+ chat_selected(chat)
1437
+
1438
+ }
1424
1439
 
1425
1440
  @chatTable.connect(SEL_RIGHTBUTTONRELEASE) do |sender, sel, event|
1426
1441
  @findings_tree.killSelection()
@@ -1606,6 +1621,15 @@ module Watobo
1606
1621
  @request_viewer = Watobo::Gui::RequestViewer.new(chat_frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :padding => 0)
1607
1622
  # @request_viewer = Watobo::Gui::ChatViewer.new(chat_frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :padding => 0)
1608
1623
  # @request_viewer.highlight_style = 1
1624
+
1625
+ #
1626
+ # SEL_CONFIGURE is fired when the window is resized
1627
+ #@request_viewer.connect(SEL_CONFIGURE){ |sender, sel, ptr|
1628
+ @chat_frame_splitter.connect(SEL_COMMAND){
1629
+ # puts sender.class
1630
+ # puts sender.width
1631
+ puts @request_viewer.height
1632
+ }
1609
1633
 
1610
1634
  # FXHorizontalSeparator.new(chat_frame, :opts => SEPARATOR_GROOVE|LAYOUT_FILL_X)
1611
1635
  chat_frame = FXVerticalFrame.new(@chat_frame_splitter, :opts => LAYOUT_FILL_X|FRAME_SUNKEN|LAYOUT_MIN_WIDTH, :padding => 0, :width=>400)
@@ -1672,6 +1696,24 @@ module Watobo
1672
1696
 
1673
1697
  # end
1674
1698
  private
1699
+
1700
+ def chat_selected(chat)
1701
+ begin
1702
+ getApp().beginWaitCursor()
1703
+ # purge viewers
1704
+ @request_viewer.setText('')
1705
+ @response_viewer.setText('')
1706
+
1707
+ showChat(chat)
1708
+
1709
+ rescue => bang
1710
+ puts "!!!ERROR: chat_selected"
1711
+ puts bang
1712
+ puts "!!!"
1713
+ ensure
1714
+ getApp().endWaitCursor()
1715
+ end
1716
+ end
1675
1717
 
1676
1718
  def save_response
1677
1719
  unless @last_chat.nil?
@@ -0,0 +1,51 @@
1
+ # .
2
+ # gui_settings.rb
3
+ #
4
+ # Copyright 2012 by siberas, http://www.siberas.de
5
+ #
6
+ # This file is part of WATOBO (Web Application Tool Box)
7
+ # http://watobo.sourceforge.com
8
+ #
9
+ # WATOBO is free software; you can redistribute it and/or modify
10
+ # it under the terms of the GNU General Public License as published by
11
+ # the Free Software Foundation version 2 of the License.
12
+ #
13
+ # WATOBO is distributed in the hope that it will be useful,
14
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ # GNU General Public License for more details.
17
+ #
18
+ # You should have received a copy of the GNU General Public License
19
+ # along with WATOBO; if not, write to the Free Software
20
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
+ # .
22
+ module Watobo
23
+ module Gui
24
+ module Settings
25
+ def self.save_gui_settings(settings)
26
+ wd = Watobo.working_directory
27
+
28
+ dir_name = Watobo::Utils.snakecase self.class.to_s.gsub(/.*::/,'')
29
+ path = File.join(wd, "conf", "gui")
30
+ Dir.mkdir path unless File.exist? path
31
+ conf_dir = File.join(path, dir_name)
32
+ Dir.mkdir conf_dir unless File.exist? conf_dir
33
+ file = File.join(conf_dir, dir_name + "_settings.yml")
34
+
35
+ Watobo::Utils.save_settings(file, config)
36
+ end
37
+
38
+ def load_gui_settings()
39
+ wd = Watobo.working_directory
40
+ dir_name = Watobo::Utils.snakecase self.class.to_s.gsub(/.*::/,'')
41
+ path = File.join(wd, "conf", "gui")
42
+ Dir.mkdir path unless File.exist? path
43
+ conf_dir = File.join(path, dir_name)
44
+ Dir.mkdir conf_dir unless File.exist? conf_dir
45
+ file = File.join(conf_dir, dir_name + "_settings.yml")
46
+ config = Watobo::Utils.load_settings(file)
47
+ config
48
+ end
49
+ end
50
+ end
51
+ end
@@ -443,6 +443,7 @@ module Watobo
443
443
 
444
444
  return nil
445
445
  end
446
+
446
447
 
447
448
  private
448
449
 
@@ -66,7 +66,9 @@ include Watobo::Gui
66
66
  end
67
67
 
68
68
  def initialize(owner, title, project, opts)
69
- super(owner, title, :opts => DECOR_ALL,:width=>800, :height=>600)
69
+ dialog_opts = { :opts => DECOR_ALL, :width=>800, :height=>650 }
70
+ dialog_opts.update opts
71
+ super(owner, title, dialog_opts)
70
72
  # Implement Sender
71
73
  # Implement Scanner
72
74
  @icon = nil
@@ -75,6 +77,33 @@ include Watobo::Gui
75
77
  @event_dispatcher_listeners = Hash.new
76
78
 
77
79
  end
80
+
81
+ private
82
+
83
+ def save_config(config)
84
+ wd = Watobo.working_directory
85
+
86
+ dir_name = Watobo::Utils.snakecase self.class.to_s.gsub(/.*::/,'')
87
+ path = File.join(wd, "conf", "plugins")
88
+ Dir.mkdir path unless File.exist? path
89
+ conf_dir = File.join(path, dir_name)
90
+ Dir.mkdir conf_dir unless File.exist? conf_dir
91
+ file = File.join(conf_dir, dir_name + "_config.yml")
92
+
93
+ Watobo::Utils.save_settings(file, config)
94
+ end
95
+
96
+ def load_config()
97
+ wd = Watobo.working_directory
98
+ dir_name = Watobo::Utils.snakecase self.class.to_s.gsub(/.*::/,'')
99
+ path = File.join(wd, "conf", "plugins")
100
+ Dir.mkdir path unless File.exist? path
101
+ conf_dir = File.join(path, dir_name)
102
+ Dir.mkdir conf_dir unless File.exist? conf_dir
103
+ file = File.join(conf_dir, dir_name + "_config.yml")
104
+ config = Watobo::Utils.load_settings(file)
105
+ config
106
+ end
78
107
  end
79
108
  end
80
109
  end
data/lib/watobo/gui.rb CHANGED
@@ -119,6 +119,7 @@ Watobo::Gui.create_application
119
119
 
120
120
  require 'watobo/gui/utils/init_icons'
121
121
  require 'watobo/gui/mixins/subscriber'
122
+ require 'watobo/gui/mixins/gui_settings'
122
123
 
123
124
  gui_path = File.expand_path(File.join(File.dirname(__FILE__), "gui"))
124
125
 
@@ -129,7 +129,7 @@ module Watobo
129
129
  # result.extend Watobo::Mixin::Parser::Web10
130
130
  # result.extend Watobo::Mixin::Shaper::Web10
131
131
  Watobo::Request.create result
132
-
132
+
133
133
  ct = result.content_type
134
134
  # last line is without "\r\n" if text has a body
135
135
  if ct =~ /multipart\/form/ and body then
@@ -173,11 +173,55 @@ module Watobo
173
173
  result.push "\r\n"
174
174
  result.push body.strip
175
175
  end
176
+
177
+ result.fixupContentLength() if options[:update_content_length] == true
178
+ puts ">>"
179
+ puts result
180
+ return result
181
+ rescue => bang
182
+ puts bang
183
+ puts bang.backtrace
184
+ raise bang
185
+ end
186
+ #return nil
187
+ end
188
+
189
+ def to_response(opts={})
190
+ options = { :update_content_length => false }
191
+ options.update opts
192
+ begin
193
+ text = parse_code
194
+ result = []
195
+
196
+ if text =~ /\n\n/
197
+ dummy = text.split(/\n\n/)
198
+ header = dummy.shift.split(/\n/)
199
+ body = dummy.join("\n\n")
200
+ else
201
+ header = text.split(/\n/)
202
+ body = nil
203
+ end
204
+
205
+ header.each do |h|
206
+ result.push "#{h}\r\n"
207
+ end
176
208
 
209
+
210
+ Watobo::Response.create result
211
+
212
+ if body then
213
+ result.push "\r\n"
214
+ result.push body.strip
215
+ end
216
+
177
217
  result.fixupContentLength() if options[:update_content_length] == true
218
+ puts ">>"
219
+ puts result
178
220
  return result
179
- rescue
180
- raise
221
+ rescue => bang
222
+ puts bang
223
+ puts bang.backtrace
224
+ raise bang
181
225
  end
182
226
  #return nil
183
227
  end
data/lib/watobo.rb CHANGED
@@ -49,7 +49,7 @@ require 'watobo/framework'
49
49
 
50
50
  module Watobo
51
51
 
52
- VERSION = "0.9.10"
52
+ VERSION = "0.9.11"
53
53
 
54
54
  def self.base_directory
55
55
  @base_directory ||= ""
@@ -294,7 +294,7 @@ about_txt.disable
294
294
 
295
295
  def initialize(owner, project)
296
296
 
297
- super(owner, "Catalog Scanner", project, :opts => DECOR_ALL, :width=>800, :height=>400)
297
+ super(owner, "Catalog Scanner", project, :opts => DECOR_ALL, :width=>800, :height=>600)
298
298
  menu_bar = FXMenuBar.new(self, :opts => LAYOUT_SIDE_TOP|LAYOUT_FILL_X|FRAME_GROOVE)
299
299
  menu_pane = FXMenuPane.new(self)
300
300
 
@@ -130,6 +130,65 @@ module Watobo
130
130
  class Filefinder < Watobo::Template::Plugin
131
131
 
132
132
  include Watobo::Constants
133
+ class DBSelectFrame < FXVerticalFrame
134
+
135
+ def select_db(db_name)
136
+ @db_listbox.numItems.times do |i|
137
+ if db_name == @db_listbox.getItemData(i)
138
+ @db_listbox.currentItem = i
139
+ end
140
+ end
141
+ end
142
+
143
+ def get_db_name
144
+ i = @db_listbox.currentItem
145
+ db = ''
146
+ db = @db_listbox.getItemData(i) if i >= 0
147
+ db
148
+ end
149
+
150
+ def get_db_list
151
+ l = []
152
+ @db_listbox.numItems.times do |i|
153
+ l << @db_listbox.getItemData(i)
154
+ end
155
+ l
156
+ end
157
+
158
+ def initialize(parent, db_list, opts)
159
+ super(parent, opts)
160
+ @db_list = []
161
+ db_list.each do |f|
162
+ @db_list << f if File.exist? f
163
+ end
164
+
165
+ FXLabel.new(self, "Each filename must be in a seperate line, e.g. DirBuster-DBs" )
166
+ frame = FXHorizontalFrame.new(self, :opts => LAYOUT_FILL_X)
167
+
168
+ @db_listbox = FXListBox.new(frame, :opts => LAYOUT_FILL_X|FRAME_SUNKEN|FRAME_THICK)
169
+ @db_list.each do |db|
170
+ item = @db_listbox.appendItem(db)
171
+ @db_listbox.setItemData(@db_listbox.numItems-1, db )
172
+ end
173
+ @db_listbox.numVisible = @db_listbox.numItems
174
+
175
+ @add_db_btn = FXButton.new(frame, "add")
176
+ @add_db_btn.connect(SEL_COMMAND) { add_db }
177
+ end
178
+
179
+ private
180
+
181
+ def add_db
182
+ db_path = File.dirname(get_db_name)
183
+ db = FXFileDialog.getOpenFilename(self, "Open DB", db_path, "All Files (*)")
184
+ unless db.empty?
185
+ item = @db_listbox.appendItem(db)
186
+ i= @db_listbox.numItems-1
187
+ @db_listbox.setItemData(i, db )
188
+ @db_listbox.currentItem = i
189
+ end
190
+ end
191
+ end
133
192
 
134
193
  def updateView()
135
194
  #@project = project
@@ -167,7 +226,7 @@ module Watobo
167
226
 
168
227
 
169
228
  def initialize(owner, project)
170
- super(owner, "File Finder", project, :opts => DECOR_ALL, :width=>800, :height=>400)
229
+ super(owner, "File Finder", project, :opts => DECOR_ALL, :width=>800, :height=>600)
171
230
  load_icon(__FILE__)
172
231
 
173
232
  self.connect(SEL_CLOSE, method(:onClose))
@@ -181,6 +240,28 @@ module Watobo
181
240
 
182
241
  @site = nil
183
242
  @dir = nil
243
+ @db_list = []
244
+ @db_name = ""
245
+ @file_name = ""
246
+
247
+ config = load_config
248
+
249
+
250
+ if config.respond_to? :has_key?
251
+ if config.has_key? :db_list
252
+ config[:db_list].each do |db|
253
+ @db_list << db if File.exist? db
254
+ end
255
+ end
256
+
257
+ if config.has_key? :name
258
+ @db_list.each do |db|
259
+ @db_name = db if config[:name] == db
260
+ end
261
+ @file_name = config[:name] if @db_name.empty?
262
+ end
263
+ end
264
+ puts @db_list
184
265
 
185
266
  begin
186
267
  hs_green = FXHiliteStyle.new
@@ -202,11 +283,15 @@ module Watobo
202
283
  top_splitter = FXSplitter.new(top_frame, LAYOUT_FILL_X|SPLITTER_HORIZONTAL|LAYOUT_FILL_Y|SPLITTER_TRACKING)
203
284
  log_frame = FXVerticalFrame.new(mr_splitter, :opts => LAYOUT_FILL_X|LAYOUT_SIDE_BOTTOM,:height => 100)
204
285
 
286
+ @settings_tab = FXTabBook.new(top_splitter, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y)
287
+ FXTabItem.new(@settings_tab, "Settings", nil)
288
+ @settings_frame = FXVerticalFrame.new(@settings_tab, :opts => LAYOUT_FILL_Y|LAYOUT_FILL_Y|FRAME_RAISED)
205
289
 
206
- @settings_frame = FXVerticalFrame.new(top_splitter, :opts => LAYOUT_FILL_Y)
290
+ FXTabItem.new(@settings_tab, "Logging", nil)
291
+ @logging_frame = FXVerticalFrame.new(@settings_tab, :opts => LAYOUT_FILL_Y|LAYOUT_FILL_Y|FRAME_RAISED)
207
292
 
208
- result_frame = FXVerticalFrame.new(top_splitter, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
209
- @requestCombo = FXComboBox.new(result_frame, 5, nil, 0,
293
+ request_frame = FXVerticalFrame.new(top_splitter, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
294
+ @requestCombo = FXComboBox.new(request_frame, 5, nil, 0,
210
295
  COMBOBOX_STATIC|FRAME_SUNKEN|FRAME_THICK|LAYOUT_SIDE_TOP|LAYOUT_FILL_X)
211
296
  #@filterCombo.width =200
212
297
 
@@ -215,7 +300,7 @@ module Watobo
215
300
  @requestCombo.editable = false
216
301
  @requestCombo.connect(SEL_COMMAND, method(:onSelectRequest))
217
302
 
218
- log_text_frame = FXVerticalFrame.new(result_frame, LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN|FRAME_THICK, :padding=>0)
303
+ log_text_frame = FXVerticalFrame.new(request_frame, LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN|FRAME_THICK, :padding=>0)
219
304
  @request_editor = RequestEditor.new(log_text_frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
220
305
 
221
306
  # @scope_only_cb = FXCheckButton.new(@settings_frame, "target scope only", nil, 0, ICON_BEFORE_TEXT|LAYOUT_SIDE_LEFT)
@@ -246,50 +331,64 @@ module Watobo
246
331
  @test_all_dirs.setCheck(false)
247
332
 
248
333
 
249
- @dbfile_dt = FXDataTarget.new('')
250
- @dbfile_dt.value = ''
251
- @db_path = File.expand_path(File.dirname(__FILE__))
252
- @dbfile_label = FXLabel.new(@settings_frame, "Enter name of file or db-filename:" )
253
- dbfile_frame = FXHorizontalFrame.new(@settings_frame,:opts => LAYOUT_FILL_X|LAYOUT_SIDE_TOP)
254
- @dbfile_text = FXTextField.new(dbfile_frame, 20,
255
- :target => @dbfile_dt, :selector => FXDataTarget::ID_VALUE,
256
- :opts => TEXTFIELD_NORMAL|LAYOUT_FILL_COLUMN)
334
+ @finder_tab = FXTabBook.new(@settings_frame, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y|LAYOUT_RIGHT)
335
+
336
+ FXTabItem.new(@finder_tab, "Filename", nil)
337
+ frame = FXVerticalFrame.new(@finder_tab, :opts => LAYOUT_FILL_X|FRAME_RAISED)
338
+ @search_name_dt = FXDataTarget.new(@file_name)
339
+
340
+ @dbfile_text = FXTextField.new(frame, 30,
341
+ :target => @search_name_dt, :selector => FXDataTarget::ID_VALUE,
342
+ :opts => TEXTFIELD_NORMAL|LAYOUT_FILL_COLUMN|LAYOUT_FILL_X)
257
343
  @dbfile_text.handle(self, FXSEL(SEL_UPDATE, 0), nil)
258
- @dbfile_btn = FXButton.new(dbfile_frame, "Change")
259
- @dbfile_btn.connect(SEL_COMMAND, method(:selectDBFile))
260
344
 
345
+
346
+ FXTabItem.new(@finder_tab, "Database", nil)
347
+ @db_select_frame = DBSelectFrame.new(@finder_tab, @db_list, :opts => FRAME_THICK|FRAME_RAISED|LAYOUT_FILL_X)
261
348
 
262
- @fmode_dt = FXDataTarget.new(0)
349
+ unless @db_name.empty?
350
+ @db_select_frame.select_db @db_name
351
+ @finder_tab.current = 1
352
+ end
353
+
354
+ @fmode_dt = FXDataTarget.new(0)
263
355
  group_box = FXGroupBox.new(@settings_frame, "Mode", LAYOUT_SIDE_TOP|FRAME_GROOVE|LAYOUT_FILL_X, 0, 0, 0, 0)
264
356
  mode_frame = FXVerticalFrame.new(group_box, :opts => LAYOUT_FILL_X)
265
-
266
- @append_extensions_cb = FXCheckButton.new(mode_frame, "append extensions", nil, 0, ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP|LAYOUT_RIGHT|LAYOUT_FILL_Y)
267
- @append_slash_cb = FXCheckButton.new(mode_frame, "append /", nil, 0, ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP|LAYOUT_RIGHT|LAYOUT_FILL_Y)
268
- # group_box = FXGroupBox.new(self, "Collection",LAYOUT_SIDE_TOP|FRAME_GROOVE|LAYOUT_FILL_X|LAYOUT_FILL_Y, 0, 0, 0, 0)
269
- # frame = FXVerticalFrame.new(group_box, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN|FRAME_GROOVE)
270
- # @collectionList = FXList.new(frame, :opts => LIST_EXTENDEDSELECT|LAYOUT_FILL_X|LAYOUT_FILL_Y)
271
- #@fmode_dt.connect(SEL_COMMAND) {
272
- # @file_rb.handle(self, FXSEL(SEL_UPDATE, 0), nil)
273
- # @dir_rb.handle(self, FXSEL(SEL_UPDATE, 0), nil)
274
- #}
275
- #@dbfile_text.enabled = false
276
- #@dbfile_label.enabled = false
277
- #@dbfile_btn.disable
278
- # @use_ssl = FXCheckButton.new(@settings_frame, "use SSL", nil, 0, ICON_BEFORE_TEXT|LAYOUT_SIDE_LEFT)
279
-
280
-
281
- # @run_passive_checks = FXCheckButton.new(@settings_frame, "run passive checks", nil, 0, ICON_BEFORE_TEXT|LAYOUT_SIDE_LEFT)
282
- # @run_passive_checks.setCheck(false)
283
- gbox = FXGroupBox.new(@settings_frame, "Extensions", LAYOUT_SIDE_LEFT|FRAME_GROOVE|LAYOUT_FILL_X|LAYOUT_FILL_Y, 0, 0, 0, 150)
284
- gbframe = FXVerticalFrame.new(gbox, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN|FRAME_THICK, :padding => 0)
285
- @extensions_text = FXText.new(gbframe, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|TEXT_WORDWRAP)
286
- ext = "bak;php;asp;aspx;tgz;tar.gz;gz;tmp;temp;old;_"
287
- # fxtext.backColor = fxtext.parent.backColor
288
- # fxtext.disable
289
- # text = "FileFinder allows you to search easily for specific files, e.g. files you have uploaded.\nIf you want to search for multiple files you can also use a db-file, "
290
- # text << "which is a plain text file - each filename on one line."
357
+ @append_slash_cb = FXCheckButton.new(mode_frame, "append /", nil, 0, ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP|LAYOUT_FILL_Y)
358
+
359
+ @append_extensions_cb = FXCheckButton.new(mode_frame, "append extensions", nil, 0, ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP|LAYOUT_FILL_Y)
360
+ frame = FXVerticalFrame.new(mode_frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN|FRAME_THICK, :padding => 0)
361
+ @extensions_text = FXText.new(frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|TEXT_WORDWRAP)
362
+ ext = "bak;php;asp;aspx;tgz;tar.gz;gz;tmp;temp;old;_"
291
363
 
292
364
  @extensions_text.setText(ext)
365
+
366
+ frame = @logging_frame
367
+ @logScanChats = FXCheckButton.new(frame, "enable", nil, 0, JUSTIFY_LEFT|JUSTIFY_TOP|ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP)
368
+ @logScanChats.checkState = false
369
+
370
+ @logScanChats.connect(SEL_COMMAND) do |sender, sel, item|
371
+ if @logScanChats.checked? then
372
+ @scanlog_name_text.enabled = true
373
+ @scanlog_name_text.backColor = FXColor::White
374
+ else
375
+ @scanlog_name_text.enabled = false
376
+ @scanlog_name_text.backColor = @scanlog_name_text.parent.backColor
377
+ end
378
+ end
379
+
380
+ @scanlog_name_dt = FXDataTarget.new('')
381
+ # @scanlog_name_dt.value = @project.scanLogDirectory() if File.exist?(@project.scanLogDirectory())
382
+ @scanlog_dir_label = FXLabel.new(frame, "Scan Name:" )
383
+ scanlog_frame = FXHorizontalFrame.new(frame,:opts => LAYOUT_FILL_X|LAYOUT_SIDE_TOP)
384
+ @scanlog_name_text = FXTextField.new(scanlog_frame, 20,
385
+ :target => @scanlog_name_dt, :selector => FXDataTarget::ID_VALUE,
386
+ :opts => TEXTFIELD_NORMAL|LAYOUT_FILL_COLUMN|LAYOUT_FILL_X)
387
+ @scanlog_name_text.handle(self, FXSEL(SEL_UPDATE, 0), nil)
388
+ unless @logScanChats.checked?
389
+ @scanlog_name_text.enabled = false
390
+ @scanlog_name_text.backColor = @scanlog_name_text.parent.backColor
391
+ end
293
392
 
294
393
 
295
394
  @pbar = FXProgressBar.new(@settings_frame, nil, 0, LAYOUT_FILL_X|FRAME_SUNKEN|FRAME_THICK|PROGRESSBAR_HORIZONTAL)
@@ -304,15 +403,9 @@ module Watobo
304
403
  @start_button.connect(SEL_COMMAND, method(:start))
305
404
  @start_button.disable
306
405
 
307
-
308
-
309
-
310
-
311
406
  log_frame_header = FXHorizontalFrame.new(log_frame, :opts => LAYOUT_FILL_X)
312
407
  FXLabel.new(log_frame_header, "Logs:" )
313
408
 
314
-
315
- #log_text_frame = FXHorizontalFrame.new(bottom_frame, :opts => LAYOUT_FILL_X|FRAME_SUNKEN|LAYOUT_BOTTOM)
316
409
  log_text_frame = FXVerticalFrame.new(log_frame, LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN|FRAME_THICK, :padding=>0)
317
410
  @log_viewer = LogViewer.new(log_text_frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
318
411
 
@@ -339,6 +432,20 @@ module Watobo
339
432
 
340
433
  private
341
434
 
435
+ def config
436
+ name = @search_name_dt.value
437
+ db_list = @db_select_frame.get_db_list
438
+ if @finder_tab.current == 1
439
+ name = @db_select_frame.get_db_name
440
+ end
441
+
442
+ c={
443
+ :db_list => db_list,
444
+ :name => name
445
+ }
446
+
447
+ end
448
+
342
449
  def onSelectRequest(sender, sel, item)
343
450
  begin
344
451
  chat = @requestCombo.getItemData(@requestCombo.currentItem)
@@ -455,13 +562,7 @@ module Watobo
455
562
  end
456
563
 
457
564
 
458
- def selectDBFile(sender, sel, item)
459
- filename = FXFileDialog.getOpenFilename(self, "Save file", @db_path, "All Files (*)")
460
- if filename != ""
461
- @dbfile_dt.value = filename
462
- @dbfile_text.handle(self, FXSEL(SEL_UPDATE, 0), nil)
463
- end
464
- end
565
+
465
566
 
466
567
 
467
568
  def hide()
@@ -483,7 +584,17 @@ module Watobo
483
584
  @start_button.text = "Cancel"
484
585
  chatlist = []
485
586
  checklist = []
486
- @check = Check.new(@project, @dbfile_dt.value, @project.getScanPreferences())
587
+ #config = { :db_file => @dbfile_dt.value }
588
+ save_config(config)
589
+ name = ''
590
+ if @finder_tab.current == 0
591
+ name = @search_name_dt.value
592
+ else
593
+ name = @db_select_frame.get_db_name
594
+ end
595
+
596
+
597
+ @check = Check.new(@project, name, @project.getScanPreferences())
487
598
 
488
599
  if @append_extensions_cb.checked?
489
600
  extensions = @extensions_text.text.split(/(;|\n)/).select {|x| x !~ /(\n|;)/ }
@@ -547,10 +658,12 @@ module Watobo
547
658
 
548
659
  t.join
549
660
 
550
- # puts @project
551
- # puts @project.getScanPreferences().to_yaml
552
- # puts
553
- @scanner = Watobo::Scanner2.new(chatlist, checklist, @project.passive_checks, @project.getScanPreferences())
661
+ scan_prefs = Watobo.project.getScanPreferences
662
+ if @logScanChats.checked?
663
+ scan_prefs[:scanlog_name] = @scanlog_name_dt.value unless @scanlog_name_dt.value.empty?
664
+ end
665
+
666
+ @scanner = Watobo::Scanner2.new(chatlist, checklist, @project.passive_checks, scan_prefs)
554
667
  @pbar.total = @check.numChecks
555
668
  @pbar.progress = 0
556
669
  @pbar.barColor = 'red'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watobo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.10
4
+ version: 0.9.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-16 00:00:00.000000000 Z
12
+ date: 2012-09-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mechanize
@@ -125,6 +125,7 @@ files:
125
125
  - lib/watobo/gui/main_window.rb
126
126
  - lib/watobo/gui/manual_request_editor.rb
127
127
  - lib/watobo/gui/master_pw_dialog.rb
128
+ - lib/watobo/gui/mixins/gui_settings.rb
128
129
  - lib/watobo/gui/mixins/subscriber.rb
129
130
  - lib/watobo/gui/page_tree.rb
130
131
  - lib/watobo/gui/password_policy_dialog.rb