watobo 0.9.9.pre3 → 0.9.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. data/.yardopts +24 -0
  2. data/CHANGELOG +17 -7
  3. data/README +4 -60
  4. data/bin/nfq_server.rb +191 -0
  5. data/config/interceptor.yml +2 -6
  6. data/lib/watobo/adapters/data_store.rb +1 -1
  7. data/lib/watobo/adapters/file/file_store.rb +50 -33
  8. data/lib/watobo/ca.rb +22 -0
  9. data/lib/watobo/config.rb +6 -0
  10. data/lib/watobo/core/ca.rb +411 -0
  11. data/lib/watobo/core/cert_store.rb +56 -0
  12. data/lib/watobo/core/forwarding_proxy.rb +38 -0
  13. data/lib/watobo/core/http_socket.rb +18 -0
  14. data/lib/watobo/core/intercept_carver.rb +179 -0
  15. data/lib/watobo/core/intercept_filter.rb +257 -0
  16. data/lib/watobo/core/interceptor.rb +342 -79
  17. data/lib/watobo/core/netfilter_queue.rb +191 -0
  18. data/lib/watobo/core/project.rb +84 -138
  19. data/lib/watobo/core/proxy.rb +61 -0
  20. data/lib/watobo/core/request.rb +40 -0
  21. data/lib/watobo/core/response.rb +30 -0
  22. data/lib/watobo/core/scanner.rb +64 -58
  23. data/lib/watobo/core/session.rb +70 -77
  24. data/lib/watobo/core.rb +1 -1
  25. data/lib/watobo/framework/create_project.rb +25 -10
  26. data/lib/watobo/framework/init.rb +13 -0
  27. data/lib/watobo/gui/browser_preview.rb +5 -4
  28. data/lib/watobo/gui/checks_policy_frame.rb +1 -0
  29. data/lib/watobo/gui/client_cert_dialog.rb +11 -6
  30. data/lib/watobo/gui/conversation_table.rb +7 -4
  31. data/lib/watobo/gui/fuzzer_gui.rb +9 -11
  32. data/lib/watobo/gui/intercept_filter_dialog.rb +210 -0
  33. data/lib/watobo/gui/interceptor_gui.rb +59 -21
  34. data/lib/watobo/gui/interceptor_settings_dialog.rb +39 -5
  35. data/lib/watobo/gui/list_box.rb +2 -1
  36. data/lib/watobo/gui/log_viewer.rb +79 -5
  37. data/lib/watobo/gui/main_window.rb +159 -113
  38. data/lib/watobo/gui/manual_request_editor.rb +11 -5
  39. data/lib/watobo/gui/mixins/subscriber.rb +47 -0
  40. data/lib/watobo/gui/project_wizzard.rb +3 -3
  41. data/lib/watobo/gui/proxy_dialog.rb +17 -18
  42. data/lib/watobo/gui/request_editor.rb +1 -1
  43. data/lib/watobo/gui/rewrite_filters_dialog.rb +416 -0
  44. data/lib/watobo/gui/rewrite_rules_dialog.rb +394 -0
  45. data/lib/watobo/gui/scanner_settings_dialog.rb +9 -6
  46. data/lib/watobo/gui/session_management_dialog.rb +33 -23
  47. data/lib/watobo/gui/sites_tree.rb +5 -6
  48. data/lib/watobo/gui/status_bar.rb +101 -49
  49. data/lib/watobo/gui/table_editor.rb +1 -1
  50. data/lib/watobo/gui/templates/plugin2.rb +23 -27
  51. data/lib/watobo/gui/utils/save_default_settings.rb +9 -9
  52. data/lib/watobo/gui/utils/save_proxy_settings.rb +25 -9
  53. data/lib/watobo/gui/utils/save_scanner_settings.rb +10 -7
  54. data/lib/watobo/gui/utils/session_history.rb +1 -1
  55. data/lib/watobo/gui/www_auth_dialog.rb +25 -21
  56. data/lib/watobo/gui.rb +3 -1
  57. data/lib/watobo/mixins/httpparser.rb +47 -40
  58. data/lib/watobo/mixins/request_parser.rb +126 -41
  59. data/lib/watobo/mixins/shapers.rb +124 -15
  60. data/lib/watobo/utils/hexprint.rb +31 -0
  61. data/lib/watobo/utils/load_chat.rb +2 -0
  62. data/lib/watobo/utils/response_builder.rb +111 -0
  63. data/lib/watobo.rb +4 -1
  64. data/modules/active/discovery/http_methods.rb +6 -4
  65. data/modules/active/fileinclusion/lfi_simple.rb +3 -3
  66. data/modules/active/sqlinjection/sqli_timing.rb +6 -6
  67. data/modules/passive/redirectionz.rb +5 -6
  68. data/plugins/catalog/catalog.rb +240 -56
  69. data/plugins/catalog/db_tests +1 -6483
  70. data/plugins/catalog/db_variables +2 -29
  71. data/plugins/crawler/gui/auth_frame.rb +15 -3
  72. data/plugins/crawler/gui/crawler_gui.rb +24 -0
  73. data/plugins/crawler/gui/hooks_frame.rb +7 -2
  74. data/plugins/crawler/gui/settings_tabbook.rb +4 -0
  75. data/plugins/crawler/gui.rb +3 -3
  76. data/plugins/crawler/lib/engine.rb +1 -1
  77. data/plugins/filefinder/filefinder.rb +21 -17
  78. data/plugins/sqlmap/bin/test.rb +100 -0
  79. data/plugins/sqlmap/gui/main.rb +227 -0
  80. data/plugins/sqlmap/gui/options_frame.rb +119 -0
  81. data/plugins/sqlmap/gui.rb +27 -0
  82. data/plugins/sqlmap/icons/sqlmap.ico +0 -0
  83. data/plugins/sqlmap/lib/sqlmap_ctrl.rb +116 -0
  84. data/plugins/sqlmap/sqlmap.rb +26 -0
  85. data/plugins/sslchecker/gui/gui.rb +45 -30
  86. metadata +32 -9
  87. data/certificates/cert.pem +0 -19
  88. data/certificates/privkey.pem +0 -15
  89. data/certificates/watobo_dh.key +0 -5
  90. data/lib/watobo/core/simple_ca.rb +0 -393
