watobo 0.9.12 → 0.9.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (263) hide show
  1. data/.yardopts +2 -2
  2. data/{CHANGELOG → CHANGELOG.md} +62 -0
  3. data/README.md +30 -0
  4. data/bin/nfq_server.rb +4 -3
  5. data/bin/watobo_gui.rb +1 -1
  6. data/config/ott_cache.yml +4 -0
  7. data/config/scanner.yml +1 -18
  8. data/config/sid_cache.yml +14 -0
  9. data/extras/private-hostspot.sh +17 -0
  10. data/extras/watobo-installer.sh +61 -0
  11. data/extras/watobo-transparent.sh +38 -0
  12. data/icons/BestPractice_16x16.ico +0 -0
  13. data/icons/BestPractice_24x24.ico +0 -0
  14. data/lib/watobo/adapters/data_store.rb +25 -3
  15. data/lib/watobo/adapters/file/file_store.rb +19 -11
  16. data/lib/watobo/adapters/session_store.rb +3 -2
  17. data/lib/watobo/adapters.rb +1 -1
  18. data/lib/watobo/ca.rb +1 -1
  19. data/lib/watobo/config.rb +17 -19
  20. data/lib/watobo/constants.rb +3 -2
  21. data/lib/watobo/core/active_check.rb +62 -40
  22. data/lib/watobo/core/active_checks.rb +73 -0
  23. data/lib/watobo/core/ca.rb +3 -2
  24. data/lib/watobo/core/cert_store.rb +3 -2
  25. data/lib/watobo/core/chat.rb +122 -0
  26. data/lib/watobo/core/chats.rb +301 -0
  27. data/lib/watobo/core/conversation.rb +71 -0
  28. data/lib/watobo/core/cookie.rb +9 -25
  29. data/lib/watobo/core/finding.rb +89 -0
  30. data/lib/watobo/core/findings.rb +132 -0
  31. data/lib/watobo/core/forwarding_proxy.rb +4 -2
  32. data/lib/watobo/core/fuzz_gen.rb +3 -2
  33. data/lib/watobo/core/intercept_carver.rb +24 -12
  34. data/lib/watobo/core/intercept_filter.rb +4 -3
  35. data/lib/watobo/core/interceptor.rb +9 -888
  36. data/lib/watobo/core/min_class.rb +27 -0
  37. data/lib/watobo/core/netfilter_queue.rb +3 -2
  38. data/lib/watobo/core/ott_cache.rb +156 -0
  39. data/lib/watobo/core/parameter.rb +66 -0
  40. data/lib/watobo/core/passive_check.rb +15 -22
  41. data/lib/watobo/core/passive_checks.rb +72 -0
  42. data/lib/watobo/core/passive_scanner.rb +69 -0
  43. data/lib/watobo/core/plugin.rb +33 -0
  44. data/lib/watobo/core/project.rb +40 -547
  45. data/lib/watobo/core/proxy.rb +7 -2
  46. data/lib/watobo/core/request.rb +95 -10
  47. data/lib/watobo/core/response.rb +44 -3
  48. data/lib/watobo/core/scanner.rb +6 -7
  49. data/lib/watobo/core/scanner3.rb +439 -0
  50. data/lib/watobo/core/scope.rb +106 -0
  51. data/lib/watobo/core/session.rb +106 -286
  52. data/lib/watobo/core/sid_cache.rb +121 -0
  53. data/lib/watobo/core/subscriber.rb +48 -0
  54. data/lib/watobo/core.rb +2 -2
  55. data/lib/watobo/defaults.rb +3 -2
  56. data/lib/watobo/external/diff/lcs/array.rb +1 -1
  57. data/lib/watobo/external/diff/lcs/block.rb +1 -1
  58. data/lib/watobo/external/diff/lcs/callbacks.rb +1 -1
  59. data/lib/watobo/external/diff/lcs/change.rb +1 -1
  60. data/lib/watobo/external/diff/lcs/hunk.rb +1 -1
  61. data/lib/watobo/external/diff/lcs/ldiff.rb +1 -1
  62. data/lib/watobo/external/diff/lcs/string.rb +1 -1
  63. data/lib/watobo/external/diff/lcs.rb +1 -1
  64. data/lib/watobo/external/ntlm/ntlm.rb +1 -1
  65. data/lib/watobo/externals.rb +1 -1
  66. data/lib/watobo/framework/create_project.rb +19 -12
  67. data/lib/watobo/framework/init.rb +4 -3
  68. data/lib/watobo/framework/init_modules.rb +32 -3
  69. data/lib/watobo/framework/license_text.rb +3 -2
  70. data/lib/watobo/framework/load_chat.rb +36 -0
  71. data/lib/watobo/framework.rb +2 -2
  72. data/lib/watobo/gui/about_watobo.rb +3 -2
  73. data/lib/watobo/gui/browser_preview.rb +4 -3
  74. data/lib/watobo/gui/certificate_dialog.rb +3 -2
  75. data/lib/watobo/gui/chat_diff.rb +6 -14
  76. data/lib/watobo/gui/chatviewer_frame.rb +30 -5
  77. data/lib/watobo/gui/checkboxtree.rb +13 -12
  78. data/lib/watobo/gui/checks_policy_frame.rb +8 -10
  79. data/lib/watobo/gui/client_cert_dialog.rb +8 -6
  80. data/lib/watobo/gui/confirm_scan_dialog.rb +5 -3
  81. data/lib/watobo/gui/conversation_table.rb +288 -51
  82. data/lib/watobo/gui/conversation_table_ctrl.rb +36 -3
  83. data/lib/watobo/gui/conversation_table_ctrl2.rb +416 -0
  84. data/lib/watobo/gui/csrf_token_dialog.rb +25 -33
  85. data/lib/watobo/gui/dashboard.rb +47 -45
  86. data/lib/watobo/gui/define_scope_frame.rb +27 -22
  87. data/lib/watobo/gui/differ_frame.rb +238 -0
  88. data/lib/watobo/gui/edit_comment.rb +3 -2
  89. data/lib/watobo/gui/edit_scope_dialog.rb +7 -6
  90. data/lib/watobo/gui/finding_info.rb +3 -2
  91. data/lib/watobo/gui/findings_tree.rb +101 -26
  92. data/lib/watobo/gui/full_scan_dialog.rb +5 -6
  93. data/lib/watobo/gui/fuzzer_gui.rb +51 -18
  94. data/lib/watobo/gui/goto_url_dialog.rb +92 -0
  95. data/lib/watobo/gui/hex_viewer.rb +16 -5
  96. data/lib/watobo/gui/html_viewer.rb +309 -0
  97. data/lib/watobo/gui/intercept_filter_dialog.rb +3 -2
  98. data/lib/watobo/gui/interceptor_gui.rb +5 -4
  99. data/lib/watobo/gui/interceptor_settings_dialog.rb +4 -3
  100. data/lib/watobo/gui/list_box.rb +4 -3
  101. data/lib/watobo/gui/log_file_viewer.rb +55 -0
  102. data/lib/watobo/gui/log_viewer.rb +3 -82
  103. data/lib/watobo/gui/login_wizzard.rb +3 -3
  104. data/lib/watobo/gui/main_window.rb +183 -164
  105. data/lib/watobo/gui/manual_request_editor.rb +157 -642
  106. data/lib/watobo/gui/master_pw_dialog.rb +3 -2
  107. data/lib/watobo/gui/mixins/gui_settings.rb +3 -2
  108. data/lib/watobo/gui/page_tree.rb +3 -2
  109. data/lib/watobo/gui/password_policy_dialog.rb +3 -2
  110. data/lib/watobo/gui/plugin_board.rb +103 -73
  111. data/lib/watobo/gui/preferences_dialog.rb +3 -2
  112. data/lib/watobo/gui/progress_window.rb +3 -2
  113. data/lib/watobo/gui/project_wizzard.rb +3 -2
  114. data/lib/watobo/gui/proxy_dialog.rb +3 -2
  115. data/lib/watobo/gui/quick_scan_dialog.rb +17 -32
  116. data/lib/watobo/gui/request_builder_frame.rb +134 -0
  117. data/lib/watobo/gui/request_editor.rb +14 -9
  118. data/lib/watobo/gui/rewrite_filters_dialog.rb +4 -3
  119. data/lib/watobo/gui/rewrite_rules_dialog.rb +4 -3
  120. data/lib/watobo/gui/save_chat_dialog.rb +7 -3
  121. data/lib/watobo/gui/scanner_settings_dialog.rb +4 -3
  122. data/lib/watobo/gui/select_chat_dialog.rb +15 -25
  123. data/lib/watobo/gui/session_management_dialog.rb +21 -25
  124. data/lib/watobo/gui/sites_tree.rb +5 -4
  125. data/lib/watobo/gui/status_bar.rb +3 -2
  126. data/lib/watobo/gui/table_editor.rb +398 -386
  127. data/lib/watobo/gui/tagless_viewer.rb +3 -2
  128. data/lib/watobo/gui/templates/plugin.rb +3 -2
  129. data/lib/watobo/gui/templates/plugin2.rb +4 -3
  130. data/lib/watobo/gui/templates/plugin_base.rb +168 -0
  131. data/lib/watobo/gui/text_viewer.rb +49 -3
  132. data/lib/watobo/gui/transcoder_window.rb +3 -2
  133. data/lib/watobo/gui/utils/gui_utils.rb +5 -4
  134. data/lib/watobo/gui/utils/init_icons.rb +5 -2
  135. data/lib/watobo/gui/utils/load_icons.rb +3 -2
  136. data/lib/watobo/gui/utils/load_plugins.rb +22 -5
  137. data/lib/watobo/gui/utils/master_password.rb +3 -2
  138. data/lib/watobo/gui/utils/save_default_settings.rb +7 -5
  139. data/lib/watobo/gui/utils/save_project_settings.rb +1 -1
  140. data/lib/watobo/gui/utils/save_proxy_settings.rb +4 -3
  141. data/lib/watobo/gui/utils/save_scanner_settings.rb +5 -4
  142. data/lib/watobo/gui/utils/session_history.rb +3 -2
  143. data/lib/watobo/gui/workspace_dialog.rb +3 -2
  144. data/lib/watobo/gui/www_auth_dialog.rb +4 -3
  145. data/lib/watobo/gui/xml_viewer_frame.rb +3 -2
  146. data/lib/watobo/gui.rb +6 -3
  147. data/lib/watobo/http/cookies/cookies.rb +66 -0
  148. data/lib/watobo/http/data/data.rb +68 -0
  149. data/lib/watobo/{gui/mixins/subscriber.rb → http/url/url.rb} +33 -19
  150. data/lib/watobo/http_socket/agent.rb +851 -0
  151. data/lib/watobo/http_socket/client_socket.rb +290 -0
  152. data/lib/watobo/http_socket/connection.rb +423 -0
  153. data/lib/watobo/http_socket/http_socket.rb +273 -0
  154. data/lib/watobo/http_socket/ntlm_auth.rb +152 -0
  155. data/lib/watobo/http_socket/proxy.rb +31 -0
  156. data/lib/watobo/http_socket.rb +25 -0
  157. data/lib/watobo/interceptor/proxy.rb +883 -0
  158. data/lib/watobo/interceptor/transparent.rb +37 -0
  159. data/lib/watobo/interceptor.rb +25 -0
  160. data/lib/watobo/mixins/check_info.rb +50 -0
  161. data/lib/watobo/mixins/httpparser.rb +92 -20
  162. data/lib/watobo/mixins/request_parser.rb +103 -88
  163. data/lib/watobo/mixins/shapers.rb +42 -11
  164. data/lib/watobo/mixins/transcoders.rb +61 -57
  165. data/lib/watobo/mixins.rb +3 -2
  166. data/lib/watobo/parser/html.rb +106 -0
  167. data/lib/watobo/parser.rb +22 -0
  168. data/lib/watobo/utils/check_regex.rb +3 -2
  169. data/lib/watobo/utils/copy_object.rb +3 -2
  170. data/lib/watobo/utils/crypto.rb +3 -2
  171. data/lib/watobo/utils/expand_range.rb +3 -2
  172. data/lib/watobo/utils/file_management.rb +7 -3
  173. data/lib/watobo/utils/hexprint.rb +3 -2
  174. data/lib/watobo/utils/load_chat.rb +4 -3
  175. data/lib/watobo/utils/load_icon.rb +3 -2
  176. data/lib/watobo/utils/print_debug.rb +3 -2
  177. data/lib/watobo/utils/response_builder.rb +6 -4
  178. data/lib/watobo/utils/response_hash.rb +66 -49
  179. data/lib/watobo/utils/secure_eval.rb +3 -2
  180. data/lib/watobo/utils/strings.rb +3 -2
  181. data/lib/watobo/utils/text2request.rb +4 -5
  182. data/lib/watobo/utils/url.rb +46 -0
  183. data/lib/watobo/utils.rb +3 -2
  184. data/lib/watobo.rb +13 -3
  185. data/modules/active/Apache/mod_status.rb +15 -11
  186. data/modules/active/Flash/crossdomain.rb +17 -14
  187. data/modules/active/RoR/cve_2013_015x.rb +21 -0
  188. data/modules/active/directories/dirwalker.rb +10 -16
  189. data/modules/active/discovery/fileextensions.rb +10 -7
  190. data/modules/active/discovery/http_methods.rb +8 -9
  191. data/modules/active/domino/domino_db.rb +10 -11
  192. data/modules/active/dotNET/custom_errors.rb +124 -0
  193. data/modules/active/dotNET/dotnet_files.rb +112 -0
  194. data/modules/active/fileinclusion/lfi_simple.rb +9 -7
  195. data/modules/active/jboss/jboss_basic.rb +12 -9
  196. data/modules/active/sap/its_commands.rb +10 -9
  197. data/modules/active/sap/its_service_parameter.rb +10 -9
  198. data/modules/active/sap/its_services.rb +10 -9
  199. data/modules/active/sap/its_xss.rb +11 -10
  200. data/modules/active/siebel/siebel_apps.rb +14 -16
  201. data/modules/active/sqlinjection/sql_boolean.rb +139 -75
  202. data/modules/active/sqlinjection/sqli_error.rb +9 -6
  203. data/modules/active/sqlinjection/sqli_timing.rb +13 -11
  204. data/modules/active/xml/xml_xxe.rb +134 -0
  205. data/modules/active/xss/{xss_rated.rb → xss_ng.rb} +89 -56
  206. data/modules/active/xss/xss_simple.rb +9 -6
  207. data/modules/passive/ajax.rb +85 -0
  208. data/modules/passive/autocomplete.rb +78 -0
  209. data/modules/passive/cookie_options.rb +3 -2
  210. data/modules/passive/cookie_xss.rb +3 -2
  211. data/modules/passive/detect_code.rb +7 -4
  212. data/modules/passive/detect_fileupload.rb +3 -2
  213. data/modules/passive/detect_infrastructure.rb +7 -4
  214. data/modules/passive/detect_one_time_tokens.rb +3 -2
  215. data/modules/passive/dirindexing.rb +3 -2
  216. data/modules/passive/disclosure_domino.rb +3 -2
  217. data/modules/passive/disclosure_emails.rb +3 -2
  218. data/modules/passive/disclosure_ipaddr.rb +3 -2
  219. data/modules/passive/filename_as_parameter.rb +3 -2
  220. data/modules/passive/form_spotter.rb +10 -7
  221. data/modules/passive/hidden_fields.rb +73 -0
  222. data/modules/passive/hotspots.rb +7 -4
  223. data/modules/passive/in_script_parameter.rb +3 -2
  224. data/modules/passive/multiple_server_headers.rb +4 -3
  225. data/modules/passive/possible_login.rb +3 -2
  226. data/modules/passive/redirect_url.rb +3 -2
  227. data/modules/passive/redirectionz.rb +6 -3
  228. data/modules/passive/xss_dom.rb +16 -9
  229. data/plugins/catalog/catalog.rb +119 -193
  230. data/plugins/crawler/crawler.rb +4 -3
  231. data/plugins/crawler/gui/auth_frame.rb +3 -2
  232. data/plugins/crawler/gui/crawler_gui.rb +3 -2
  233. data/plugins/crawler/gui/general_settings_frame.rb +3 -2
  234. data/plugins/crawler/gui/hooks_frame.rb +3 -2
  235. data/plugins/crawler/gui/scope_frame.rb +3 -2
  236. data/plugins/crawler/gui/settings_tabbook.rb +3 -2
  237. data/plugins/crawler/gui/status_frame.rb +3 -2
  238. data/plugins/crawler/gui.rb +3 -2
  239. data/plugins/crawler/lib/bags.rb +3 -2
  240. data/plugins/crawler/lib/constants.rb +3 -2
  241. data/plugins/crawler/lib/engine.rb +3 -2
  242. data/plugins/crawler/lib/grabber.rb +3 -2
  243. data/plugins/crawler/lib/uri_mp.rb +1 -1
  244. data/plugins/filefinder/filefinder.rb +92 -70
  245. data/plugins/sqlmap/bin/test.rb +3 -2
  246. data/plugins/sqlmap/gui/main.rb +3 -2
  247. data/plugins/sqlmap/gui/options_frame.rb +4 -3
  248. data/plugins/sqlmap/gui.rb +1 -1
  249. data/plugins/sqlmap/lib/sqlmap_ctrl.rb +3 -2
  250. data/plugins/sqlmap/sqlmap.rb +1 -1
  251. data/plugins/sslchecker/cli/sslchecker_cli.rb +1 -1
  252. data/plugins/sslchecker/gui/cipher_table.rb +17 -10
  253. data/plugins/sslchecker/gui/gui.rb +59 -56
  254. data/plugins/sslchecker/gui/sslchecker.rb +1 -1
  255. data/plugins/sslchecker/lib/check.rb +43 -18
  256. data/plugins/wshell/gui/main.rb +130 -0
  257. data/plugins/wshell/icons/wsh.ico +0 -0
  258. data/plugins/wshell/lib/core.rb +99 -0
  259. data/plugins/wshell/wshell.rb +33 -0
  260. metadata +80 -8
  261. data/README +0 -26
  262. data/lib/watobo/core/http_socket.rb +0 -161
  263. data/lib/watobo/gui/plugin/base.rb +0 -82
