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
data/CHANGELOG CHANGED
@@ -1,3 +1,18 @@
1
+ = Version 0.9.9.pre1
2
+ == NEW
3
+ * Time-based SQL injection module
4
+ * new XSS module which gives a more accurate exploitability result
5
+ * ConversationTable: values in coloumn Parameters are url-decoded
6
+ * Added a WebCrawler Plugin based on Mechanize
7
+ * Manual Request Editor: Url is displayed in the window title
8
+
9
+ == Fixes
10
+ * CA Directory is now created in WATOBO working directory '.watobo'
11
+ * Fixed Crash on opening client-certificate dialog
12
+ * ConversationTable: GET and POST parameters are shown in the parameters coloumn
13
+ * TreeView-Pane: Show full conversation list when Findings tab is selected
14
+ * smaller fixes
15
+
1
16
  = Version 0.9.8
2
17
  == NEW
3
18
  * Ruby 1.9 Support - no more 1.8 don't even try it ;)
@@ -13,6 +28,8 @@
13
28
  * GUI: purge (multiple) findings is possibel via FindingsTree
14
29
 
15
30
  == Fixes
31
+ * interceptor reset-button
32
+ * Constant declarations
16
33
  * lib/mixin/request_parser.rb: fixed file handling
17
34
  * fixed pattern for detecting file upload fields
18
35
  * optimized "tagless" view
data/bin/watobo CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/bin/ruby
2
- puts "Please use the command watobo_gui.rb to start watobo."
2
+ puts "Please use the command watobo_gui.rb to start watobo."
@@ -48,28 +48,28 @@ module Watobo
48
48
  end
49
49
 
50
50
  end
51
-
51
+
52
52
  def delete_finding(finding)
53
53
  finding_file = File.join("#{@findings_path}", "#{finding.id}-finding")
54
54
  File.delete finding_file if File.exist? finding_file
55
-
55
+
56
56
  end
57
-
57
+
58
58
  def update_finding(finding)
59
59
  finding_file = File.join("#{@findings_path}", "#{finding.id}-finding")
60
- finding_data = {
61
- :request => finding.request.map{|x| x.inspect},
62
- :response => finding.response.map{|x| x.inspect},
63
- :details => Hash.new
64
- }
65
- finding_data[:details].update(finding.details)
60
+ finding_data = {
61
+ :request => finding.request.map{|x| x.inspect},
62
+ :response => finding.response.map{|x| x.inspect},
63
+ :details => Hash.new
64
+ }
65
+ finding_data[:details].update(finding.details)
66
+
67
+ if File.exists?(finding_file) then
68
+ fh = File.new(finding_file, "w+b")
69
+ fh.print YAML.dump(finding_data)
70
+ fh.close
71
+ end
66
72
 
67
- if File.exists?(finding_file) then
68
- fh = File.new(finding_file, "w+b")
69
- fh.print YAML.dump(finding_data)
70
- fh.close
71
- end
72
-
73
73
  end
74
74
 
75
75
  # add_scan_log
@@ -79,23 +79,23 @@ module Watobo
79
79
  def add_scan_log(chat, scan_name = nil)
80
80
  begin
81
81
  return false if scan_name.nil?
82
- puts ">> scan_name"
82
+ # puts ">> scan_name"
83
83
  path = File.join(@scanlog_path, scan_name)
84
-
84
+
85
85
  Dir.mkdir path unless File.exist? path
86
-
86
+
87
87
  log_file = File.join( path, "log_" + Time.now.to_f.to_s)
88
88
 
89
89
  chat_data = {
90
90
  :request => chat.request.map{|x| x.inspect},
91
91
  :response => chat.response.map{|x| x.inspect},
92
92
  }
93
- puts log_file
93
+ # puts log_file
94
94
  chat_data.update(chat.settings)
95
95
  File.open(log_file, "w") { |fh|
96
96
  YAML.dump(chat_data, fh)
97
97
  }