@@ -0,0 +1,394 @@
1
+ # .
2
+ # rewrite_rules_dialog.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
+ class RulesTableCtrl < FXHorizontalFrame
25
+ attr_accessor :target
26
+
27
+ def initialize(owner,target = nil, opts)
28
+ @target = target
29
+ super owner, opts
30
+ matrix = FXMatrix.new(self, 4, :opts => MATRIX_BY_COLUMNS|LAYOUT_FILL_X|LAYOUT_FILL_Y)
31
+
32
+ %w( Action Location Pattern Content).each do |l|
33
+ FXLabel.new(matrix, l)
34
+ end
35
+
36
+ @actions_combo = FXComboBox.new(matrix, 10, nil, 0, COMBOBOX_STATIC|FRAME_SUNKEN|FRAME_THICK)
37
+ #@filterCombo.width =200
38
+
39
+ @actions_combo.numVisible = 0
40
+ @actions_combo.numColumns = 10
41
+ @actions_combo.editable = false
42
+ @actions_combo.connect(SEL_COMMAND){}
43
+
44
+ @locations_combo = FXComboBox.new(matrix, 10, nil, 0, COMBOBOX_STATIC|FRAME_SUNKEN|FRAME_THICK)
45
+ #@filterCombo.width =200
46
+
47
+ @locations_combo.numVisible = 0
48
+ @locations_combo.numColumns = 10
49
+ @locations_combo.editable = false
50
+ @locations_combo.connect(SEL_COMMAND){}
51
+
52
+ @pattern_txt = FXTextField.new(matrix, 20, nil, 0, :opts => TEXTFIELD_NORMAL|LAYOUT_FILL_COLUMN)
53
+ @content_txt = FXTextField.new(matrix, 20, nil, 0, :opts => TEXTFIELD_NORMAL|LAYOUT_FILL_COLUMN)
54
+
55
+ frame = FXVerticalFrame.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :padding => 0)
56
+ top_btn_frame = FXHorizontalFrame.new(frame,:opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :padding => 0)
57
+
58
+ @del_btn = FXButton.new(top_btn_frame, "Del" , nil, nil)
59
+ @del_btn.enable
60
+ @del_btn.connect(SEL_COMMAND){ delete_rule }
61
+
62
+ # @edit_btn = FXButton.new(top_btn_frame, "Edit ..." , nil, nil)
63
+ # @edit_btn.enable
64
+ # @edit_btn.connect(SEL_COMMAND){ delete_rule }
65
+
66
+ @up_btn = FXButton.new(top_btn_frame, "Up" , nil, nil)
67
+ @up_btn.enable
68
+
69
+ @down_btn = FXButton.new(top_btn_frame, "Down" , nil, nil)
70
+ @down_btn.enable
71
+
72
+ @filter_btn = FXButton.new(top_btn_frame, "Filter" , nil, nil)
73
+ @filter_btn.enable
74
+ @filter_btn.connect(SEL_COMMAND){ open_filter_dialog }
75
+
76
+
77
+ add_btn_frame = FXHorizontalFrame.new(frame,:opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :padding => 0)
78
+ @add_btn = FXButton.new(add_btn_frame, "Add ..." , nil, nil, )
79
+ @add_btn.enable
80
+ @add_btn.connect(SEL_COMMAND){ add_rule }
81
+
82
+ end
83
+
84
+ private
85
+
86
+ def init_handlers()
87
+
88
+ end
89
+
90
+ def clear_actions
91
+ @actions_combo.clearItems()
92
+ end
93
+
94
+ def add_action(a)
95
+ @actions_combo.appendItem(a.to_s, a)
96
+ @actions_combo.numVisible = @actions_combo.numItems
97
+ end
98
+
99
+ def add_location(l)
100
+ @locations_combo.appendItem(l.to_s, l)
101
+ @locations_combo.numVisible = @locations_combo.numItems
102
+ end
103
+
104
+ def delete_rule
105
+ @target.delete_current_row if @target.respond_to? :delete_current_row
106
+
107
+ end
108
+
109
+ def add_rule
110
+ return false if @target.nil?
111
+ #TODO: Add some checks if rule is ok
112
+ @target.add_rule Watobo::Interceptor::CarverRule.new(:action => @actions_combo.getItemData(@actions_combo.currentItem),
113
+ :location => @locations_combo.getItemData(@locations_combo.currentItem),
114
+ :pattern => @pattern_txt.text,
115
+ :content => @content_txt.text,
116
+ :filter => nil
117
+ )
118
+ end
119
+
120
+ def open_filter_dialog
121
+
122
+ end
123
+
124
+ end
125
+
126
+ class RequestRulesCtrl < RulesTableCtrl
127
+ def initialize(owner, target, opts)
128
+ super owner, target, opts
129
+ add_action :rewrite
130
+ add_action :flag
131
+ add_location :url
132
+ add_location :body
133
+ add_location :header
134
+ add_location :cookie
135
+ add_location :http_parm
136
+
137
+ end
138
+
139
+ def open_filter_dialog
140
+ rule = @target.current_rule
141
+ return false if rule.nil?
142
+ dlg = Watobo::Gui::RequestFilterDialog.new( self, rule )
143
+ if dlg.execute != 0 then
144
+ # TODO: Apply interceptor settings
145
+ rule.set_filter dlg.filter
146
+ @target.reset_table
147
+
148
+ end
149
+ end
150
+ end
151
+
152
+ class ResponseRulesCtrl < RulesTableCtrl
153
+ def initialize(owner, target, opts)
154
+ super owner, target, opts
155
+ add_action :rewrite
156
+ add_location :body
157
+ add_location :header
158
+ add_location :replace_all
159
+ end
160
+
161
+ def open_filter_dialog
162
+ rule = @target.current_rule
163
+ return false if rule.nil?
164
+ dlg = Watobo::Gui::ResponseFilterDialog.new( self, rule )
165
+ if dlg.execute != 0 then
166
+ # TODO: Apply interceptor settings
167
+ rule.set_filter dlg.filter
168
+ @target.reset_table
169
+ end
170
+ end
171
+ end
172
+
173
+ class RulesTable < FXTable
174
+ attr :rules
175
+ def add_rule(rule)
176
+ @rules << rule
177
+ add_rule_row(rule)
178
+ end
179
+
180
+ def current_rule
181
+ return nil if self.currentRow < 0
182
+ return @rules[self.currentRow]
183
+ end
184
+
185
+ def delete_row_by_index(index)
186
+ return false if index < 0
187
+ return false if index > self.numRows-1
188
+ @rules.delete_at index
189
+ self.clearItems
190
+ reset_table
191
+ true
192
+ end
193
+
194
+ def reset_table
195
+ init_columns
196
+
197
+ @rules.each do |r|
198
+ add_rule_row r
199
+ end
200
+ adjust_cell_width
201
+ self.selectRow self.currentRow if self.currentRow >= 0
202
+ end
203
+
204
+ def delete_current_row
205
+ i = self.currentRow
206
+ return false if i < 0
207
+ delete_row_by_index i
208
+ end
209
+
210
+ def initialize( owner, rules=[], opts={} )
211
+ @event_dispatcher_listeners = Hash.new
212
+ parms = { :opts => TABLE_COL_SIZABLE|TABLE_ROW_SIZABLE|LAYOUT_FILL_X|LAYOUT_FILL_Y|TABLE_READONLY|LAYOUT_SIDE_TOP,
213
+ :padding => 2
214
+ }
215
+ parms.update opts
216
+
217
+ super(owner, parms)
218
+
219
+ self.extend Watobo::Gui::Subscriber
220
+ self.setBackColor(FXRGB(255, 255, 255))
221
+ self.setCellColor(0, 0, FXRGB(255, 255, 255))
222
+ self.setCellColor(0, 1, FXRGB(255, 240, 240))
223
+ self.setCellColor(1, 0, FXRGB(240, 255, 240))
224
+ self.setCellColor(1, 1, FXRGB(240, 240, 255))
225
+
226
+ @columns=Hash.new
227
+
228
+ @rules = []
229
+ @rules.concat rules
230
+
231
+ add_column "Action", 50
232
+ add_column "Location", 80
233
+ add_column "Pattern", 80
234
+ add_column "Content", 80
235
+ add_column "Filter", 80
236
+
237
+ init_columns
238
+
239
+ @rules.each do |r|
240
+ add_rule_row r
241
+ end
242
+ adjust_cell_width
243
+
244
+ self.connect(SEL_SELECTED){|sender,sel,pos|
245
+ self.selectRow pos.row
246
+ # notify(:rule_selected, @rules[pos.row])
247
+ }
248
+ end
249
+
250
+ private
251
+
252
+ def add_rule_row(rule)
253
+ row_index = self.getNumRows
254
+ self.appendRows(1)
255
+
256
+ self.rowHeader.setItemJustify(row_index, FXHeaderItem::RIGHT)
257
+ self.setRowText(row_index, (row_index+1).to_s)
258
+
259
+ index = @columns[:action][:order]
260
+ self.setItemText(row_index, index, rule.action_name)
261
+ self.getItem(row_index, index).justify = FXTableItem::LEFT
262
+
263
+ index = @columns[:location][:order]
264
+ self.setItemText(row_index, index, rule.location_name)
265
+ self.getItem(row_index, index).justify = FXTableItem::LEFT
266
+
267
+ index = @columns[:pattern][:order]
268
+ self.setItemText(row_index, index, rule.pattern_name)
269
+ self.getItem(row_index, index).justify = FXTableItem::LEFT
270
+
271
+ index = @columns[:content][:order]
272
+ self.setItemText(row_index, index, rule.content_name)
273
+ self.getItem(row_index, index).justify = FXTableItem::LEFT
274
+
275
+ index = @columns[:filter][:order]
276
+ self.setItemText(row_index, index, rule.filter_name)
277
+ self.getItem(row_index, index).justify = FXTableItem::LEFT
278
+
279
+
280
+ end
281
+ def add_column(name, width, order=0)
282
+ o = ( order == 0 ) ? @columns.length : order
283
+ @columns[name.downcase.to_sym] = { :name => name,
284
+ :width => width,
285
+ :order => o
286
+ }
287
+
288
+ end
289
+
290
+ def adjust_cell_width()
291
+ begin
292
+ self.rowHeader.width = 30
293
+ #self.fitColumnsToContents(0)
294
+ @columns.each_with_index do |v,i|
295
+
296
+ self.setColumnWidth(i, v[1][:width])
297
+ end
298
+ rescue => bang
299
+ puts "!!!ERROR: adjustCellWidth"
300
+ puts bang
301
+ puts bang.backtrace
302
+ end
303
+
304
+ end
305
+
306
+ def init_columns
307
+ self.setTableSize(0, @columns.length)
308
+ self.visibleRows = 5
309
+ self.visibleColumns = @columns.length
310
+
311
+ @columns.sort_by{|k,v| v[:order] }.each_with_index do |v,i|
312
+ self.setColumnText( i, v[1][:name] )
313
+ end
314
+
315
+ end
316
+
317
+ end
318
+
319
+ class RequestRulesTable < RulesTable
320
+ def initialize(owner, opts={})
321
+ super owner, opts
322
+ add_column "Action", 50
323
+ add_column "Location", 80
324
+ add_column "Pattern", 80
325
+ add_column "Content", 80
326
+ add_column "Filter", 80
327
+
328
+ init_columns
329
+ adjust_cell_width
330
+
331
+ end
332
+ end
333
+
334
+ class RewriteRulesDialog < FXDialogBox
335
+
336
+ include Responder
337
+ def request_rules
338
+ @request_rules_table.rules
339
+ end
340
+
341
+ def response_rules
342
+ @response_rules_table.rules
343
+ end
344
+
345
+ def initialize(owner, settings = {} )
346
+ super(owner, "Rewrite Rules", DECOR_TITLE|DECOR_BORDER|DECOR_CLOSE, :width => 650, :height => 610)
347
+
348
+ FXMAPFUNC(SEL_COMMAND, ID_ACCEPT, :onAccept)
349
+
350
+ @main_frame = FXVerticalFrame.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :padding => 0)
351
+ init_request_rules(@main_frame)
352
+ init_response_rules(@main_frame)
353
+
354
+ buttons_frame = FXHorizontalFrame.new(@main_frame, :opts => LAYOUT_FILL_X|LAYOUT_BOTTOM)
355
+ @finishButton = FXButton.new(buttons_frame, "Accept" , nil, nil, :opts => BUTTON_NORMAL|LAYOUT_RIGHT)
356
+ @finishButton.enable
357
+ @finishButton.connect(SEL_COMMAND) do |sender, sel, item|
358
+ #self.handle(self, FXSEL(SEL_COMMAND, ID_CANCEL), nil)
359
+ self.handle(self, FXSEL(SEL_COMMAND, ID_ACCEPT), nil)
360
+ end
361
+
362
+ @cancelButton = FXButton.new(buttons_frame, "Cancel" ,
363
+ :target => self, :selector => FXDialogBox::ID_CANCEL,
364
+ :opts => BUTTON_NORMAL|LAYOUT_RIGHT)
365
+ end
366
+
367
+ private
368
+
369
+ def onAccept(sender, sel, event)
370
+
371
+ getApp().stopModal(self, 1)
372
+ self.hide()
373
+ return 1
374
+ end
375
+
376
+ def init_request_rules(owner)
377
+
378
+ gbframe = FXGroupBox.new(owner, "Request Rules", LAYOUT_SIDE_RIGHT|FRAME_GROOVE|LAYOUT_FILL_X, 0, 0, 0, 0)
379
+ frame = FXVerticalFrame.new(gbframe, :opts => LAYOUT_FILL_X, :padding => 0)
380
+
381
+ @request_rules_table = RulesTable.new(frame, Interceptor::RequestCarver.rules)
382
+ @request_rules_ctrl = RequestRulesCtrl.new(gbframe, @request_rules_table, :opts => LAYOUT_FILL_X|FRAME_SUNKEN|FRAME_THICK)
383
+ end
384
+
385
+ def init_response_rules(owner)
386
+ gbframe = FXGroupBox.new(owner, "Response Rules", LAYOUT_SIDE_RIGHT|FRAME_GROOVE|LAYOUT_FILL_X, 0, 0, 0, 0)
387
+ frame = FXVerticalFrame.new(gbframe, :opts => LAYOUT_FILL_X, :padding => 0)
388
+
389
+ @response_rules_table = RulesTable.new(frame, Interceptor::ResponseCarver.rules)
390
+ @response_rules_ctrl = ResponseRulesCtrl.new(gbframe, @response_rules_table, :opts => LAYOUT_FILL_X|FRAME_SUNKEN|FRAME_THICK)
391
+ end
392
+ end
393
+ end
394
+ end
@@ -81,10 +81,11 @@ module Watobo
81
81
  end