@@ -1,7 +1,7 @@
1
1
  # .
2
2
  # dashboard.rb
3
3
  #
4
- # Copyright 2012 by siberas, http://www.siberas.de
4
+ # Copyright 2013 by siberas, http://www.siberas.de
5
5
  #
6
6
  # This file is part of WATOBO (Web Application Tool Box)
7
7
  # http://watobo.sourceforge.com
@@ -19,7 +19,8 @@
19
19
  # along with WATOBO; if not, write to the Free Software
20
20
  # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
21
  # .
22
- module Watobo
22
+ # @private
23
+ module Watobo#:nodoc: all
23
24
 
24
25
  module Gui
25
26
 
@@ -27,22 +28,33 @@ module Watobo
27
28
 
28
29
  def increment(i)
29
30
  @lock.synchronize do
30
- @progress += i
31
+ @pbar.progress += i
31
32
  #@total += i
32
33
  end
33
34
  end
34
35
 
35
36
  def progress(i)
36
37
  @lock.synchronize do
37
- @progress = i
38
- #@total += i
38
+ @pbar.progress = i
39
+ update_bar_color
39
40
  end
40
41
  end
41
42
 
43
+ def update_bar_color
44
+ if @pbar.total == 0 then
45
+ @pbar.barColor = 'grey'
46
+ else
47
+ @pbar.barColor = FXRGB(255,0,0)
48
+ end
49
+ if @pbar.progress == @pbar.total
50
+ @pbar.barColor = 'green'
51
+ end
52
+ end
53
+
42
54
  def total(i)