98
- return true
98
+ return true
99
99
  rescue => bang
100
100
  puts bang
101
101
  puts bang.backtrace if $DEBUG
@@ -135,34 +135,40 @@ module Watobo
135
135
  end
136
136
  end
137
137
 
138
-
139
-
140
138
  def initialize(project_name, session_name)
141
139
 
142
140
  wsp = Watobo.workspace_path
143
141
  return false unless File.exist? wsp
144
142
  puts "* using workspace path: #{wsp}" if $DEBUG
145
- project_path = File.join(wsp, project_name)
146
- unless File.exist? project_path
147
- puts "* create project path: #{project_path}" if $DEBUG
148
- Dir.mkdir(project_path)
143
+ @project_path = File.join(wsp, project_name)
144
+ unless File.exist? @project_path
145
+ puts "* create project path: #{@project_path}" if $DEBUG
146
+ Dir.mkdir(@project_path)
149
147
  end
150
- session_path = File.join(project_path, session_name)
151
148
 
152
- unless File.exist? session_path
153
- puts "* create session path: #{session_path}" if $DEBUG
154
- Dir.mkdir(session_path)
149
+ @project_config_path = File.join(@project_path, "config")
150
+ Dir.mkdir @project_config_path unless File.exist? @project_config_path
151
+
152
+ @session_path = File.join(@project_path, session_name)
153
+
154
+ unless File.exist? @session_path
155
+ puts "* create session path: #{@session_path}" if $DEBUG
156
+ Dir.mkdir(@session_path)
155
157
  end
158
+
159
+ @session_config_path = File.join(@session_path, "config")
160
+ Dir.mkdir @session_config_path unless File.exist? @session_config_path
161
+
156
162
  sext = Watobo::Conf::General.session_settings_file_ext
157
-
158
- @session_file = File.join(session_path, session_name + sext)
159
- @project_file = File.join(project_path, project_name + Watobo::Conf::General.project_settings_file_ext)
160
163
 
161
- @conversation_path = File.expand_path(File.join(session_path, Watobo::Conf::Datastore.conversations))
164
+ @session_file = File.join(@session_path, session_name + sext)
165
+ @project_file = File.join(@project_path, project_name + Watobo::Conf::General.project_settings_file_ext)
162
166
 
163
- @findings_path = File.expand_path(File.join(session_path, Watobo::Conf::Datastore.findings))
164
- @log_path = File.expand_path(File.join(session_path, Watobo::Conf::Datastore.event_logs_dir))
165
- @scanlog_path = File.expand_path(File.join(session_path, Watobo::Conf::Datastore.scan_logs_dir))
167
+ @conversation_path = File.expand_path(File.join(@session_path, Watobo::Conf::Datastore.conversations))
168
+
169
+ @findings_path = File.expand_path(File.join(@session_path, Watobo::Conf::Datastore.findings))
170
+ @log_path = File.expand_path(File.join(@session_path, Watobo::Conf::Datastore.event_logs_dir))
171
+ @scanlog_path = File.expand_path(File.join(@session_path, Watobo::Conf::Datastore.scan_logs_dir))
166
172
 
167
173
  [ @conversation_path, @findings_path, @log_path, @scanlog_path ].each do |folder|
168
174
  if not File.exists?(folder) then
@@ -183,29 +189,64 @@ module Watobo
183
189
  # @finding_files = get_file_list(@findings_path, "*-finding")
184
190
  end
185
191
 
186
-
187
- def save_session_settings(session_settings)
188
-
192
+ def save_session_settings(group, session_settings)
193
+ # puts ">> save_session_settings <<"
194
+ file = Watobo::Utils.snakecase group.gsub(/\.yml/,'')
195
+ file << ".yml"
196
+
197
+ session_file = File.join(@session_config_path, file)
198
+ # puts "Dest.File: #{session_file}"
199
+ # puts session_settings.to_yaml
200
+ # puts "---"
201
+ Watobo::Utils.save_settings(session_file, session_settings)
189
202
  end