82
82
  end
83
83
 
84
- def initialize(owner, scan_settings, opts)
84
+ # def initialize(owner, scan_settings, opts)
85
+ def initialize(owner, opts)
85
86
  super(owner, opts)
86
87
 
87
- @settings = scan_settings
88
+ @settings = Watobo::Conf::Scanner.to_h
88
89
  # puts @settings[:scanlog_dir]
89
90
  scroller = FXScrollWindow.new(self, :opts => SCROLLERS_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y)
90
91
  scroll_area = FXVerticalFrame.new(scroller, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :padding => 0)
@@ -312,7 +313,9 @@ module Watobo
312
313
 
313
314
  def onAccept(sender, sel, event)
314
315
 
315
- @scanner_settings = @scannerSettingsFrame.getSettings()
316
+ new_settings = Watobo::Conf::Scanner.to_h
317
+ new_settings.update @scannerSettingsFrame.getSettings()
318
+ Watobo::Conf::Scanner.set new_settings
316
319
 
317
320
  getApp().stopModal(self, 1)
318
321
  self.hide()
@@ -321,9 +324,9 @@ module Watobo
321
324
 
322
325
 
323
326
 
324
- def initialize(owner, scanner_settings, prefs)
327
+ def initialize(owner, prefs)
325
328
  super(owner, "Scanner Settings", DECOR_TITLE|DECOR_BORDER, :width => 400, :height => 500)