43
55
  @lock.synchronize do
44
56
  #@progress = i
45
- @total = i
57
+ @pbar.total = i
46
58
  end
47
59
  end
48
60
 
@@ -52,21 +64,10 @@ module Watobo
52
64
  end
53
65
  end
54
66
 
55
- def update_progress
56
- @lock.synchronize do
57
- @pbar.increment(@progress)
58
- @progress = 0
59
- @pbar.barColor = 'green' if @pbar.progress >= @pbar.total
60
- @label.text = "#{@check_name} #{@pbar.progress}/#{@pbar.total}"
61
- end
62
- end
63
-
64
67
  def initialize(owner, check_name, num_checks)
65
68
  begin
66
69
  super(owner, :opts => LAYOUT_FILL_X|FRAME_GROOVE|LAYOUT_TOP)
67
70
  @lock = Mutex.new
68
- @progress = 0
69
- @total = 0
70
71
  @check_name = check_name
71
72
  @label = FXLabel.new(self, check_name, :opts => LAYOUT_LEFT)
72
73
 
@@ -75,12 +76,7 @@ module Watobo
75
76
  @pbar.progress = 0
76
77
  @pbar.total = num_checks
77
78
  puts "#{check_name} has #{num_checks} Checks"
78
- @pbar.barColor = 0
79
- if num_checks == 0 then
80
- @pbar.barColor = 'grey'
81
- else
82
- @pbar.barColor = FXRGB(255,0,0)
83
- end
79
+ update_bar_color
84
80
  rescue => bang
