watobo 0.9.8.724 → 0.9.9.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. data/CHANGELOG +17 -0
  2. data/bin/watobo +1 -1
  3. data/lib/watobo/adapters/file/file_store.rb +93 -52
  4. data/lib/watobo/config.rb +90 -12
  5. data/lib/watobo/core/active_check.rb +8 -4
  6. data/lib/watobo/core/http_socket.rb +5 -5
  7. data/lib/watobo/core/interceptor.rb +9 -5
  8. data/lib/watobo/core/project.rb +16 -1
  9. data/lib/watobo/defaults.rb +2 -1
  10. data/lib/watobo/externals.rb +1 -1
  11. data/lib/watobo/framework/create_project.rb +10 -2
  12. data/lib/watobo/gui/certificate_dialog.rb +1 -1
  13. data/lib/watobo/gui/chat_diff.rb +19 -2
  14. data/lib/watobo/gui/client_cert_dialog.rb +1 -1
  15. data/lib/watobo/gui/conversation_table.rb +57 -37
  16. data/lib/watobo/gui/conversation_table_ctrl.rb +48 -26
  17. data/lib/watobo/gui/finding_info.rb +1 -0
  18. data/lib/watobo/gui/findings_tree.rb +91 -11
  19. data/lib/watobo/gui/list_box.rb +122 -0
  20. data/lib/watobo/gui/log_viewer.rb +36 -28
  21. data/lib/watobo/gui/main_window.rb +119 -91
  22. data/lib/watobo/gui/manual_request_editor.rb +7 -3
  23. data/lib/watobo/gui/page_tree.rb +231 -0
  24. data/lib/watobo/gui/plugin/base.rb +1 -1
  25. data/lib/watobo/gui/preferences_dialog.rb +1 -1
  26. data/lib/watobo/gui/quick_scan_dialog.rb +1 -3
  27. data/lib/watobo/gui/sites_tree.rb +6 -4
  28. data/lib/watobo/gui/templates/plugin2.rb +40 -14
  29. data/lib/watobo/gui/utils/load_icons.rb +1 -0
  30. data/lib/watobo/gui/utils/load_plugins.rb +59 -36
  31. data/lib/watobo/gui/utils/save_default_settings.rb +34 -5
  32. data/lib/watobo/gui/utils/save_proxy_settings.rb +10 -8
  33. data/lib/watobo/gui/utils/save_scanner_settings.rb +37 -0
  34. data/lib/watobo/gui.rb +1 -1
  35. data/lib/watobo/utils/file_management.rb +4 -9
  36. data/lib/watobo/utils/load_chat.rb +2 -2
  37. data/lib/watobo/utils/strings.rb +32 -0
  38. data/lib/watobo.rb +4 -1
  39. data/modules/active/fileinclusion/lfi_simple.rb +2 -2
  40. data/modules/active/sqlinjection/sql_boolean.rb +2 -2
  41. data/modules/active/sqlinjection/{sqli_simple.rb → sqli_error.rb} +7 -7
  42. data/modules/active/sqlinjection/sqli_timing.rb +241 -0
  43. data/modules/active/xss/xss_rated.rb +204 -0
  44. data/modules/active/xss/xss_simple.rb +2 -2
  45. data/modules/passive/in_script_parameter.rb +1 -1
  46. data/plugins/crawler/crawler.rb +79 -0
  47. data/plugins/crawler/gui/auth_frame.rb +270 -0
  48. data/plugins/crawler/gui/crawler_gui.rb +252 -0
  49. data/plugins/crawler/gui/general_settings_frame.rb +118 -0
  50. data/plugins/crawler/gui/hooks_frame.rb +97 -0
  51. data/plugins/crawler/gui/scope_frame.rb +72 -0
  52. data/plugins/crawler/gui/settings_tabbook.rb +56 -0
  53. data/plugins/crawler/gui/status_frame.rb +81 -0
  54. data/plugins/crawler/gui.rb +114 -0
  55. data/plugins/crawler/icons/crawler.ico +0 -0
  56. data/plugins/crawler/lib/bags.rb +40 -0
  57. data/{lib/watobo/gui/utils/save_session_settings.rb → plugins/crawler/lib/constants.rb} +9 -5
  58. data/plugins/crawler/lib/engine.rb +486 -0
  59. data/plugins/crawler/lib/grabber.rb +85 -0
  60. data/plugins/crawler/lib/uri_mp.rb +33 -0
  61. data/plugins/sslchecker/gui/gui.rb +2 -2
  62. metadata +51 -11