190
-
191
- def load_session_settings()
192
-
203
+
204
+ def load_session_settings(group)
205
+ # puts ">> load_session_settings : #{group}"
206
+ file = Watobo::Utils.snakecase group.gsub(/\.yml/,'')
207
+ file << ".yml"
208
+
209
+ session_file = File.join(@session_config_path, file)
210
+ # puts "File: #{session_file}"
211
+ # puts "---"
212
+
213
+ s = Watobo::Utils.load_settings(session_file)
214
+ s
193
215
  end
194
-
195
- def save_project_settings(project_settings)
196
-
216
+
217
+ def save_project_settings(group, project_settings)
218
+ # puts ">> save_project_settings : #{group}"
219
+ file = Watobo::Utils.snakecase group.gsub(/\.yml/,'')
220
+ file << ".yml"
221
+
222
+ project_file = File.join(@project_config_path, file)
223
+ # puts "Dest.File: #{project_file}"
224
+ # puts project_settings.to_yaml
225
+ # puts "---"
226
+ Watobo::Utils.save_settings(project_file, project_settings)
227
+
197
228
  end
198
-
199
- def load_project_settings()
200
-
229
+
230
+ def load_project_settings(group)
231
+ # puts ">> load_project_settings : #{group}"
232
+ file = Watobo::Utils.snakecase group.gsub(/\.yml/,'')
233
+ file << ".yml"
234
+
235
+ project_file = File.join(@project_config_path, file)
236
+ # puts "File: #{project_file}"
237
+ # puts "---"
238
+
239
+ s = Watobo::Utils.load_settings(project_file)
240
+ s
241
+
201
242
  end
202
-
243
+
203
244
  private
204
-
245
+
205
246
  def get_file_list(path, pattern)
206
247
  Dir["#{path}/#{pattern}"].sort_by{ |x| File.basename(x).sub(/[^0-9]*/,'').to_i }
207
248
  end
208
-
249
+
209
250
  end
210
251
 
211
252
  end
data/lib/watobo/config.rb CHANGED
@@ -25,21 +25,35 @@ module Watobo
25
25
  @@settings = Hash.new
26
26
  @count = 0
27
27
  @@modules = []
28
+
28
29
  def self.each(&b)
29
30
  @@modules.each do |m|
30
31
  yield m if block_given?
31
32
  end
32
33
  @@modules.length
33
34
  end
35
+
36
+ def self.load_project_settings(data_store)
37
+ @@modules.each do |m|
38
+ m.load_project(data_store)
39
+ end
40
+ end
41
+
42
+ def self.load_session_settings(data_store)
43
+ @@modules.each do |m|
44
+ m.load_session(data_store)
45
+ end
46
+ end
34
47
 
35
48
  def self.add(group, settings)
36
49
  # puts "* create new configuration for #{group}"
37
50
 
38
- module_eval("module #{group}; @settings = #{settings} end")
51
+ module_eval("module #{group}; @settings = #{settings}; end")
39
52
  m = const_get(group)
40
53
  m.module_eval do
41
54
  def self.to_file
42
- n = self.to_s.gsub(/(Watobo)?::/, "/").gsub(/([A-Z])([A-Z][a-z])/, '\1_\2').gsub(/([a-z\d])([A-Z])/, '\1_\2').tr("-","_").downcase
55
+ # n = self.to_s.gsub(/(Watobo)?::/, "/").gsub(/([A-Z])([A-Z][a-z])/, '\1_\2').gsub(/([a-z\d])([A-Z])/, '\1_\2').tr("-","_").downcase
56
+ n = Watobo::Utils.snakecase self.to_s.gsub(/(Watobo)?::/, "/")
43
57
  n << ".yml"
44
58
  end
45
59
 
@@ -54,32 +68,94 @@ module Watobo
54
68
  puts "! [#{self}] could not update settings from file #{file}" if $DEBUG