85
81
  puts "!!!ERROR: could not add progress info"
86
82
  puts bang
@@ -106,7 +102,7 @@ module Watobo
106
102
  #@progress_bars = Hash.new
107
103
  modules.each do |check_name, num_checks|
108
104
  puts "* new ProgressInfo: #{check_name} - #{num_checks}"
109
- pi = ProgressInfo.new(@progress_frame, check_name, num_checks)
105
+ pi = ProgressInfo.new(@progress_frame, check_name, num_checks[:total])
110
106
  pi.create
111
107
 
112
108
  @progress_bars[check_name] = pi
@@ -135,16 +131,16 @@ module Watobo
135
131
  end
136
132
 
137
133
  class ProjectInfo < FXVerticalFrame
138
- def update(project)
139
- if project then
140
- @project_name.text = project.settings[:project_name]
141
- @session_name.text = project.settings[:session_name]
142
- @project_path.text = project.settings[:project_path]
143
- @session_path.text = project.settings[:session_path]
144
-
145
- @number_active_checks.text = project.active_checks.length.to_s
146
- @number_passive_checks = project.passive_checks.length.to_s
147
- @number_total_chats.text = project.chats.length.to_s
134
+ def update()
135
+ if Watobo.project then
136
+ @project_name.text = Watobo.project.settings[:project_name]
137
+ @session_name.text = Watobo.project.settings[:session_name]
138
+ @project_path.text = Watobo.project.settings[:project_path]
139
+ @session_path.text = Watobo.project.settings[:session_path]
140
+
141
+ @number_active_checks.text = Watobo::ActiveModules.length.to_s
142
+ @number_passive_checks = Watobo::PassiveModules.length.to_s
143
+ @number_total_chats.text = Watobo::Chats.length.to_s
148
144
  end