326
- @scanner_settings = scanner_settings
329
+ # @scanner_settings = scanner_settings
327
330
  FXMAPFUNC(SEL_COMMAND, ID_ACCEPT, :onAccept)
328
331
 
329
332
 
@@ -332,7 +335,7 @@ module Watobo
332
335
  # puts "create scopeframe with scope:"
333
336
  # @project.scope
334
337
  # @defineScopeFrame = DefineScopeFrame.new(base_frame, @project.listSites(), YAML.load(YAML.dump(@project.scope)), prefs)
335
- @scannerSettingsFrame = ScannerSettingsFrame.new(base_frame, @scanner_settings, :opts => SCROLLERS_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y)
338
+ @scannerSettingsFrame = ScannerSettingsFrame.new(base_frame, :opts => SCROLLERS_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y)
336
339
 
337
340
  buttons_frame = FXHorizontalFrame.new(base_frame,
338
341
  :opts => LAYOUT_FILL_X|LAYOUT_SIDE_TOP)
@@ -227,8 +227,8 @@ module Watobo
227
227
  @signature_field.handle(self, FXSEL(SEL_UPDATE, 0), nil)
228
228
  end
229
229
 
230
- def initialize(parent, project)
231
- @project = project
230
+ def initialize(parent)
231
+ @project = Watobo.project
232
232
  @signature = FXDataTarget.new('')