55
69
  end
56
70
  end
71
+
72
+ # returns the group name of the module
73
+ # e.g. the group name of Watobo::Conf::Interceptor would be Interceptor
74
+ def self.group_name
75
+ self.to_s.gsub(/.*::/,"")
76
+ end
57
77
 
58
78
  def self.set(settings)
59
79
  return false unless settings.is_a? Hash
60
80
  @settings = YAML.load(YAML.dump(settings))
61
81
  end
62
82
 
63
- def self.save(path=nil, &b)
83
+ def self.save_session(data_store, *filter, &b)
84
+ raise ArgumentError, "Need a valid Watobo::DataStore" unless data_store.respond_to? :save_project_settings
85
+ s = filter_settings filter
86
+ yield s if block_given?
87
+ # puts group_name
88
+ data_store.save_session_settings( group_name, s )
89
+ end
90
+
91
+ def self.save_project(data_store, *filter, &b)
92
+ raise ArgumentError, "Need a valid Watobo::DataStore" unless data_store.respond_to? :save_project_settings
93
+ s = filter_settings filter
94
+ data_store.save_project_settings(group_name, s)
95
+ end
96
+
97
+ def self.load_session(data_store, prefs={}, &b)
98
+ raise ArgumentError, "Need a valid Watobo::DataStore" unless data_store.respond_to? :load_project_settings
99
+
100
+ p = { :update => true }
101
+ p.update prefs
102
+
103
+ s = data_store.load_session_settings(group_name)
104
+ return false if s.nil?
105
+
106
+ if p[:update] == true
107
+ @settings.update s
108
+ else
109
+ @settings = s
110
+ end
111
+ end
112
+
113
+ def self.load_project(data_store, prefs={}, &b)
114
+ raise ArgumentError, "Need a valid Watobo::DataStore" unless data_store.respond_to? :load_project_settings
115
+
116
+ p = { :update => true }
117
+ p.update prefs
118
+
119
+ s = data_store.load_project_settings(group_name)
120
+ return false if s.nil?
121
+
122
+ if p[:update] == true
123
+ @settings.update s
124
+ else
125
+ @settings = s
126
+ end
127
+ end
128
+
129
+ def self.filter_settings(f)
130
+ s = YAML.load(YAML.dump(@settings))
131
+
132
+ if f.length > 0
133
+ s.each_key do |k|
134
+ s.delete k unless f.include? k
135
+ end
136
+ end
137
+ s
138
+ end
139
+
140
+ def self.save(path=nil, *filter, &b)
64
141
 
65
142
  n = self.to_file
66
143
  p = Conf::General.working_directory
67
144
  unless path.nil?
68
145
  if File.exist? path
69
- p = path
146
+ p = path
70
147
  end
71
- end
148
+ end
72
149
 
73
150
  file = File.join( p, n )
74
151
 
75
- s = YAML.load(YAML.dump(@settings))
76
- s.each_pair do |k,v|
77
- yield k,v if block_given?
78
- end
152
+ s = filter_settings filter
153
+
154
+ yield s if block_given?
79
155
 
80
156
  if File.exist?(File.dirname(file))
81
- puts "* save config #{self} to: #{file}"
82
- puts s.to_yaml
157
+ # puts "* save config #{self} to: #{file}"
158
+ # puts s.to_yaml
83
159
  File.open(file, "w") { |fh|
84
160
  YAML.dump(s, fh)
85
161
  }
@@ -113,7 +189,9 @@ module Watobo
113
189
  end
114
190
  end
115
191
 
116
- def self.included(clazz)
192
+ # TODO: create a class-instance of the module itself, so it can be referenced like @scanner.scope
193
+ # before creating the reference also check if there's another class-instance variable with the same name
194
+ def self.included_UNUSED(clazz)
117
195
  puts "* #{self} gets included into #{clazz}"
118
196
  @settings.each_key do |k|
119
197
  puts "* add method for #{k}"