149
145
 
150
146
  end
@@ -168,11 +164,11 @@ module Watobo
168
164
  @session_path = FXLabel.new(frame,"-")
169
165
 
170
166
  frame = FXHorizontalFrame.new(self, :opts => LAYOUT_FILL_X)
171
- FXLabel.new(frame, "Number available ActiveChecks:")
167
+ FXLabel.new(frame, "Number available ActiveModules:")
172
168
  @number_active_checks = FXLabel.new(frame,"-")
173
169
 
174
170
  frame = FXHorizontalFrame.new(self, :opts => LAYOUT_FILL_X)
175
- FXLabel.new(frame, "Number of PassiveChecks:")
171
+ FXLabel.new(frame, "Number of PassiveModules:")
176
172
  @number_passive_checks = FXLabel.new(frame,"-")
177
173
 
178
174
  frame = FXHorizontalFrame.new(self, :opts => LAYOUT_FILL_X)
@@ -201,8 +197,11 @@ module Watobo
201
197
  class Dashboard < FXVerticalFrame
202
198
  include Watobo::Gui::Icons
203
199
 
204
- def setupScanProgressFrame(scan_modules)
205
- @scan_progress_frame.setup(scan_modules)
200
+ def setupScanProgressFrame(scanner)
201
+ @progress_lock.synchronize do
202
+ @scanner = scanner
203
+ @scan_progress_frame.setup(scanner.progress)
204
+ end
206
205
  end
207
206
 
208
207
  def setScanStatus(status)
@@ -238,9 +237,8 @@ module Watobo
238
237
  end
239
238
  end
240
239
 
241
- def updateProjectInfo(project)
242
- @project = project
243
- @project_info_frame.update(@project)
240
+ def updateProjectInfo()
241
+ @project_info_frame.update()
244
242
  end
245
243
 
246
244
  def update_status(check_module, progress_index)
@@ -295,8 +293,12 @@ module Watobo
295
293
 
296
294
  def start_update_timer
297
295
  @timer = FXApp.instance.addTimeout( 50, :repeat => true) {
298
- @scan_progress_frame.progress_bars.each_value do |p|
299
- p.update_progress
296
+ unless @scanner.nil?
297
+ progress = @scanner.progress
298
+ progress.each do |m, info|
299
+ @scan_progress_frame.progress_bars[m].progress info[:progress]
300
+
301
+ end
300
302
  end
301
303
  }
302
304
  end
@@ -306,7 +308,7 @@ def start_update_timer
306
308
 
307
309
  super(parent, LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN)
308
310
  #db_title = FXLabel.new(self, "DASHBOARD", :opts => LAYOUT_LEFT)
309
- @project = nil
311
+ @scanner = nil
310
312
  @progress_lock = Mutex.new
311
313
 
312
314
  main = FXVerticalFrame.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_GROOVE)
@@ -341,7 +343,7 @@ def start_update_timer
341
343
  case tabItem.to_i
342
344
  when 0
343
345
  # puts "Login Script Selected"
344
- @project_info_frame.update(@project)
346
+ @project_info_frame.update()
345
347
  when 1
346
348
  # puts "Session IDs Selected"
347
349
 
@@ -1,7 +1,7 @@
1
1
  # .
2
2
  # define_scope_frame.rb
3
3
  #
4
- # Copyright 2012 by siberas, http://www.siberas.de
4
+ # Copyright 2013 by siberas, http://www.siberas.de
5
5
  #
6
6
  # This file is part of WATOBO (Web Application Tool Box)
7
7
  # http://watobo.sourceforge.com
@@ -23,7 +23,8 @@ require 'fox16'
23
23
 
24
24
  include Fox
25
25
 
26
- module Watobo
26
+ # @private
27
+ module Watobo#:nodoc: all
27
28
  module Gui
28
29
 
29
30
 
@@ -198,7 +199,7 @@ module Watobo
198
199
  class DefineScopeFrame < FXVerticalFrame
199
200
 
200
201
  def onDeselectAll(sender, sel, item)
201
- @dummy_scope.each do |site, val|
202
+ @scope.each do |site, val|
202
203
  @cb_sites[site].setCheck(false)
203
204
  @edit_btns[site].disable
204
205
  end
@@ -209,7 +210,7 @@ module Watobo
209
210
 
210
211
  def onSelectAll(sender, sel, item)
211
212
  sites = []
212
- @dummy_scope.each do |site, scope|
213
+ @scope.each do |site, scope|
213
214
  @cb_sites[site].setCheck(true)
214
215
  @edit_btns[site].enable
215
216
  end
@@ -218,10 +219,10 @@ module Watobo
218
219
  end
219
220
 
220
221
  def editSiteDetails(site)
221
- dlg = EditScopeDetailsDialog.new(self, @dummy_scope[site])
222
+ dlg = EditScopeDetailsDialog.new(self, @scope[site])
222
223
 