@@ -22,75 +22,83 @@
22
22
  module Watobo
23
23
  module Gui
24
24
  class LogViewer < FXVerticalFrame
25
-
25
+
26
26
  include Watobo::Constants
27
-
28
27
  def purge
29
28
  @lock.synchronize do
30
- @log_viewer.text = ''
29
+ @log_viewer.text = ''
31
30
  end
32
31
  end
33
32
 
34
33
  def log(sender=nil, log_level, msg )
35
34
  puts "#{sender.class} => #{msg}" if $DEBUG
36
35
  begin
37
- t = Time.now
38
- now = t.strftime("%m/%d/%Y @ %H:%M:%S")
36
+ t = Time.now
37
+ now = t.strftime("%m/%d/%Y @ %H:%M:%S")
39
38
 
40
- begin
41
- log_text = case log_level
42
- when LOG_INFO
43
- "#{now}: #{msg}\n"
44
- else
39
+ begin
40
+ log_text = case log_level
41
+ when LOG_INFO
42
+ "#{now}: #{msg}\n"
43
+ else
45
44
  ""
45
+ end
46
+ rescue => bang
47
+ puts bang
48
+ puts bang.backtrace if $DEBUG
49
+ end
50
+ @lock.synchronize do
51
+ log_text << @log_message unless @log_message.nil?
52
+ @log_message = log_text
46
53
  end
47
54
  rescue => bang
48
- puts bang
49
- puts bang.backtrace if $DEBUG
55
+ puts bang
56
+ puts bang.backtrace
50
57
  end
51
- @lock.synchronize do
52
- log_text << @log_message unless @log_message.nil?
53
- @log_message = log_text
54
- end
55
- rescue => bang
56
- puts bang
57
- puts bang.backtrace
58
- end
59
-
58
+
60
59
  end
61
60
 
62
61
  def start_update_timer