@@ -111,12 +111,12 @@ module Watobo
111
111
 
112
112
  def postParmNames(chat)
113
113
  pnames = chat.request.post_parm_names
114
+ return pnames unless @settings.has_key? :excluded_parms
115
+ return pnames unless @settings[:excluded_parms].is_a? Array
114
116
  begin
115
- @settings[:excluded_parms].each do |p|
116
- pnames.delete(p)
117
- end
117
+ pnames.select!{|p| !@settings[:excluded_parms].include? p }
118
118
  rescue => bang
119
- puts "! settings 'excluded_parms' missing !"
119
+ #puts "! settings 'excluded_parms' missing !"
120
120
  # puts @project.settings.to_yaml
121
121
  puts bang
122
122
  puts bang.backtrace if $DEBUG
@@ -247,6 +247,10 @@ module Watobo
247
247
  end
248
248
  return false, nil, nil
249
249
  end
250
+
251
+ def log_console(msg)
252
+ puts "[#{Module.nesting[0].name}] #{msg}"
253
+ end
250
254
 
251
255
  # +++ run_checks +++
252
256
  # + function: wrapper function for doRequest(r). Needed for additional checks like smartchecks.
@@ -32,11 +32,11 @@ module Watobo
32
32
  bytes_read = 0
33
33
  while max_bytes < 0 or bytes_to_read > 0
34
34
  begin
35
- timeout(5) do
35
+ # timeout(5) do
36
36
  # puts "<#{bytes_to_read} / #{bytes_read} / #{max_bytes}"
37
37
  buf = socket.readpartial(bytes_to_read)
38
38
  bytes_read += buf.length
39
- end
39
+ # end
40
40
  rescue EOFError
41
41
  return
42
42
  rescue Timeout::Error
@@ -63,19 +63,19 @@ module Watobo
63
63
  while (chunk_size = socket.gets)
64
64
  next if chunk_size.strip.empty?
65
65
  yield "#{chunk_size}" if block_given?
66
- num_bytes = chunk_size.strip.hex
66
+ bytes_to_read = num_bytes = chunk_size.strip.hex
67
67
  # puts "> chunk-length: 0x#{chunk_size.strip}(#{num_bytes})"
68
68
  return if num_bytes == 0
69
69
  bytes_read = 0
70
70
  while bytes_read < num_bytes
71
71
  begin
72
- timeout(5) do
72
+ # timeout(5) do
73
73
  bytes_to_read = num_bytes - bytes_read
74
74
  # puts bytes_to_read.to_s
75
75
  buf = socket.readpartial(bytes_to_read)
76
76
  bytes_read += buf.length
77
77
  # puts bytes_read.to_s
78
- end
78
+ # end
79
79
  rescue EOFError
80
80
  # yield buf if buf
81
81
  return
@@ -34,8 +34,7 @@ module Watobo
34
34
  # include Watobo::Conf::Interceptor
35
35
 
36
36
  attr :port
37
-
38
-
37
+
39
38
  attr_accessor :mode
40
39
 
41
40
  attr_accessor :contentLength
@@ -43,11 +42,10 @@ module Watobo
43
42
  attr_accessor :target
44
43
  attr_accessor :www_auth
45
44
  attr_accessor :client_certificates
46
-
47
45
  def server
48
46
  @bind_addr
49
47
  end
50
-
48
+
51
49
  def subscribe(event, &callback)
52
50
  (@event_dispatcher_listeners[event] ||= []) << callback
53
51
  end
@@ -188,13 +186,19 @@ module Watobo
188
186
 
189
187
  #p "getHTTPHeader"
190
188
  #s_sock, req, resp = @sender.getHTTPHeader(request, :update_sids => true, :update_session => false, :update_contentlength => true)
189
+ begin
191
190
  s_sock, req, resp = @sender.sendHTTPRequest(request, :update_sids => true, :update_session => false, :update_contentlength => true, :www_auth => @www_auth, :client_certificates => @client_certificates)