223
224
  if dlg.execute != 0
224
- @dummy_scope[site].update dlg.details
225
+ @scope[site].update dlg.details
225
226
  puts dlg.details.to_yaml
226
227
  end
227
228
  end
@@ -229,14 +230,14 @@ module Watobo
229
230
  def getScope()
230
231
  scope = Hash.new
231
232
  @cb_sites.keys.each do |site|
232
- @dummy_scope.delete(site) if !@cb_sites[site].checked?
233
- # scope[site] = @dummy_scope[site] if @cb_sites[site].checked?
233
+ @scope.delete(site) if !@cb_sites[site].checked?
234
+ # scope[site] = @scope[site] if @cb_sites[site].checked?
234
235
  end
235
- return @dummy_scope
236
+ return @scope
236
237
  end
237
238
 
238
239
  def updateFrame()
239
- @dummy_scope.each do |site, scope|
240
+ @scope.each do |site, scope|
240
241
  next if @cb_sites[site].nil?
241
242
  @cb_sites[site].setCheck(scope[:enabled])
242
243
  @cb_sites[site].checked? ? @edit_btns[site].enable : @edit_btns[site].disable
@@ -246,18 +247,19 @@ module Watobo
246
247
 
247
248
  def setScope(scope)
248
249
  @scope = scope
249
- @dummy_scope.keys.each do |site|
250
- @dummy_scope[site].update @scope[site] if !@scope[site].nil?
250
+ Watobo::Scope.each do |site, scope_def|
251
+ @scope[site].update @scope[site] if !@scope[site].nil?
251
252
  end
252
253
  updateFrame()
253
254
  end
254
255
 
255
- def initialize(owner, sites, scope, opts)
256
+ def initialize(owner, opts)
256
257
  super(owner, :opts => opts, :padding => 0)
257
258
 
258
- @dummy_scope = Hash.new
259
- @dummy_scope = YAML.load(YAML.dump(scope)) if scope.is_a? Hash
260
-
259
+ # @scope = Hash.new
260
+ # @scope = YAML.load(YAML.dump(scope)) if scope.is_a? Hash
261
+ @scope = YAML.load(Watobo::Scope.to_yaml)
262
+
261
263
  @cb_sites = Hash.new
262
264
  @edit_btns = Hash.new
263
265
 
@@ -288,8 +290,11 @@ EOF
288
290
  frame = FXVerticalFrame.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_GROOVE, :padding => 0)
289
291
  sitesArea = FXScrollWindow.new(frame, SCROLLERS_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y)
290
292
  sitesFrame = FXVerticalFrame.new(sitesArea, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :padding => 0)
291
-
292
- sites.sort.each do |site|
293
+ puts "list sites"
294
+ sites = Watobo::Chats.sites()
295
+ puts sites.length
296
+ sites.sort.each do |site|
297
+ puts site
293
298
  site_frame = FXHorizontalFrame.new(sitesFrame, :opts => LAYOUT_FILL_X)
294
299
  b = FXCheckButton.new(site_frame, site, nil, 0, ICON_BEFORE_TEXT|LAYOUT_SIDE_LEFT)
295
300
  eb = FXButton.new(site_frame, "edit..", nil, nil, 0, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT)
@@ -297,7 +302,7 @@ EOF
297
302
 
298
303
  b.connect(SEL_COMMAND){
299
304
  b.checked? ? @edit_btns[site].enable : @edit_btns[site].disable
300
- @dummy_scope[site][:enabled] = true
305
+ @scope[site][:enabled] = true
301
306
  }
302
307
 
303
308
 
@@ -311,10 +316,10 @@ EOF
311
316
  #:exclude_pattern => []
312
317
  }
313
318
 
314
- if !@dummy_scope[site]
315
- @dummy_scope[site] = scope_details
319
+ if !@scope[site]
320
+ @scope[site] = scope_details
316
321
  else
317
- @dummy_scope[site][:enabled] = true
322
+ @scope[site][:enabled] = true
318
323
  end
319
324
 
320
325
 