233
233
 
234
234
  super(parent, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
@@ -251,12 +251,12 @@ module Watobo
251
251
 
252
252
  @signature_list.connect(SEL_COMMAND,method(:onSignatureClick))
253
253
 
254
- if @project then
255
- @project.getLogoutSignatures.each do |p|
254
+
255
+ Watobo::Conf::Scanner.logout_signatures.each do |p|
256
256
  item = @signature_list.appendItem("#{p}")
257
257
  @signature_list.setItemData(item, p)
258
258
  end
259
- end
259
+
260
260
  end
261
261
  end
262
262
 
@@ -418,8 +418,8 @@ module Watobo
418
418
  end
419
419
  end
420
420
 
421
- def initialize(parent, project)
422
- @project = project
421
+ def initialize(parent)
422
+ @project = Watobo.project
423
423
  @pattern = FXDataTarget.new('')
424
424
 
425
425
  super(parent, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
@@ -466,18 +466,18 @@ module Watobo
466
466
  sunken = FXVerticalFrame.new(frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN, :padding => 0)
467
467
  @response_viewer = SidPreview.new(sunken, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
468
468
 
469
- if @project then
470
- @project.getSidPatterns.each do |p|
469
+
470
+ Watobo::Conf::Scanner.sid_patterns.each do |p|
471
471
  item = @pattern_list.appendItem("#{p}")
472
472
  @pattern_list.setItemData(item, p)
473
473
  end
474
- end
474
+
475
475
  end
476
476
  end
477
477
 
478
478
  class SIDCacheFrame < FXVerticalFrame
479
- def initialize(parent, project)
480
- @project = project
479
+ def initialize(parent)
480
+ @project = Watobo.project
481
481
  super(parent, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
482
482
  # button_frame = FXHorizontalFrame.new(self, :opts=> LAYOUT_FILL_X)
483
483
  # refresh_btn = FXButton.new(button_frame, "Refresh")
@@ -566,8 +566,8 @@ module Watobo
566
566
  @scriptTable.addChat(chat)
567
567
  end
568
568
 
569
- def initialize(parent, project)
570
- @project = project
569
+ def initialize(parent)
570
+ @project = Watobo.project
571
571
  @table_filter = FXDataTarget.new('')
572
572
  @sel_row = -1
573
573
  super(parent, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
@@ -609,7 +609,7 @@ module Watobo
609
609
  frame = FXVerticalFrame.new(tabBook, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_RAISED)
610
610
  @response_viewer = Watobo::Gui::SimpleTextView.new(frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN, :padding => 0)
611
611
 
612
- if @project then
612
+ if @project.respond_to? :getLoginChatIds then
613
613
  @project.getLoginChatIds.each do |id|
614
614
  chat = @project.getChat(id)
615
615
  addRequest(chat)
@@ -636,8 +636,8 @@ module Watobo
636
636
  signatures = @logoutSettings.getLogoutSignatures()
637
637
  end
638
638
 
639
- def initialize(owner, project)
640
- @project = project
639
+ def initialize(owner)
640
+ #@project = project
641
641
  # Invoke base class initialize function first
642
642
  # super(owner, "LoginScript Wizzard", DECOR_TITLE|DECOR_BORDER,:width=>800, :height=>600)
643
643
  super(owner, "Session Management", DECOR_ALL, :width=>800, :height=>600)
@@ -645,20 +645,28 @@ module Watobo
645
645
  main_frame = FXVerticalFrame.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :padding => 0)
646
646
 
647
647
  tabBook = FXTabBook.new(main_frame, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y|LAYOUT_RIGHT)
648
+ @loginSettings = nil
649
+ @sidSettings = nil
650
+
651
+ unless Watobo.project.nil?
648
652
 
649
653
  login_tab = FXTabItem.new(tabBook, "Login Script", nil)
650
- @loginSettings = LoginScriptSettings.new(tabBook, @project)
654
+ @loginSettings = LoginScriptSettings.new(tabBook)
651
655
 
652
- sid_tab = FXTabItem.new(tabBook, "Sesssion IDs", nil)
656
+
657
+ end
658
+ sid_tab = FXTabItem.new(tabBook, "Sesssion IDs", nil)
653
659
  # @sidFrame = FXVerticalFrame.new(tabBook, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
654
- @sidSettings = SessionIdSettings.new(tabBook, @project)
660
+ @sidSettings = SessionIdSettings.new(tabBook)
655
661
 
656
662
  logout_tab = FXTabItem.new(tabBook, "Logout Signatures", nil)
657
- @logoutSettings = LogoutSettings.new(tabBook, @project)
663
+ @logoutSettings = LogoutSettings.new(tabBook)
658
664
 
665
+ unless Watobo.project.nil?
659
666
  sidcache_tab = FXTabItem.new(tabBook, "SID-Cache", nil)
660
- SIDCacheFrame.new(tabBook, @project)
661
-
667
+ SIDCacheFrame.new(tabBook)
668
+ end
669
+
662
670
  tabBook.connect(SEL_COMMAND) do |sender, sel, tabItem|
663
671
 
664
672
  case tabItem.to_i
@@ -666,8 +674,10 @@ module Watobo
666
674
  # puts "Login Script Selected"
667
675
  when 1
668
676
  # puts "Session IDs Selected"
677
+ unless Watobo.project.nil?
669
678
  ids = getLoginScriptIds()
670
679
  @sidSettings.updateRequests(ids)
680
+ end
671
681
  when 2
672
682
  # puts "Logout Selected"
673
683
  end
@@ -99,15 +99,14 @@ module Watobo
99
99
  end
100
100
 
101
101
  def addChat(chat)
102
- add_chat = true
103
-
104
- add_chat = @project.siteInScope?(chat.request.site) if @show_scope_only == true
102
+ if @show_scope_only == true
103
+ return false unless @project.siteInScope?(chat.request.site)
104
+ end
105
105
  @tree_filters[:response_status].each do |rf|
106
106
  #puts "#{chat.response.status} / #{rf}"
107
- add_chat = false if chat.response.status =~ /#{rf}/
107
+ return false if chat.response.status =~ /#{rf}/
108
108
  end
109
-
110
- addChatItem(chat) if add_chat
109
+ addChatItem(chat)
111
110
  end
112
111
 
113
112
  # end