192
-
193
191
  if s_sock.nil? then
194
192
  c_sock.print resp.join unless resp.nil?
195
193
  closeSocket(c_sock)
196
194
  next
197
195
  end
196
+ rescue => bang
197
+ puts bang
198
+ puts bang.backtrace if $DEBUG
199
+ closeSocket(c_sock)
200
+ next
201
+ end
198
202
 
199
203
  # check if response should be passed throug
200
204
  Thread.current.exit if isPassThrough?(req, resp, s_sock, c_sock)
@@ -254,6 +254,15 @@ module Watobo
254
254
  def projectSettingsFile
255
255
  @project_file
256
256
  end
257
+
258
+ def session_settings()
259
+ s = YAML.load(YAML.dump(scan_settings))
260
+ sf = [:logout_signatures, :non_unique_parms, :login_chat_ids, :excluded_chats, :csrf_request_ids, :scope ]
261
+ s.each_key do |k|
262
+ s.delete k unless sf.include? k
263
+ end
264
+ s
265
+ end
257
266
 
258
267
  def getLoginChats()
259
268
  @scan_settings[:login_chat_ids] ||= []
@@ -625,10 +634,14 @@ module Watobo
625
634
  }
626
635
  options.update opts
627
636
  # puts "* add finding #{finding.details[:fid]}" if $DEBUG
637
+
638
+ @findings_count ||= Hash.new
639
+ @findings_count[finding.details[:class]] = 0 unless @findings_count.has_key? finding.details[:class]
628
640
 
629
- unless @findings.has_key?(finding.details[:fid])
641
+ unless @findings.has_key?(finding.details[:fid]) or @findings_count[finding.details[:class]] > 100
630
642
  begin
631
643
  @findings[finding.details[:fid]] = finding
644
+ @findings_count[finding.details[:class]] += 1
632
645
  #@interface.addFinding(new_finding)
633
646
  # puts "* new finding"
634
647
  notify(:new_finding, finding) if options[:notify] == true
@@ -639,6 +652,8 @@ module Watobo
639
652
  puts bang
640
653
  puts bang.backtrace if $DEBUG
641
654
  end
655
+ else
656
+ puts "Skip finding <#{finding.details[:class]}>"
642
657
  end
643
658
  end
644
659
 
@@ -25,7 +25,8 @@ module Watobo
25
25
  # puts "* loading defaults from #{config_path}"
26
26
  Dir.glob("#{config_path}/*.yml").each do |cf|
27
27
  dummy = File.basename(cf).gsub!(/.yml/,'')
28
- cc = dummy.strip.gsub(/[^[a-zA-Z\-_]]/,"").gsub( "-" , "_").split("_").map{ |s| s.downcase.capitalize }.join
28
+ #cc = dummy.strip.gsub(/[^[a-zA-Z\-_]]/,"").gsub( "-" , "_").split("_").map{ |s| s.downcase.capitalize }.join
29
+ cc = Watobo::Utils.camelcase dummy
29
30
  begin
30
31
  settings = YAML.load_file(cf)
31
32
  Watobo::Conf.add(cc, settings )
@@ -25,4 +25,4 @@ require 'watobo/external/diff/lcs/callbacks'
25
25
  require 'watobo/external/diff/lcs/block'
26
26
  require 'watobo/external/diff/lcs/change'
27
27
 
28
- require 'watobo/external/ntlm/ntlm'
28
+ #require 'watobo/external/ntlm/ntlm'
@@ -20,6 +20,9 @@
20
20
  # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
21
  # .
22
22
  module Watobo
23
+ def self.project
24
+ @project
25
+ end
23
26
  # create_project is a wrapper function to create a new project
24
27
  # you can either create a project by giving a URL (:url),
25
28
  # or by giving a :project_name AND a :session_name
@@ -35,6 +38,11 @@ module Watobo
35
38
  end
36
39
 