@@ -0,0 +1,238 @@
1
+ # .
2
+ # differ_frame.rb
3
+ #
4
+ # Copyright 2013 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
+ # @private
23
+ module Watobo#:nodoc: all
24
+ module Gui
25
+ class SelectionInfo < FXVerticalFrame
26
+ def update(info)
27
+ begin
28
+ @hid_label.text = info[:hid] || "-"
29
+ @url_label.text = info[:url] || "-"
30
+ @length_label.text = info[:length] || "-"
31
+ @status_label.text = info[:status] || "-"
32
+
33
+ rescue => bang
34
+ puts "!!! Could not update SelectionInfo"
35
+ puts bang
36
+ end
37
+ end
38
+
39
+ def clear()
40
+ @hid_label.text = "-"
41
+ @url_label.text = "-"
42
+ @length_label.text = "-"
43
+ @status_label.text = "-"
44
+ end
45
+
46
+ def initialize(owner, opts)
47
+ super(owner, opts)
48
+ frame = FXHorizontalFrame.new(self, :opts => FRAME_NONE|LAYOUT_FILL_X, :padding => 0)
49
+ FXLabel.new(frame, "History-ID: ")
50
+ @hid_label = FXLabel.new(frame, " - ")
51
+
52
+ frame = FXHorizontalFrame.new(self, :opts => FRAME_NONE|LAYOUT_FILL_X, :padding => 0)
53
+ FXLabel.new(frame, "URL: ")
54
+ @url_label = FXLabel.new(frame, " - ")
55
+
56
+ frame = FXHorizontalFrame.new(self, :opts => FRAME_NONE|LAYOUT_FILL_X, :padding => 0)
57
+ FXLabel.new(frame, "Length: ")
58
+ @length_label = FXLabel.new(frame, " - ")
59
+
60
+ frame = FXHorizontalFrame.new(self, :opts => FRAME_NONE|LAYOUT_FILL_X, :padding => 0)
61
+ FXLabel.new(frame, "Status: ")
62
+ @status_label = FXLabel.new(frame, " - ")
63
+ end
64
+ end
65
+
66
+ class DiffFrame < FXVerticalFrame
67
+ include Responder
68
+
69
+ ID_HISTORY_BUTTON = FXMainWindow::ID_LAST
70
+ def onHistoryButton(sender, sel, event)
71
+ @history_slider.reset()
72
+ sender.parent.backColor = FXColor::Red
73
+ @slider_selection = sender.parent.item
74
+ end
75
+
76
+ def updateHistory(history)
77
+ @slider_selection = nil
78
+ @history = history
79
+ # @history_slider.update(history)
80
+ updateHistoryTable()
81
+ # updateSelections()
82
+ end
83
+
84
+ def onTableClick(sender,sel,item)
85
+ begin
86
+
87
+ row = item.row
88
+ @historyTable.selectRow(row, false)
89
+ hi = @historyTable.getRowText(row).to_i - 1
90
+
91
+ if @first_selection and @second_selection
92
+ @first_selection = nil
93
+ @second_selection = nil
94
+ end
95
+
96
+ if !@first_selection
97
+ @first_selection = @history[hi]
98
+ else
99
+ @second_selection = @history[hi]
100
+ end
101
+
102
+ updateSelection()
103
+
104
+ rescue => bang
105
+ puts "!!!ERROR: onTableClick"
106
+ puts bang
107
+ puts "!!!"
108
+
109
+ end
110
+ end
111
+
112
+ def initHistoryTable()
113
+ @historyTable.clearItems()
114
+ @historyTable.setTableSize(0, 3)
115
+
116
+ @historyTable.setColumnText( 0, "STATUS" )
117
+ @historyTable.setColumnText( 1, "LENGTH" )
118
+ @historyTable.setColumnText( 2, "URL" )
119
+
120
+ @historyTable.rowHeader.width = 50
121
+ @historyTable.setColumnWidth(0, 100)
122
+
123
+ @historyTable.setColumnWidth(1, 100)
124
+ @historyTable.setColumnWidth(2, 200)
125
+
126
+ end
127
+
128
+ def updateHistoryTable()
129
+ begin
130
+ @historyTable.clearItems()
131
+ initHistoryTable()
132
+
133
+ @history.each do |h|
134
+ lastRowIndex = @historyTable.getNumRows
135
+ @historyTable.appendRows(1)
136
+ @historyTable.setRowText(lastRowIndex, (@history.index(h) + 1 ).to_s)
137
+ @historyTable.setItemText(lastRowIndex, 0, h.response.status) if h.response.respond_to? :status
138
+ @historyTable.setItemText(lastRowIndex, 1, h.response.join.length.to_s)
139
+ @historyTable.setItemText(lastRowIndex, 2, h.request.url.to_s) if h.request.respond_to? :url
140
+ 3.times do |i|
141
+ i = @historyTable.getItem(lastRowIndex, i)
142
+ i.justify = FXTableItem::LEFT unless i.nil?
143
+ end
144
+ end
145
+ rescue => bang
146
+ puts bang
147
+ end
148
+
149
+ end
150
+
151
+ def updateSelection()
152
+ @first_sel_info.clear()
153
+ @second_sel_info.clear()
154
+
155
+ if @first_selection
156
+
157
+ @first_sel_info.update( :url => @first_selection.request.url.to_s,
158
+ :hid => (@history.index(@first_selection) + 1).to_s,
159
+ :status => @first_selection.response.status,
160
+ :length => @first_selection.response.join.length.to_s)
161
+
162
+ end
163
+
164
+ if @second_selection
165
+ @second_sel_info.update( :url => @second_selection.request.url.to_s,
166
+ :hid => (@history.index(@second_selection) + 1).to_s,
167
+ :status => @second_selection.response.status,
168
+ :length => @second_selection.response.join.length.to_s)
169
+
170
+ end
171
+ end
172
+
173
+ def getDiffChats()
174
+ first = nil
175
+ second = nil
176
+ begin
177
+ case @first_chat_dt.value
178
+ when 0
179
+ 0
180
+ when 1
181
+ 0
182
+ end
183
+
184
+ rescue
185
+
186
+ return first, second
187
+ end
188
+ end
189
+
190
+ def initialize(owner, opts)
191
+ super(owner, opts)
192
+
193
+ @history_size = 10
194
+ @history = []
195
+ @slider_selection = nil
196
+ @first_selection = nil
197
+ @second_selection = nil
198
+
199
+ FXMAPFUNC(SEL_COMMAND, DiffFrame::ID_HISTORY_BUTTON, 'onHistoryButton')
200
+
201
+ frame = FXHorizontalFrame.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN)
202
+ # frame_left = FXVerticalFrame.new(frame, :opts => LAYOUT_FILL_Y|LAYOUT_FIX_WIDTH, :width => 70, :padding => 0)
203
+ # @history_slider = HistorySlider.new(frame_left, self, @history_size, opts)
204
+
205
+ frame_right = FXVerticalFrame.new(frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
206
+ sunken = FXVerticalFrame.new(frame_right, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN|FRAME_THICK, :padding => 0)
207
+ @historyTable = FXTable.new(sunken, :opts => FRAME_SUNKEN|TABLE_COL_SIZABLE|TABLE_ROW_SIZABLE|LAYOUT_FILL_X|LAYOUT_FILL_Y|TABLE_READONLY|LAYOUT_SIDE_TOP, :padding => 2)
208
+ initHistoryTable()
209
+
210
+ @historyTable.connect(SEL_COMMAND, method(:onTableClick))
211
+
212
+ first_chat_gb = FXGroupBox.new(frame_right, "First Chat", LAYOUT_SIDE_TOP|FRAME_GROOVE|LAYOUT_FILL_X, 0, 0, 0, 0)
213
+ @first_sel_info = SelectionInfo.new(first_chat_gb, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
214
+ second_chat_gb = FXGroupBox.new(frame_right, "Second Chat", LAYOUT_SIDE_TOP|FRAME_GROOVE|LAYOUT_FILL_X, 0, 0, 0, 0)
215
+ @second_sel_info = SelectionInfo.new(second_chat_gb, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
216
+
217
+ diff_button = FXButton.new(frame_right, "Diff it!", nil, nil, 0, :opts => LAYOUT_FILL_X|FRAME_RAISED|FRAME_THICK)
218
+
219
+ diff_button.connect(SEL_COMMAND) {
220
+ # new, orig = getDiffChats()
221
+ if @first_selection and @second_selection then
222
+ first_request = Watobo::Utils.copyObject(@first_selection.request)
223
+ first_response = Watobo::Utils.copyObject(@first_selection.response)
224
+ second_request = Watobo::Utils.copyObject(@second_selection.request)
225
+ second_response = Watobo::Utils.copyObject(@second_selection.response)
226
+
227
+ chat_one = Watobo::Chat.new(first_request, first_response, :id => 0)
228
+ chat_two = Watobo::Chat.new(second_request, second_response, :id => 0)
229
+ project = nil
230
+ diffViewer = ChatDiffViewer.new(FXApp.instance, chat_one, chat_two)
231
+ diffViewer.create
232
+ diffViewer.show(Fox::PLACEMENT_SCREEN)
233
+ end
234
+ }
235
+ end
236
+ end
237
+ end
238
+ end
@@ -1,7 +1,7 @@
1
1
  # .
2
2
  # edit_comment.rb
3
3
  #
4
- # Copyright 2012 by siberas, http://www.siberas.de
4
+ # Copyright 2013 by siberas, http://www.siberas.de
5
5
  #
6
6
  # This file is part of WATOBO (Web Application Tool Box)
7
7
  # http://watobo.sourceforge.com
@@ -19,7 +19,8 @@
19
19
  # along with WATOBO; if not, write to the Free Software
20
20
  # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
21
  # .
22
- module Watobo
22
+ # @private
23
+ module Watobo#:nodoc: all
23
24
  module Gui
24
25
  class EditCommentDialog < FXDialogBox
25
26
  def comment()
@@ -1,7 +1,7 @@
1
1
  # .
2
2
  # edit_scope_dialog.rb
3
3
  #
4
- # Copyright 2012 by siberas, http://www.siberas.de
4
+ # Copyright 2013 by siberas, http://www.siberas.de
5
5
  #
6
6
  # This file is part of WATOBO (Web Application Tool Box)
7
7
  # http://watobo.sourceforge.com
@@ -19,7 +19,8 @@
19
19
  # along with WATOBO; if not, write to the Free Software
20
20
  # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
21
  # .
22
- module Watobo
22
+ # @private
23
+ module Watobo#:nodoc: all
23
24
  module Gui
24
25
  class EditScopeDialog < FXDialogBox
25
26
 
@@ -28,17 +29,17 @@ module Watobo
28
29
  attr :scope
29
30
  def onAccept(sender, sel, event)
30
31
 
31
- @scope = @defineScopeFrame.getScope()
32
+ Watobo::Scope.set @defineScopeFrame.getScope()
32
33
 
33
34
  getApp().stopModal(self, 1)
34
35
  self.hide()
35
36
  return 1
36
37
  end
37
38
 
38
- def initialize(owner, project, prefs)
39
+ def initialize(owner, prefs)
39
40
  #super(owner, "Edit Target Scope", DECOR_TITLE|DECOR_BORDER, :width => 300, :height => 425)
40
41
  super(owner, "Edit Target Scope", DECOR_ALL, :width => 300, :height => 425)
41
- @project = project
42
+
42
43
  @scope = Hash.new
43
44
 
44
45
  FXMAPFUNC(SEL_COMMAND, ID_ACCEPT, :onAccept)
@@ -47,7 +48,7 @@ module Watobo
47
48
 
48
49
  # puts "create scopeframe with scope:"
49
50
  # @project.scope
50
- @defineScopeFrame = DefineScopeFrame.new(base_frame, @project.listSites(), YAML.load(YAML.dump(@project.scope)), prefs)
51
+ @defineScopeFrame = DefineScopeFrame.new(base_frame, prefs)
51
52
 
52
53
  buttons_frame = FXHorizontalFrame.new(base_frame,
53
54
  :opts => LAYOUT_FILL_X|LAYOUT_SIDE_TOP)
@@ -1,7 +1,7 @@
1
1
  # .
2
2
  # finding_info.rb
3
3
  #
4
- # Copyright 2012 by siberas, http://www.siberas.de
4
+ # Copyright 2013 by siberas, http://www.siberas.de
5
5
  #
6
6
  # This file is part of WATOBO (Web Application Tool Box)
7
7
  # http://watobo.sourceforge.com
@@ -20,7 +20,8 @@
20
20
  # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
21
  # .
22
22
  require 'fox16/colors'
23
- module Watobo
23
+ # @private
24
+ module Watobo#:nodoc: all
24
25
  module Gui
25
26
  class FindingInfo < FXVerticalFrame
26
27
  include Watobo::Gui::Icons