63
- @timer = FXApp.instance.addTimeout( 50, :repeat => true) {
62
+ @timer = FXApp.instance.addTimeout( 50, :repeat => true) {
64
63
  @lock.synchronize do
65
64
  unless @log_message.nil?
66
- @log_viewer.insertText(0,@log_message) unless @log_message.empty?
65
+ unless @log_message.empty?
66
+ case @mode
67
+ when :insert
68
+ @log_viewer.insertText(0,@log_message)
69
+ when :append
70
+ @log_viewer.appendText(@log_message)
71
+ end
72
+ end
67
73
  @log_message = nil
68
74
  end
69
75
  end
70
76
  }
71
77
  end
72
-
78
+
73
79
  def destroy
74
80
  getApp().removeTimeout(@timer) unless @timer.nil?
75
81
  super
76
82
  1
77
83
  end
78
-
79
- def initialize(parent, opts)
84
+
85
+ def initialize(parent, mode = :insert, opts)
80
86
  opts[:padding] = 0
81
87
  super(parent, opts)
82
88
 
89
+ @mode = mode
90
+
83
91
  @log_message = nil
84
92
  @lock = Mutex.new
85
93
  @timer = nil
86
-
94
+
87
95
  #self.connect(SEL_CLOSE, method(:onClose))
88
96
 
89
97
  @log_viewer = FXText.new(self, nil, 0, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
90
98
  @log_viewer.editable = false
91
99
  start_update_timer
92
100
  end
93
-
101
+
94
102
  end
95
103
 
96
104
  end
@@ -165,89 +165,108 @@ module Watobo
165
165
  Watobo::Utils.save_settings(@default_settings_file, settings )
166
166
  =end
167
167
  end
168
+
169
+
168
170
 
169
- def saveSessionSettings(project=nil)
170
- return
171
- puts "- saveSessionSettings -"
172
- ss = YAML.load(YAML.dump(project.settings))
173
- unless project.nil?
174
- puts "* saving session settings to #{project.sessionSettingsFile}"
175
- settings = Hash.new
176
- [:logout_signatures, :non_unique_parms, :login_chat_ids, :excluded_chats, :project_name, :session_name, :csrf_request_ids ].each do |k|
177
- settings[k] = Hash.new
178
- settings[k] = ss[k] if ss.has_key?(k)
179
- end
180
-
181
- Watobo::Utils.save_settings(project.sessionSettingsFile, settings)
171
+ def saveSessionSettings_UNUSED(project=nil)
172
+ begin
173
+ #project.session_store.save_session_settings(project.session_settings)
174
+ # Watobo::Conf::Scanner.save_session(project.session_store)
175
+ Watobo::Gui.save_scanner_settings(project)
176
+ return true
177
+ rescue => bang
178
+ puts bang
179
+ puts bang.backtrace if $DEBUG
182
180
  end
181
+ return false
182
+ # puts "- saveSessionSettings -"
183
+ # ss = YAML.load(YAML.dump(project.settings))
184
+ # unless project.nil?
185
+ # puts "* saving session settings to #{project.sessionSettingsFile}"
186
+ # settings = Hash.new
187
+ # [:logout_signatures, :non_unique_parms, :login_chat_ids, :excluded_chats, :project_name, :session_name, :csrf_request_ids ].each do |k|
188
+ # settings[k] = Hash.new
189
+ # settings[k] = ss[k] if ss.has_key?(k)
190
+ # end#
191
+ #
192
+ # Watobo::Utils.save_settings(project.sessionSettingsFile, settings)
193
+ # end
183
194
  end
184
195
 
185
- def saveProjectSettings(project=nil)
186
- return
187
- unless project.nil?
188
- ps = YAML.load(YAML.dump(project.scan_settings))
189
- settings = { :scanner => Hash.new }
190
- [:policy, :scope, :www_auth ].each do |k|
191
- settings[:scanner][k] = Hash.new
192
- settings[:scanner][k].update ps[k] if ps.has_key?(k)
193
- end
194
-
195
- settings[:scanner][:custom_error_patterns] = ps[:custom_error_patterns]
196
- settings[:scanner][:csrf_patterns] = ps[:csrf_patterns] unless ps[:csrf_patterns].nil?
196
+ def saveProjectSettings_UNUSED(project=nil)
197
+ begin
198
+ # project.session_store.save_project_settings(project.scan_settings)
199
+ return true
200
+ rescue => bang
201
+ puts bang
202
+ puts bang.backtrace if $DEBUG
203
+ end
204
+ return false
205
+
206
+ # unless project.nil?
207
+ # ps = YAML.load(YAML.dump(project.scan_settings))
208
+ # settings = { :scanner => Hash.new }
209
+ # [:policy, :scope, :www_auth ].each do |k|
210
+ # settings[:scanner][k] = Hash.new
211
+ # settings[:scanner][k].update ps[k] if ps.has_key?(k)
212
+ # end
213
+ #
214
+ # settings[:scanner][:custom_error_patterns] = ps[:custom_error_patterns]
215
+ # settings[:scanner][:csrf_patterns] = ps[:csrf_patterns] unless ps[:csrf_patterns].nil?#
197
216
 
198
217
  # remove proxy list because they are stored in the default settings
199
- settings[:forwarding_proxy] = project.forward_proxy_settings
218
+ # settings[:forwarding_proxy] = project.forward_proxy_settings
200
219
 
201
- settings[:project_name] = project.project_name
220
+ # settings[:project_name] = project.project_name
202
221
  # puts "==== WWW AUTH ==="
203
222
  # puts YAML.dump( settings[:www_auth] )
204
223
 
205
224
  # puts "=== PASSWORD POLICY ==="
206
225
  # puts YAML.dump(@settings[:password_policy])
207
226
  #if master_password_required?
208
- password_set = false
209
- settings[:www_auth].each_key do |p|
210
- if settings[:www_auth][p].has_key? :password
211
- password_set = true unless settings[:www_auth][p][:password] == ''
212
- end
213
- end
214
- if @settings[:password_policy][:save_passwords] == true
215
- unless settings[:www_auth].empty?
216
- if @settings[:password_policy][:save_without_master] == false
217
- if password_set and @settings[:master_password].empty?
218
- puts "* need master password for server auth encryption"
219
- dlg = MasterPWDialog.new(self)
220
- if dlg.execute != 0
221
- @settings[:master_password] = dlg.masterPassword
222
- end
223
- end
224
- unless @settings[:master_password].empty?
225
- settings[:www_auth].each_key do |p|
226
- creds = settings[:www_auth][p]
227
- #pass = "$$WPE$$" + creds[:password]
228
- pass = creds[:password]
229
- if pass != ''
230
- creds[:password] = Crypto.encryptPassword(pass, @settings[:master_password])
231
- creds[:encrypted] = true
232
- end
233
- end
234
- else
235
- cleanCredentials(settings)
236
- FXMessageBox.information(self,MBOX_OK,"No MasterPassword", "Could not encrypt www_auth passwords. No Passwords have been saved!")
237
- end
238
-
239
- else
240
- puts "* saving passwords without protection!!!!"
241
- end
242
- end
243
- else
244
- cleanCredentials(settings)
245
- end
227
+ # password_set = false
228
+ # settings[:www_auth].each_key do |p|
229
+ # if settings[:www_auth][p].has_key? :password
230
+ # password_set = true unless settings[:www_auth][p][:password] == ''
231
+ # end
232
+ # end
233
+ # if @settings[:password_policy][:save_passwords] == true
234
+ # unless settings[:www_auth].empty?
235
+ # if @settings[:password_policy][:save_without_master] == false
236
+ # if password_set and @settings[:master_password].empty?
237
+ # puts "* need master password for server auth encryption"
238
+ # dlg = MasterPWDialog.new(self)
239
+ # if dlg.execute != 0
240
+ # @settings[:master_password] = dlg.masterPassword
241
+ # end
242
+ # end
243
+ # unless @settings[:master_password].empty?
244
+ # settings[:www_auth].each_key do |p|
245
+ # creds = settings[:www_auth][p]
246
+ # #pass = "$$WPE$$" + creds[:password]
247
+ # pass = creds[:password]
248
+ # if pass != ''
249
+ # creds[:password] = Crypto.encryptPassword(pass, @settings[:master_password])
250
+ # creds[:encrypted] = true
251
+ # end
252
+ # end
253
+ # else
254
+ # cleanCredentials(settings)
255
+ # FXMessageBox.information(self,MBOX_OK,"No MasterPassword", "Could not encrypt www_auth passwords. No Passwords have been saved!")
256
+ # end#
257
+
258
+ # else
259
+ # puts "* saving passwords without protection!!!!"
260
+ # end
261
+ # end
262
+ # else
263
+ # cleanCredentials(settings)
264
+ # end
246
265
 
247
266
  # puts "* saving www_auth settings ..."
248
267
  # puts YAML.dump( settings[:www_auth])
249
- Watobo::Utils.save_settings(project.projectSettingsFile, settings)
250
- end
268
+ # Watobo::Utils.save_settings(project.projectSettingsFile, settings)
269
+ # end
251
270
  end
252
271
 
253
272
  def update_conversation_table(project)
@@ -336,8 +355,9 @@ module Watobo
336
355
  @project.setLogoutSignatures(logout_signatures)
337
356
  end
338
357
  # save settings
339
- saveProjectSettings(@project)
340
- saveSessionSettings(@project)
358
+ #saveProjectSettings(@project)
359
+ #saveSessionSettings(@project)
360
+ Watobo::Gui.save_settings()
341
361
  end
342
362
  end
343
363
 
@@ -379,8 +399,9 @@ module Watobo
379
399
  #puts "* New WWW-Authentication"
380
400
  #puts @project.getWwwAuthentication().to_yaml
381
401
  Watobo::Conf::General.save_passwords = w3adlg.savePasswords?
382
- saveProjectSettings(@project)
383
- Watobo::Gui.save_default_settings(@project)
402
+ # saveProjectSettings(@project)
403
+ # Watobo::Gui.save_default_settings(@project)
404
+ Watobo::Gui.save_settings()
384
405
  @iproxy.www_auth = @project.getWwwAuthentication()
385
406
  end
386
407
  puts "* new www_auth settings"
@@ -419,11 +440,12 @@ module Watobo
419
440
  dlg = Watobo::Gui::PasswordPolicyDialog.new(self, @settings[:password_policy] )
420
441
  if dlg.execute != 0
421
442
  @settings[:password_policy] = dlg.passwordPolicy
422
- Watobo::Gui.save_default_settings(@project)
443
+ #Watobo::Gui.save_default_settings(@project)
423
444
  #puts "* New WWW-Authentication"
424
445
  #puts @project.getWwwAuthentication().to_yaml
425
446
  #@settings[:password_policy][:save_passwords] = w3adlg.savePasswords?
426
- saveProjectSettings(@project)
447
+ #saveProjectSettings(@project)
448
+ Watobo::Gui.save_settings()
427
449
  #@iproxy.www_auth = @project.settings[:www_auth]
428
450
  end
429
451
  end
@@ -660,8 +682,9 @@ module Watobo
660
682
  startProject(project)
661
683
 
662
684
  Watobo::Gui.history.add_entry(:project_name => new_project_settings[:project_name], :session_name => new_project_settings[:session_name])
663
- Watobo::Gui.save_default_settings project
664
- puts @project.class
685
+ #Watobo::Gui.save_default_settings project
686
+ Watobo::Gui.save_settings()
687
+ #puts @project.class
665
688
  end
666
689
 
667
690
  end
@@ -867,7 +890,7 @@ module Watobo
867
890
  session_settings = {}
868
891
 
869
892
  # if File.exists?(session_file) then
870
- # session_settings = Watobo::Utils.loadSettings(session_file)
893
+ # session_settings = Watobo::Utils.load_settings(session_file)
871
894
  #updateistory(session_file)
872
895
 
873
896
  # else
@@ -888,7 +911,7 @@ module Watobo
888
911
  =begin
889
912
  project_file = File.expand_path(File.join(File.dirname(session_file), "..", session_settings[:project_name] + ".wps"))
890
913
  if File.exists?(project_file) then
891
- project_settings = Watobo::Utils.loadSettings(project_file)
914
+ project_settings = Watobo::Utils.load_settings(project_file)
892
915
  if not project_settings.is_a? Hash then
893
916
  project_settings = Hash.new
894
917
  end
@@ -1303,15 +1326,17 @@ module Watobo
1303
1326
  frame = FXVerticalFrame.new(tab_frame, :opts => LAYOUT_FILL_Y|LAYOUT_FILL_X|FRAME_SUNKEN, :padding => 0)
1304
1327
  @sites_tree = Watobo::Gui::SitesTree.new(frame, self, nil)
1305
1328
 
1306
- # @treeTabbook.connect(SEL_COMMAND) { |sender, sel, item|
1307
- # case item
1308
- # when 0
1329
+ @treeTabbook.connect(SEL_COMMAND) { |sender, sel, item|
1330
+ case item
1331
+ when 0
1332
+ # @chatTable.apply_filter @conversation_table_ctrl.filter_settings
1333
+ update_conversation_table(@project)
1309
1334
  # if @project
1310
1335
  # @project.settings.delete(:site_filter)
1311
1336
  # updateRequestTable(@project)
1312
1337
  #end
1313
- # end
1314
- # }
1338
+ end
1339
+ }
1315
1340
  subscribeFindingsTree()
1316
1341
  subscribeSitesTree()
1317
1342
 
@@ -1440,10 +1465,11 @@ module Watobo
1440
1465
  addToLogin = FXMenuCommand.new(menu_pane, "Add to Login-Script" )
1441
1466
  addToLogin.connect(SEL_COMMAND) {
1442
1467
  @project.add_login_chat_id(chatid)
1443
- saveSessionSettings(@project)
1468
+ puts "Add to Login-Script ... saveSessionSettings (#{@project.class})"
1469
+ Watobo::Gui.save_settings()
1444
1470
  }
1445
1471
 
1446
- target = FXMenuCheck.new(menu_pane, "Mark as tested" )
1472
+ target = FXMenuCheck.new(menu_pane, "Tested" )
1447
1473
  target.check = chat.tested?
1448
1474
  target.connect(SEL_COMMAND) {
1449
1475
  chat.tested = target.checked?()
@@ -1634,7 +1660,8 @@ module Watobo
1634
1660
 
1635
1661
  @sites_tree.subscribe(:show_conversation){ |chat_list|
1636
1662
  showConversation()
1637
- @chatTable.showConversation(chat_list)
1663
+ puts "SHOW_CONVERSATION: #{chat_list.length} chats"
1664
+ @chatTable.showConversation(chat_list, :ignore_filter)
1638
1665
  }
1639
1666
 
1640
1667
  @sites_tree.subscribe(:show_chat){ |chat|
@@ -1684,12 +1711,12 @@ module Watobo
1684
1711
  end
1685
1712
  end
1686
1713
 
1687
- def loadProjectSettings(filename=nil)
1714
+ def loadProjectSettings_UNUSED(filename=nil)
1688
1715
  settings = nil
1689
1716
  if filename then
1690
1717
  begin
1691
1718
  settings = Hash.new
1692
- settings = Watobo::Utils.loadSettings(filename)
1719
+ settings = Watobo::Utils.load_settings(filename)
1693
1720
  # puts settings.to_yaml
1694
1721
  rescue => bang
1695
1722
  puts "!!!ERROR: could not update project settings"
@@ -1700,12 +1727,12 @@ module Watobo
1700
1727
  return settings
1701
1728
  end
1702
1729
 
1703
- def loadSessionSettings(filename=nil)
1730
+ def loadSessionSettings_UNUSED(filename=nil)
1704
1731
  settings = {}
1705
1732
  return settings if filename.nil?
1706
1733
  if File.exist?(filename) then
1707
1734
  begin
1708
- settings = Watobo::Utils.loadSettings(filename)
1735
+ settings = Watobo::Utils.load_settings(filename)
1709
1736
  rescue => bang
1710
1737
  puts "!!!ERROR: could not load session settings"
1711
1738
  puts bang
@@ -1770,9 +1797,10 @@ module Watobo
1770
1797
  @project.setProxyOptions(YAML.load(YAML.dump(proxy_prefs)))
1771
1798
  puts "* current proxy:\n> #{@project.getCurrentProxy()}" if $DEBUG
1772
1799
 
1773
- Watobo::Gui.save_default_settings(@project)
1800
+ # Watobo::Gui.save_default_settings(@project)
1774
1801
 
1775
- saveProjectSettings(@project)
1802
+ # saveProjectSettings(@project)
1803
+ Watobo::Gui.save_settings()
1776
1804
 
1777
1805
  update_status_bar(@project)
1778
1806
  #puts "* current proxy:\n> #{@project.getCurrentProxy().to_yaml}"
@@ -400,10 +400,10 @@ module Watobo
400
400
  second_request = Watobo::Utils.copyObject(@second_selection.request)
401
401
  second_response = Watobo::Utils.copyObject(@second_selection.response)
402
402
 
403
- orig = Watobo::Chat.new(first_request, first_response, :id => 0)
404
- new = Watobo::Chat.new(second_request, second_response, :id => 0)
403
+ chat_one = Watobo::Chat.new(first_request, first_response, :id => 0)
404
+ chat_two = Watobo::Chat.new(second_request, second_response, :id => 0)
405
405
  project = nil
406
- diffViewer = ChatDiffViewer.new(FXApp.instance, orig, new)
406
+ diffViewer = ChatDiffViewer.new(FXApp.instance, chat_one, chat_two)
407
407
  diffViewer.create
408
408
  diffViewer.show(Fox::PLACEMENT_SCREEN)
409
409
  end
@@ -684,6 +684,10 @@ module Watobo
684
684
  @responseFilter = FXDataTarget.new("")
685
685
 
686
686
  @chat = chat
687
+
688
+ if chat.respond_to? :request
689
+ self.title = "Manual Request Toolkit - #{chat.request.url}"
690
+ end
687
691
 
688
692
  @original_request = chat.copyRequest
689
693