37
40
  ds = Watobo::DataStore.aquire(project_settings[:project_name], project_settings[:session_name])
41
+
42
+ # updating settings
43
+ Watobo::Conf.load_project_settings(ds)
44
+ Watobo::Conf.load_session_settings(ds)
45
+
38
46
  project_settings[:session_store] = ds
39
47
 
40
48
  puts "= initialize passive checks ="
@@ -49,8 +57,8 @@ module Watobo
49
57
  puts "Total: " + project_settings[:active_checks].length.to_s
50
58
 
51
59
  project = Project.new(project_settings)
52
- @running_projects << project
53
- project
60
+ #@running_projects << project
61
+ @project = project
54
62
 
55
63
  end
56
64
 
@@ -26,7 +26,7 @@ module Watobo
26
26
  def createCertificate(sender, sel, ptr)
27
27
  @createButton.disable
28
28
 
29
- cadir = File.join(File.dirname($0), "CA")
29
+ cadir = File.join(Watobo.working_directory, "CA")
30
30
  crl_dir= File.join(cadir, "crl")
31
31
  hostname = "watobo"
32
32
  domainname = "watobo.local"
@@ -169,6 +169,7 @@ module Watobo
169
169
 
170
170
 
171
171
  def normalizeData(data)
172
+ raise ArgumentError, "Bad data type. Need Request/Response." unless data.respond_to? :headers
172
173
  dummy = []
173
174
  begin
174
175
  unless data.headers.nil?
@@ -178,8 +179,13 @@ module Watobo
178
179
 
179
180
  dummy.push ""
180
181
  end
182
+
183
+
181
184
  unless data.body.nil?
182
- data.body.split("\n").each do |l|
185
+ puts "> clean up body #{data.body.length}"
186
+ body = data.body.unpack("C*").pack("C*")
187
+ body.split("\n").each do |l|
188
+ # puts "[#{i}] #{l}"
183
189
  dummy.concat adjustLine(l)
184
190
  end
185
191
  end
@@ -188,7 +194,7 @@ module Watobo
188
194
  dummy = data
189
195
  end
190
196
  # puts dummy.join("\n")
191
- #return dummy.join("\n")
197
+ # return dummy.join("\n")
192
198
  return dummy
193
199
  end
194
200
 
@@ -258,6 +264,10 @@ module Watobo
258
264
  context_lines = 3
259
265
  raw_chunks = []
260
266
  collections = []
267
+ puts "[#{self}]"
268
+ puts "#{data_old.length} #{data_old.class}"
269
+ puts "#{data_new.length} #{data_new.class}"
270
+
261
271
  return collections if diffs.empty?
262
272
  oldhunk = hunk = nil
263
273
  file_length_difference = 0
@@ -394,6 +404,13 @@ module Watobo
394
404
  @normRequestNew = normalizeData(chat_new.request)
395
405
  @normResponseNew = normalizeData(chat_new.response)
396
406
 
407
+ puts "= normalized response (new)"
408
+ puts "#{@normResponseNew.length} #{@normResponseNew.class}"
409
+
410
+ puts "= normalized response (new)"
411
+ puts "#{@normResponseOrig.length} #{@normResponseOrig.class}"
412
+
413
+
397
414
  # diff normalized data
398
415
  @requestDiffs = Diff::LCS.diff( @normRequestOrig, @normRequestNew )
399
416
  @responseDiffs = Diff::LCS.diff( @normResponseOrig, @normResponseNew )
@@ -43,7 +43,7 @@ module Watobo
43
43
 
44
44
  @cert_path = nil
45
45
  @client_certificates = {}
46
- @client_certificates = project.getClientCertificates unless project.getClientCertificates.nil?
46
+ # @client_certificates = project.getClientCertificates unless project.getClientCertificates.nil?
47
47
  # puts client_certificates.to_yaml
48
48
 
49
49
  @password_policy.update prefs[:password_policy] if prefs.has_key? :password_policy