watobo 0.9.21 → 0.9.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (283) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +46 -1
  3. data/bin/nfq_server.rb +0 -9
  4. data/bin/watobo_gui.rb +3 -13
  5. data/custom-views/prettify-json.rb +9 -18
  6. data/icons/watobo.ico +0 -0
  7. data/icons/watobo.ico.old +0 -0
  8. data/lib/watobo.rb +10 -19
  9. data/lib/watobo/adapters.rb +5 -14
  10. data/lib/watobo/adapters/data_store.rb +50 -59
  11. data/lib/watobo/adapters/file/file_store.rb +287 -296
  12. data/lib/watobo/adapters/file/marshal_store.rb +293 -296
  13. data/lib/watobo/adapters/session_store.rb +5 -14
  14. data/lib/watobo/ca.rb +1 -10
  15. data/lib/watobo/config.rb +197 -206
  16. data/lib/watobo/constants.rb +0 -9
  17. data/lib/watobo/core.rb +3 -12
  18. data/lib/watobo/core/active_check.rb +72 -135
  19. data/lib/watobo/core/active_checks.rb +49 -58
  20. data/lib/watobo/core/ca.rb +369 -389
  21. data/lib/watobo/core/cert_store.rb +34 -43
  22. data/lib/watobo/core/chat.rb +92 -101
  23. data/lib/watobo/core/chats.rb +271 -280
  24. data/lib/watobo/core/client_cert_store.rb +106 -35
  25. data/lib/watobo/core/conversation.rb +48 -57
  26. data/lib/watobo/core/cookie.rb +23 -32
  27. data/lib/watobo/core/egress_handlers.rb +98 -0
  28. data/lib/watobo/core/finding.rb +66 -75
  29. data/lib/watobo/core/findings.rb +107 -114
  30. data/lib/watobo/core/forwarding_proxy.rb +13 -22
  31. data/lib/watobo/core/fuzz_gen.rb +0 -9
  32. data/lib/watobo/core/intercept_carver.rb +166 -177
  33. data/lib/watobo/core/intercept_filter.rb +235 -244
  34. data/lib/watobo/core/interceptor.rb +98 -107
  35. data/lib/watobo/core/min_class.rb +4 -13
  36. data/lib/watobo/core/netfilter_queue.rb +170 -179
  37. data/lib/watobo/core/ott_cache.rb +132 -141
  38. data/lib/watobo/core/parameter.rb +43 -52
  39. data/lib/watobo/core/passive_check.rb +103 -102
  40. data/lib/watobo/core/passive_checks.rb +48 -57
  41. data/lib/watobo/core/passive_scanner.rb +54 -55
  42. data/lib/watobo/core/plugin.rb +11 -20
  43. data/lib/watobo/core/project.rb +3 -9
  44. data/lib/watobo/core/proxy.rb +43 -52
  45. data/lib/watobo/core/request.rb +125 -123
  46. data/lib/watobo/core/response.rb +44 -53
  47. data/lib/watobo/core/scanner.rb +0 -9
  48. data/lib/watobo/core/scanner3.rb +405 -414
  49. data/lib/watobo/core/scope.rb +83 -92
  50. data/lib/watobo/core/session.rb +1043 -1026
  51. data/lib/watobo/core/sid_cache.rb +98 -107
  52. data/lib/watobo/core/subscriber.rb +25 -34
  53. data/lib/watobo/defaults.rb +21 -30
  54. data/lib/watobo/external/diff/lcs.rb +0 -9
  55. data/lib/watobo/external/diff/lcs/array.rb +0 -9
  56. data/lib/watobo/external/diff/lcs/block.rb +0 -9
  57. data/lib/watobo/external/diff/lcs/callbacks.rb +0 -9
  58. data/lib/watobo/external/diff/lcs/change.rb +0 -9
  59. data/lib/watobo/external/diff/lcs/hunk.rb +0 -9
  60. data/lib/watobo/external/diff/lcs/ldiff.rb +0 -9
  61. data/lib/watobo/external/diff/lcs/string.rb +0 -9
  62. data/lib/watobo/externals.rb +6 -15
  63. data/lib/watobo/framework.rb +4 -13
  64. data/lib/watobo/framework/create_project.rb +60 -69
  65. data/lib/watobo/framework/init.rb +0 -9
  66. data/lib/watobo/framework/init_modules.rb +0 -9
  67. data/lib/watobo/framework/license_text.rb +28 -37
  68. data/lib/watobo/framework/load_chat.rb +13 -22
  69. data/lib/watobo/gui.rb +132 -123
  70. data/lib/watobo/gui/about_watobo.rb +0 -9
  71. data/lib/watobo/gui/browser_preview.rb +0 -9
  72. data/lib/watobo/gui/certificate_dialog.rb +0 -9
  73. data/lib/watobo/gui/chat_diff.rb +0 -9
  74. data/lib/watobo/gui/chatviewer_frame.rb +73 -72
  75. data/lib/watobo/gui/checkboxtree.rb +0 -9
  76. data/lib/watobo/gui/checks_policy_frame.rb +0 -9
  77. data/lib/watobo/gui/client_cert_dialog.rb +96 -87
  78. data/lib/watobo/gui/confirm_scan_dialog.rb +0 -9
  79. data/lib/watobo/gui/conversation_table.rb +158 -164
  80. data/lib/watobo/gui/conversation_table_ctrl.rb +207 -216
  81. data/lib/watobo/gui/conversation_table_ctrl2.rb +373 -382
  82. data/lib/watobo/gui/csrf_token_dialog.rb +0 -9
  83. data/lib/watobo/gui/custom_viewer.rb +374 -383
  84. data/lib/watobo/gui/dashboard.rb +296 -303
  85. data/lib/watobo/gui/define_scope_frame.rb +0 -9
  86. data/lib/watobo/gui/differ_frame.rb +215 -224
  87. data/lib/watobo/gui/edit_comment.rb +0 -9
  88. data/lib/watobo/gui/edit_scope_dialog.rb +0 -9
  89. data/lib/watobo/gui/export_dialog.rb +104 -113
  90. data/lib/watobo/gui/finding_info.rb +0 -9
  91. data/lib/watobo/gui/findings_tree.rb +210 -217
  92. data/lib/watobo/gui/full_scan_dialog.rb +0 -9
  93. data/lib/watobo/gui/fuzzer_gui.rb +1295 -1313
  94. data/lib/watobo/gui/fxsave_thread.rb +14 -0
  95. data/lib/watobo/gui/goto_url_dialog.rb +70 -79
  96. data/lib/watobo/gui/hex_viewer.rb +0 -9
  97. data/lib/watobo/gui/html_viewer.rb +287 -296
  98. data/lib/watobo/gui/intercept_filter_dialog.rb +188 -197
  99. data/lib/watobo/gui/interceptor_gui.rb +1041 -1051
  100. data/lib/watobo/gui/interceptor_settings_dialog.rb +0 -9
  101. data/lib/watobo/gui/json_viewer.rb +287 -0
  102. data/lib/watobo/gui/list_box.rb +101 -110
  103. data/lib/watobo/gui/log_file_viewer.rb +32 -41
  104. data/lib/watobo/gui/log_viewer.rb +83 -88
  105. data/lib/watobo/gui/login_wizzard.rb +0 -9
  106. data/lib/watobo/gui/main_window.rb +587 -618
  107. data/lib/watobo/gui/manual_request_editor.rb +620 -565
  108. data/lib/watobo/gui/master_pw_dialog.rb +0 -9
  109. data/lib/watobo/gui/mixins/gui_settings.rb +29 -38
  110. data/lib/watobo/gui/page_tree.rb +217 -226
  111. data/lib/watobo/gui/password_policy_dialog.rb +0 -9
  112. data/lib/watobo/gui/plugin_board.rb +0 -9
  113. data/lib/watobo/gui/preferences_dialog.rb +0 -9
  114. data/lib/watobo/gui/progress_window.rb +17 -27
  115. data/lib/watobo/gui/project_wizzard.rb +0 -9
  116. data/lib/watobo/gui/proxy_dialog.rb +1 -10
  117. data/lib/watobo/gui/quick_scan_dialog.rb +0 -9
  118. data/lib/watobo/gui/request_builder_frame.rb +102 -111
  119. data/lib/watobo/gui/request_editor.rb +181 -137
  120. data/lib/watobo/gui/rewrite_filters_dialog.rb +394 -403
  121. data/lib/watobo/gui/rewrite_rules_dialog.rb +372 -381
  122. data/lib/watobo/gui/save_chat_dialog.rb +140 -149
  123. data/lib/watobo/gui/scanner_settings_dialog.rb +0 -9
  124. data/lib/watobo/gui/select_chat_dialog.rb +0 -9
  125. data/lib/watobo/gui/session_management_dialog.rb +0 -9
  126. data/lib/watobo/gui/sites_tree.rb +0 -9
  127. data/lib/watobo/gui/status_bar.rb +0 -9
  128. data/lib/watobo/gui/table_editor.rb +0 -9
  129. data/lib/watobo/gui/tagless_viewer.rb +0 -9
  130. data/lib/watobo/gui/templates/plugin.rb +0 -9
  131. data/lib/watobo/gui/templates/plugin2.rb +92 -100
  132. data/lib/watobo/gui/templates/plugin_base.rb +144 -153
  133. data/lib/watobo/gui/text_viewer.rb +0 -9
  134. data/lib/watobo/gui/transcoder_window.rb +0 -9
  135. data/lib/watobo/gui/utils/gui_utils.rb +0 -9
  136. data/lib/watobo/gui/utils/init_icons.rb +86 -95
  137. data/lib/watobo/gui/utils/load_icons.rb +33 -42
  138. data/lib/watobo/gui/utils/load_plugins.rb +116 -119
  139. data/lib/watobo/gui/utils/master_password.rb +68 -77
  140. data/lib/watobo/gui/utils/save_default_settings.rb +113 -122
  141. data/lib/watobo/gui/utils/save_project_settings.rb +0 -9
  142. data/lib/watobo/gui/utils/save_proxy_settings.rb +41 -50
  143. data/lib/watobo/gui/utils/save_scanner_settings.rb +18 -27
  144. data/lib/watobo/gui/utils/session_history.rb +112 -121
  145. data/lib/watobo/gui/workspace_dialog.rb +0 -9
  146. data/lib/watobo/gui/www_auth_dialog.rb +0 -9
  147. data/lib/watobo/gui/xml_viewer_frame.rb +0 -9
  148. data/lib/watobo/http.rb +4 -13
  149. data/lib/watobo/http/cookies/cookies.rb +26 -35
  150. data/lib/watobo/http/data/data.rb +45 -54
  151. data/lib/watobo/http/data/json.rb +47 -55
  152. data/lib/watobo/http/url/url.rb +38 -47
  153. data/lib/watobo/http/xml/xml.rb +124 -130
  154. data/lib/watobo/interceptor.rb +3 -12
  155. data/lib/watobo/interceptor/proxy.rb +742 -739
  156. data/lib/watobo/interceptor/transparent.rb +22 -24
  157. data/lib/watobo/mixins.rb +10 -19
  158. data/lib/watobo/mixins/check_info.rb +27 -36
  159. data/lib/watobo/mixins/httpparser.rb +613 -637
  160. data/lib/watobo/mixins/request_parser.rb +88 -97
  161. data/lib/watobo/mixins/shapers.rb +515 -529
  162. data/lib/watobo/mixins/transcoders.rb +3 -11
  163. data/lib/watobo/parser.rb +1 -10
  164. data/lib/watobo/parser/html.rb +83 -92
  165. data/lib/watobo/patch_fxruby_setfocus.rb +26 -0
  166. data/lib/watobo/sockets.rb +3 -12
  167. data/lib/watobo/sockets/agent.rb +828 -837
  168. data/lib/watobo/sockets/client_socket.rb +308 -312
  169. data/lib/watobo/sockets/connection.rb +401 -410
  170. data/lib/watobo/sockets/http_socket.rb +11 -13
  171. data/lib/watobo/sockets/ntlm_auth.rb +129 -138
  172. data/lib/watobo/utils.rb +10 -19
  173. data/lib/watobo/utils/check_regex.rb +0 -9
  174. data/lib/watobo/utils/copy_object.rb +0 -9
  175. data/lib/watobo/utils/crypto.rb +0 -9
  176. data/lib/watobo/utils/expand_range.rb +23 -32
  177. data/lib/watobo/utils/export_xml.rb +97 -106
  178. data/lib/watobo/utils/file_management.rb +9 -11
  179. data/lib/watobo/utils/hexprint.rb +9 -18
  180. data/lib/watobo/utils/load_chat.rb +0 -9
  181. data/lib/watobo/utils/load_icon.rb +0 -9
  182. data/lib/watobo/utils/ntlm.rb +866 -875
  183. data/lib/watobo/utils/print_debug.rb +12 -21
  184. data/lib/watobo/utils/response_builder.rb +90 -99
  185. data/lib/watobo/utils/response_hash.rb +0 -9
  186. data/lib/watobo/utils/secure_eval.rb +0 -9
  187. data/lib/watobo/utils/strings.rb +10 -19
  188. data/lib/watobo/utils/text2request.rb +0 -9
  189. data/lib/watobo/utils/url.rb +23 -32
  190. data/lib/watobo/utils/utf16.rb +11 -20
  191. data/modules/active/Apache/mod_status.rb +0 -9
  192. data/modules/active/Apache/multiview.rb +151 -160
  193. data/modules/active/Flash/crossdomain.rb +0 -9
  194. data/modules/active/JWT/jwt_oauth2_none.rb +111 -0
  195. data/modules/active/cq5/cq5_default_selectors.rb +106 -115
  196. data/modules/active/cq5/cqp_user_enumeration.rb +125 -134
  197. data/modules/active/directories/dirwalker.rb +0 -9
  198. data/modules/active/discovery/fileextensions.rb +0 -9
  199. data/modules/active/discovery/http_methods.rb +0 -9
  200. data/modules/active/discovery/jsmapfiles.rb +79 -0
  201. data/modules/active/domino/domino_db.rb +68 -76
  202. data/modules/active/dotNET/custom_errors.rb +102 -111
  203. data/modules/active/dotNET/dotnet_files.rb +90 -99
  204. data/modules/active/fileinclusion/lfi_simple.rb +0 -9
  205. data/modules/active/jboss/jboss_basic.rb +0 -9
  206. data/modules/active/sap/business_objects.rb +51 -60
  207. data/modules/active/sap/its_commands.rb +0 -9
  208. data/modules/active/sap/its_service_parameter.rb +0 -9
  209. data/modules/active/sap/its_services.rb +0 -9
  210. data/modules/active/sap/its_xss.rb +0 -9
  211. data/modules/active/shell_shock/shell_shock.rb +139 -148
  212. data/modules/active/siebel/siebel_apps.rb +160 -169
  213. data/modules/active/sqlinjection/sql_boolean.rb +0 -9
  214. data/modules/active/sqlinjection/sql_numerical.rb +198 -0
  215. data/modules/active/sqlinjection/sqli_error.rb +0 -9
  216. data/modules/active/sqlinjection/sqli_timing.rb +220 -229
  217. data/modules/active/struts2/default_handler_ognl.rb +106 -115
  218. data/modules/active/struts2/include_params_ognl.rb +105 -114
  219. data/modules/active/xml/xml_xxe.rb +112 -123
  220. data/modules/active/xss/xss_ng.rb +214 -223
  221. data/modules/active/xss/xss_simple.rb +0 -9
  222. data/modules/passive/ajax.rb +68 -77
  223. data/modules/passive/autocomplete.rb +56 -65
  224. data/modules/passive/cookie_options.rb +0 -9
  225. data/modules/passive/cookie_xss.rb +0 -9
  226. data/modules/passive/detect_code.rb +0 -9
  227. data/modules/passive/detect_fileupload.rb +0 -9
  228. data/modules/passive/detect_infrastructure.rb +0 -9
  229. data/modules/passive/detect_one_time_tokens.rb +0 -9
  230. data/modules/passive/dirindexing.rb +0 -9
  231. data/modules/passive/disclosure_domino.rb +55 -64
  232. data/modules/passive/disclosure_emails.rb +0 -9
  233. data/modules/passive/disclosure_ipaddr.rb +55 -53
  234. data/modules/passive/filename_as_parameter.rb +0 -9
  235. data/modules/passive/form_spotter.rb +0 -9
  236. data/modules/passive/hidden_fields.rb +50 -59
  237. data/modules/passive/hotspots.rb +0 -9
  238. data/modules/passive/in_script_parameter.rb +0 -9
  239. data/modules/passive/json_web_token.rb +93 -0
  240. data/modules/passive/multiple_server_headers.rb +0 -9
  241. data/modules/passive/possible_login.rb +0 -9
  242. data/modules/passive/redirect_url.rb +0 -9
  243. data/modules/passive/redirectionz.rb +0 -9
  244. data/modules/passive/sap-headers.rb +56 -65
  245. data/modules/passive/xss_dom.rb +0 -9
  246. data/plugins/aem/aem.rb +11 -20
  247. data/plugins/aem/gui/main.rb +118 -127
  248. data/plugins/aem/gui/tree_view.rb +171 -180
  249. data/plugins/aem/lib/agent.rb +130 -138
  250. data/plugins/aem/lib/dispatcher.rb +45 -51
  251. data/plugins/aem/lib/engine.rb +177 -186
  252. data/plugins/catalog/catalog.rb +345 -355
  253. data/plugins/crawler/crawler.rb +4 -13
  254. data/plugins/crawler/gui.rb +5 -14
  255. data/plugins/crawler/gui/auth_frame.rb +270 -279
  256. data/plugins/crawler/gui/crawler_gui.rb +271 -276
  257. data/plugins/crawler/gui/general_settings_frame.rb +96 -105
  258. data/plugins/crawler/gui/hooks_frame.rb +80 -89
  259. data/plugins/crawler/gui/scope_frame.rb +50 -59
  260. data/plugins/crawler/gui/settings_tabbook.rb +38 -47
  261. data/plugins/crawler/gui/status_frame.rb +59 -68
  262. data/plugins/crawler/lib/bags.rb +18 -27
  263. data/plugins/crawler/lib/constants.rb +11 -20
  264. data/plugins/crawler/lib/engine.rb +488 -497
  265. data/plugins/crawler/lib/grabber.rb +68 -77
  266. data/plugins/crawler/lib/status.rb +71 -80
  267. data/plugins/crawler/lib/uri_mp.rb +12 -21
  268. data/plugins/filefinder/filefinder.rb +326 -333
  269. data/plugins/sqlmap/bin/test.rb +78 -87
  270. data/plugins/sqlmap/gui.rb +4 -13
  271. data/plugins/sqlmap/gui/main.rb +218 -227
  272. data/plugins/sqlmap/gui/options_frame.rb +97 -106
  273. data/plugins/sqlmap/lib/sqlmap_ctrl.rb +90 -100
  274. data/plugins/sqlmap/sqlmap.rb +2 -11
  275. data/plugins/sslchecker/cli/sslchecker_cli.rb +0 -9
  276. data/plugins/sslchecker/gui/cipher_table.rb +246 -254
  277. data/plugins/sslchecker/gui/gui.rb +258 -264
  278. data/plugins/sslchecker/gui/sslchecker.rb +4 -13
  279. data/plugins/sslchecker/lib/check.rb +127 -133
  280. data/plugins/wshell/gui/main.rb +119 -117
  281. data/plugins/wshell/lib/core.rb +38 -88
  282. data/plugins/wshell/wshell.rb +11 -20
  283. metadata +170 -164
@@ -1,12 +1,3 @@
1
- #.
2
- # edit_comment.rb
3
- #.
4
- # Copyright 2014 by siberas, http://www.siberas.de
5
- # This file is part of WATOBO (Web Application Tool Box) http://watobo.sourceforge.com
6
- # WATOBO is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation version 2 of the License.
7
- # WATOBO is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
8
- # You should have received a copy of the GNU General Public License along with WATOBO; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
9
-
10
1
  # @private
11
2
  module Watobo#:nodoc: all
12
3
  module Gui
@@ -1,12 +1,3 @@
1
- #.
2
- # edit_scope_dialog.rb
3
- #.
4
- # Copyright 2014 by siberas, http://www.siberas.de
5
- # This file is part of WATOBO (Web Application Tool Box) http://watobo.sourceforge.com
6
- # WATOBO is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation version 2 of the License.
7
- # WATOBO is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
8
- # You should have received a copy of the GNU General Public License along with WATOBO; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
9
-
10
1
  # @private
11
2
  module Watobo#:nodoc: all
12
3
  module Gui
@@ -1,114 +1,105 @@
1
- #.
2
- # export_dialog.rb
3
- #.
4
- # Copyright 2014 by siberas, http://www.siberas.de
5
- # This file is part of WATOBO (Web Application Tool Box) http://watobo.sourceforge.com
6
- # WATOBO is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation version 2 of the License.
7
- # WATOBO is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
8
- # You should have received a copy of the GNU General Public License along with WATOBO; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1
+ # @private
2
+ module Watobo#:nodoc: all
3
+ module Gui
4
+ class ExportDialog < FXDialogBox
5
+ def check_settings
9
6
 
10
- # @private
11
- module Watobo#:nodoc: all
12
- module Gui
13
- class ExportDialog < FXDialogBox
14
- def check_settings
15
-
16
- end
17
-
18
- def select_target_file()
19
- fname = "watobo_" + Time.now.to_i.to_s + ".xml"
20
- dst_file = File.join(@export_path, fname)
21
- filename = FXFileDialog.getSaveFilename(self, "Select Export File", dst_file)
22
- if filename != "" then
23
-
24
- @filename_txt.text = filename
25
-
26
- return true
27
- end
28
- return false
29
- end
30
-
31
- def onFinished
32
- getApp().stopModal(self, 1)
33
- self.hide()
34
- return 1
35
- end
36
-
37
- def initialize(owner)
38
- @export_path = Watobo.workspace_path
39
- super(owner, "Export Dialog", :opts => DECOR_TITLE|DECOR_BORDER|DECOR_CLOSE, :width => 350, :height => 250)
40
-
41
- main = FXVerticalFrame.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
42
-
43
- # frame = FXHorizontalFrame.new(gbframe, :opts => LAYOUT_FILL_X, :padding => 0)
44
- gbox = FXGroupBox.new(main, "Items", LAYOUT_SIDE_LEFT|FRAME_GROOVE|LAYOUT_FILL_X, 0, 0, 0, 80)
45
- gbframe = FXVerticalFrame.new(gbox, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :padding => 0)
46
- @export_chats = FXCheckButton.new(gbframe, "Chats", nil, 0, JUSTIFY_LEFT|JUSTIFY_TOP|ICON_BEFORE_TEXT)
47
- @export_chats.checkState = true
48
-
49
- @export_findings = FXCheckButton.new(gbframe, "Findings", nil, 0, JUSTIFY_LEFT|JUSTIFY_TOP|ICON_BEFORE_TEXT)
50
- @export_findings.checkState = true
51
-
52
-
53
- # frame = FXHorizontalFrame.new(gbframe, :opts => LAYOUT_FILL_X, :padding => 0)
54
- gbox = FXGroupBox.new(main, "Filter", LAYOUT_SIDE_LEFT|FRAME_GROOVE|LAYOUT_FILL_X, 0, 0, 0, 80)
55
- gbframe = FXVerticalFrame.new(gbox, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :padding => 0)
56
- @scope_only = FXCheckButton.new(gbframe, "Scope Only", nil, 0, JUSTIFY_LEFT|JUSTIFY_TOP|ICON_BEFORE_TEXT)
57
- @scope_only.checkState = true
58
-
59
- @ignore_fps = FXCheckButton.new(gbframe, "Ignore False-Positives", nil, 0, JUSTIFY_LEFT|JUSTIFY_TOP|ICON_BEFORE_TEXT)
60
- @ignore_fps.checkState = true
61
-
62
-
63
- frame = FXHorizontalFrame.new(main, :opts => LAYOUT_FILL_X)
64
- FXLabel.new(frame, "Save To:", nil, LAYOUT_TOP|JUSTIFY_RIGHT)
65
- @filename_txt = FXTextField.new(frame, 25, :opts => TEXTFIELD_NORMAL|LAYOUT_SIDE_RIGHT|LAYOUT_FILL_X)
66
- @select_btn = FXButton.new(frame, "Select")
67
-
68
- @select_btn.connect(SEL_COMMAND){ select_target_file }
69
-
70
- buttons_frame = FXHorizontalFrame.new(main, :opts => LAYOUT_FILL_X)
71
-
72
- @export_btn = FXButton.new(buttons_frame, "export" , nil, nil, :opts => BUTTON_NORMAL|LAYOUT_RIGHT)
73
- @export_btn.enable
74
- @export_btn.connect(SEL_COMMAND){ onExport }
75
-
76
- @finished_btn = FXButton.new(buttons_frame, "finished" , nil, nil, :opts => BUTTON_NORMAL|LAYOUT_RIGHT)
77
- @finished_btn.enable
78
- @finished_btn.connect(SEL_COMMAND){ onFinished }
79
-
80
- end
81
-
82
- private
83
-
84
- def onExport
85
- #return false unless check_export_target
86
- prefs = []
87
- prefs << :export_findings if @export_findings.checked?
88
- prefs << :export_chats if @export_chats.checked?
89
- prefs << :scope_only if @scope_only.checked?
90
- prefs << :ignore_fps if @ignore_fps.checked?
91
-
92
- puts "Export-Prefs: #{prefs.join(", ")}"
93
- file = @filename_txt.text
94
- unless file.strip.empty?
95
- begin
96
- File.open(file, "w"){|fh|
97
- xml = Watobo::Utils.exportXML(*prefs)
98
- fh.puts xml.to_xml
99
- }
100
- rescue => bang
101
- puts bang
102
- puts bang.backtrace
103
- end
104
- else
105
- #TODO
106
- end
107
- end
108
- end
109
- end
110
- end
111
-
112
- if __FILE__ == $0
113
- # TODO Generated stub
114
- end
7
+ end
8
+
9
+ def select_target_file()
10
+ fname = "watobo_" + Time.now.to_i.to_s + ".xml"
11
+ dst_file = File.join(@export_path, fname)
12
+ filename = FXFileDialog.getSaveFilename(self, "Select Export File", dst_file)
13
+ if filename != "" then
14
+
15
+ @filename_txt.text = filename
16
+
17
+ return true
18
+ end
19
+ return false
20
+ end
21
+
22
+ def onFinished
23
+ getApp().stopModal(self, 1)
24
+ self.hide()
25
+ return 1
26
+ end
27
+
28
+ def initialize(owner)
29
+ @export_path = Watobo.workspace_path
30
+ super(owner, "Export Dialog", :opts => DECOR_TITLE|DECOR_BORDER|DECOR_CLOSE, :width => 350, :height => 250)
31
+
32
+ main = FXVerticalFrame.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
33
+
34
+ # frame = FXHorizontalFrame.new(gbframe, :opts => LAYOUT_FILL_X, :padding => 0)
35
+ gbox = FXGroupBox.new(main, "Items", LAYOUT_SIDE_LEFT|FRAME_GROOVE|LAYOUT_FILL_X, 0, 0, 0, 80)
36
+ gbframe = FXVerticalFrame.new(gbox, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :padding => 0)
37
+ @export_chats = FXCheckButton.new(gbframe, "Chats", nil, 0, JUSTIFY_LEFT|JUSTIFY_TOP|ICON_BEFORE_TEXT)
38
+ @export_chats.checkState = true
39
+
40
+ @export_findings = FXCheckButton.new(gbframe, "Findings", nil, 0, JUSTIFY_LEFT|JUSTIFY_TOP|ICON_BEFORE_TEXT)
41
+ @export_findings.checkState = true
42
+
43
+
44
+ # frame = FXHorizontalFrame.new(gbframe, :opts => LAYOUT_FILL_X, :padding => 0)
45
+ gbox = FXGroupBox.new(main, "Filter", LAYOUT_SIDE_LEFT|FRAME_GROOVE|LAYOUT_FILL_X, 0, 0, 0, 80)
46
+ gbframe = FXVerticalFrame.new(gbox, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :padding => 0)
47
+ @scope_only = FXCheckButton.new(gbframe, "Scope Only", nil, 0, JUSTIFY_LEFT|JUSTIFY_TOP|ICON_BEFORE_TEXT)
48
+ @scope_only.checkState = true
49
+
50
+ @ignore_fps = FXCheckButton.new(gbframe, "Ignore False-Positives", nil, 0, JUSTIFY_LEFT|JUSTIFY_TOP|ICON_BEFORE_TEXT)
51
+ @ignore_fps.checkState = true
52
+
53
+
54
+ frame = FXHorizontalFrame.new(main, :opts => LAYOUT_FILL_X)
55
+ FXLabel.new(frame, "Save To:", nil, LAYOUT_TOP|JUSTIFY_RIGHT)
56
+ @filename_txt = FXTextField.new(frame, 25, :opts => TEXTFIELD_NORMAL|LAYOUT_SIDE_RIGHT|LAYOUT_FILL_X)
57
+ @select_btn = FXButton.new(frame, "Select")
58
+
59
+ @select_btn.connect(SEL_COMMAND){ select_target_file }
60
+
61
+ buttons_frame = FXHorizontalFrame.new(main, :opts => LAYOUT_FILL_X)
62
+
63
+ @export_btn = FXButton.new(buttons_frame, "export" , nil, nil, :opts => BUTTON_NORMAL|LAYOUT_RIGHT)
64
+ @export_btn.enable
65
+ @export_btn.connect(SEL_COMMAND){ onExport }
66
+
67
+ @finished_btn = FXButton.new(buttons_frame, "finished" , nil, nil, :opts => BUTTON_NORMAL|LAYOUT_RIGHT)
68
+ @finished_btn.enable
69
+ @finished_btn.connect(SEL_COMMAND){ onFinished }
70
+
71
+ end
72
+
73
+ private
74
+
75
+ def onExport
76
+ #return false unless check_export_target
77
+ prefs = []
78
+ prefs << :export_findings if @export_findings.checked?
79
+ prefs << :export_chats if @export_chats.checked?
80
+ prefs << :scope_only if @scope_only.checked?
81
+ prefs << :ignore_fps if @ignore_fps.checked?
82
+
83
+ puts "Export-Prefs: #{prefs.join(", ")}"
84
+ file = @filename_txt.text
85
+ unless file.strip.empty?
86
+ begin
87
+ File.open(file, "w"){|fh|
88
+ xml = Watobo::Utils.exportXML(*prefs)
89
+ fh.puts xml.to_xml
90
+ }
91
+ rescue => bang
92
+ puts bang
93
+ puts bang.backtrace
94
+ end
95
+ else
96
+ #TODO
97
+ end
98
+ end
99
+ end
100
+ end
101
+ end
102
+
103
+ if __FILE__ == $0
104
+ # TODO Generated stub
105
+ end
@@ -1,12 +1,3 @@
1
- #.
2
- # finding_info.rb
3
- #.
4
- # Copyright 2014 by siberas, http://www.siberas.de
5
- # This file is part of WATOBO (Web Application Tool Box) http://watobo.sourceforge.com
6
- # WATOBO is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation version 2 of the License.
7
- # WATOBO is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
8
- # You should have received a copy of the GNU General Public License along with WATOBO; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
9
-
10
1
  require 'fox16/colors'
11
2
  # @private
12
3
  module Watobo#:nodoc: all
@@ -1,20 +1,12 @@
1
- #.
2
- # findings_tree.rb
3
- #.
4
- # Copyright 2014 by siberas, http://www.siberas.de
5
- # This file is part of WATOBO (Web Application Tool Box) http://watobo.sourceforge.com
6
- # WATOBO is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation version 2 of the License.
7
- # WATOBO is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
8
- # You should have received a copy of the GNU General Public License along with WATOBO; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
9
-
10
1
  # @private
11
- module Watobo#:nodoc: all
2
+ module Watobo #:nodoc: all
12
3
  module Gui
13
4
  class FindingsTree < FXTreeList
14
5
  include Watobo::Constants
15
6
  include Watobo::Gui::Icons
16
7
 
17
8
  attr_accessor :project
9
+
18
10
  def subscribe(event, &callback)
19
11
  (@event_dispatcher_listeners[event] ||= []) << callback
20
12
  end
@@ -40,24 +32,24 @@ module Watobo#:nodoc: all
40
32
  false
41
33
  end
42
34
 
43
-
35
+
44
36
  def reload()
45
- self.clearItems
46
- @findings.clear
47
- Watobo::Findings.each do |fid, finding|
48
- addFinding(finding)
49
- end
50
- expand_findings
51
- @expandeds.each do |t|
52
- site, text = t.split("|")
53
- if( site = self.findItem(site, nil, SEARCH_FORWARD|SEARCH_NOWRAP) )
54
- if( node = self.findItem(text, site, SEARCH_FORWARD|SEARCH_NOWRAP) )
55
- self.expandTree(node)
56
- else
57
- @expandeds.delete t
58
- end
59
- end
60
- end
37
+ self.clearItems
38
+ @findings.clear
39
+ Watobo::Findings.each do |fid, finding|
40
+ addFinding(finding)
41
+ end
42
+ expand_findings
43
+ @expandeds.each do |t|
44
+ site, text = t.split("|")
45
+ if (site = self.findItem(site, nil, SEARCH_FORWARD|SEARCH_NOWRAP))
46
+ if (node = self.findItem(text, site, SEARCH_FORWARD|SEARCH_NOWRAP))
47
+ self.expandTree(node)
48
+ else
49
+ @expandeds.delete t
50
+ end
51
+ end
52
+ end
61
53
  end
62
54
 
63
55
  def useRegularIcons()
@@ -123,17 +115,17 @@ module Watobo#:nodoc: all
123
115
  site = nil
124
116
  # puts "add finding"
125
117
  if not hidden?(finding) then
126
- site = self.findItem(finding.request.site, nil,SEARCH_FORWARD|SEARCH_IGNORECASE)
118
+ site = self.findItem(finding.request.site, nil, SEARCH_FORWARD|SEARCH_IGNORECASE)
127
119
 
128
120
  if not site then
129
121
  # found new site
130
122
  site = self.appendItem(nil, finding.request.site, @icon_project, @icon_project)
131
123
  item = self.appendItem(site, "Vulnerabilities", @icon_vuln, @icon_vuln)
132
- self.setItemData(item, :finding_type )
124
+ self.setItemData(item, :finding_type)
133
125
  item = self.appendItem(site, "Hints", @icon_hints, @icon_hints)
134
- self.setItemData(item, :finding_type )
126
+ self.setItemData(item, :finding_type)
135
127
  item = self.appendItem(site, "Info", @icon_info, @icon_info)
136
- self.setItemData(item, :finding_type )
128
+ self.setItemData(item, :finding_type)
137
129
  #site = @findings_tree.moveItem(project.first,project,site)
138
130
  self.setItemData(site, :item_type_site)
139
131
 
@@ -142,46 +134,54 @@ module Watobo#:nodoc: all
142
134
  finding_type=""
143
135
 
144
136
  case finding.details[:type]
145
- when FINDING_TYPE_INFO
146
- finding_type = "Info"
147
- icon = @icon_info_info
148
-
149
- when FINDING_TYPE_HINT
150
- finding_type = "Hints"
151
- icon = @icon_hints_info
152
-
153
- when FINDING_TYPE_VULN
154
- finding_type = "Vulnerabilities"
155
- icon = @icon_vuln_bp
156
-
157
- if finding.details[:rating] == VULN_RATING_LOW
158
- icon = @icon_vuln_low
159
- # puts "low-rating-vuln"
160
- end
161
- if finding.details[:rating] == VULN_RATING_MEDIUM
162
- icon = @icon_vuln_medium
163
- end
164
- if finding.details[:rating] == VULN_RATING_HIGH
165
- icon = @icon_vuln_high
166
- end
167
- if finding.details[:rating] == VULN_RATING_CRITICAL
168
- icon = @icon_vuln_critical
169
- end
137
+ when FINDING_TYPE_INFO
138
+ finding_type = "Info"
139
+ icon = @icon_info_info
140
+
141
+ when FINDING_TYPE_HINT
142
+ finding_type = "Hints"
143
+ icon = @icon_hints_info
144
+
145
+ when FINDING_TYPE_VULN
146
+ finding_type = "Vulnerabilities"
147
+ icon = @icon_vuln_bp
148
+
149
+ if finding.details[:rating] == VULN_RATING_LOW
150
+ icon = @icon_vuln_low
151
+ # puts "low-rating-vuln"
152
+ end
153
+ if finding.details[:rating] == VULN_RATING_MEDIUM
154
+ icon = @icon_vuln_medium
155
+ end
156
+ if finding.details[:rating] == VULN_RATING_HIGH
157
+ icon = @icon_vuln_high
158
+ end
159
+ if finding.details[:rating] == VULN_RATING_CRITICAL
160
+ icon = @icon_vuln_critical
161
+ end
170
162
  end
171
163
 
172
164
  sub_tree = self.findItem(finding_type, site, SEARCH_FORWARD|SEARCH_IGNORECASE|SEARCH_NOWRAP)
173
165
  if sub_tree and sub_tree.parent == site and finding.details[:class]
166
+ class_item = nil
167
+
168
+ # don't use findItem here because of nested collisions
169
+ sub_tree.each do |c|
170
+ if c.text =~ /^#{Regexp.quote(finding.details[:class])}/
171
+ class_item = c
172
+ end
173
+ end
174
+ #class_item = self.findItem(finding.details[:class], sub_tree, SEARCH_FORWARD|SEARCH_IGNORECASE|SEARCH_NOWRAP|SEARCH_PREFIX)
174
175
 
175
- class_item = self.findItem(finding.details[:class], sub_tree, SEARCH_FORWARD|SEARCH_IGNORECASE|SEARCH_NOWRAP|SEARCH_PREFIX)
176
176
  if not class_item or class_item.parent != sub_tree
177
177
  class_item = self.appendItem(sub_tree, finding.details[:class], icon, icon)
178
- self.setItemData(class_item, :finding_class )
178
+ self.setItemData(class_item, :finding_class)
179
179
  end
180
180
  title_item = self.findItem(finding.details[:title], class_item, SEARCH_FORWARD|SEARCH_IGNORECASE|SEARCH_NOWRAP)
181
181
  if not title_item or title_item.parent != class_item
182
182
  title_item = self.appendItem(class_item, finding.details[:title], nil, nil)
183
- self.setItemData(title_item, :title )
184
- # puts finding.details[:title]
183
+ self.setItemData(title_item, :title)
184
+ # puts finding.details[:title]
185
185
  end
186
186
  # puts title_item
187
187
  resource = finding.request.path_ext
@@ -189,15 +189,15 @@ module Watobo#:nodoc: all
189
189
  request_item = self.findItem(resource, title_item, SEARCH_FORWARD|SEARCH_IGNORECASE|SEARCH_NOWRAP)
190
190
  if not request_item or request_item.parent != title_item
191
191
  text = "/" + resource
192
- request_item = self.appendItem(title_item, text)
193
- self.setItemData(request_item, finding)
192
+ request_item = self.appendItem(title_item, text)
193
+ self.setItemData(request_item, finding)
194
194
  end
195
-
195
+
196
196
  #
197
197
  unless class_item.text =~ / \(\d+\)$/
198
198
  class_item.text = class_item.text + " (#{class_item.numChildren})"
199
199
  else
200
- class_item.text = class_item.text.gsub(/ \(\d+\)$/, " (#{class_item.numChildren})")
200
+ class_item.text = class_item.text.gsub(/ \(\d+\)$/, " (#{class_item.numChildren})")
201
201
  end
202
202
  end
203
203
 
@@ -227,11 +227,11 @@ module Watobo#:nodoc: all
227
227
  useRegularIcons()
228
228
 
229
229
  @filtered_domains = Hash.new # domains which already have been filtered
230
-
230
+
231
231
  self.connect(SEL_CLIPBOARD_REQUEST) do
232
- setDNDData(FROM_CLIPBOARD, FXWindow.stringType, Fox.fxencodeStringData(@clipboard.to_s))
232
+ setDNDData(FROM_CLIPBOARD, FXWindow.stringType, Fox.fxencodeStringData(@clipboard.to_s))
233
233
  end
234
-
234
+
235
235
  self.connect(SEL_EXPANDED) do |sender, sel, item|
236
236
  parent = item
237
237
  while parent.parent
@@ -242,7 +242,7 @@ module Watobo#:nodoc: all
242
242
  @expandeds << node
243
243
  end
244
244
  end
245
-
245
+
246
246
  self.connect(SEL_COLLAPSED) do |sender, sel, item|
247
247
  parent = item
248
248
  while parent.parent
@@ -295,25 +295,23 @@ module Watobo#:nodoc: all
295
295
  unless event.moved?
296
296
  FXMenuPane.new(self) do |menu_pane|
297
297
  item = sender.getItemAt(event.win_x, event.win_y)
298
-
299
-
300
- unless item.nil?
298
+ unless item.nil?
301
299
 
302
300
  data = self.getItemData(item)
303
301
 
304
-
302
+
305
303
  unless self.itemLeaf?(item)
306
- FXMenuCommand.new(menu_pane, "expand tree" ).connect(SEL_COMMAND) {
304
+ FXMenuCommand.new(menu_pane, "expand tree").connect(SEL_COMMAND) {
307
305
  expandFullTree(item)
308
306
  }
309
307
 
310
- FXMenuCommand.new(menu_pane, "collapse tree" ).connect(SEL_COMMAND) {
308
+ FXMenuCommand.new(menu_pane, "collapse tree").connect(SEL_COMMAND) {
311
309
  self.collapseFullTree(item)
312
310
  }
313
- FXMenuSeparator.new(menu_pane)
314
- end
311
+ FXMenuSeparator.new(menu_pane)
315
312
  end
316
- target = FXMenuCheck.new(menu_pane, "show scope only" )
313
+ end
314
+ target = FXMenuCheck.new(menu_pane, "show scope only")
317
315
 
318
316
  target.check = @show_scope_only
319
317
 
@@ -322,7 +320,7 @@ module Watobo#:nodoc: all
322
320
  reload
323
321
  }
324
322
 
325
- target = FXMenuCheck.new(menu_pane, "hide false-positives" )
323
+ target = FXMenuCheck.new(menu_pane, "hide false-positives")
326
324
 
327
325
  target.check = @hide_false_positives
328
326
 
@@ -330,118 +328,113 @@ module Watobo#:nodoc: all
330
328
  @hide_false_positives = ts.checked?
331
329
  reload
332
330
  }
333
-
334
-
335
-
331
+
332
+
336
333
  unless item.nil?
337
334
 
338
335
  data = self.getItemData(item)
339
336
 
340
337
  FXMenuSeparator.new(menu_pane) unless data == :finding_type
341
-
338
+
342
339
 
343
340
  if data == :item_type_site then
344
- # FXMenuSeparator.new(menu_pane)
345
- FXMenuCommand.new(menu_pane, "add site to scope" ).connect(SEL_COMMAND) {
341
+ # FXMenuSeparator.new(menu_pane)
342
+ FXMenuCommand.new(menu_pane, "add site to scope").connect(SEL_COMMAND) {
346
343
  #notify(:add_site_to_scope, item.to_s)
347
344
  Watobo::Scope.add item.to_s
348
345
  reload
349
346
  }
350
- #
347
+ #
351
348
  elsif data == :title
352
- findings = []
353
- item.each do |ft|
354
- f = self.getItemData(ft)
355
- findings << f if f.is_a? Watobo::Finding
356
- end
357
-
358
- fp_submenu = FXMenuPane.new(self) do |sub|
359
-
360
-
349
+ findings = []
350
+ item.each do |ft|
351
+ f = self.getItemData(ft)
352
+ findings << f if f.is_a? Watobo::Finding
353
+ end
354
+
355
+ fp_submenu = FXMenuPane.new(self) do |sub|
361
356
 
362
- target = FXMenuCommand.new(sub, "Set False Positive" )
357
+
358
+ target = FXMenuCommand.new(sub, "Set False Positive")
363
359
  target.connect(SEL_COMMAND) {
364
-
365
-
366
- # puts "* False Positive #{findings.length}"
360
+
361
+ # puts "* False Positive #{findings.length}"
367
362
 
368
363
  # remember parent node to expand it later
369
364
  fclass = item.parent.text
370
365
  fcat = item.parent.parent.text
371
366
  fsite = item.parent.parent.parent.text
372
-
367
+
373
368
  puts ">> #{fsite} - #{fcat} - #{fclass} (#{fclass.object_id})"
374
-
369
+
375
370
  notify(:set_false_positive, findings)
376
-
371
+
377
372
  reload
378
-
373
+
379
374
  site_item = cat_item = class_item = nil
380
- site_item = self.findItem(fsite, nil,SEARCH_FORWARD|SEARCH_IGNORECASE)
381
-
382
- unless site_item.nil?
383
- self.expandTree(site_item)
384
- cat_item = self.findItem(fcat, site_item,SEARCH_FORWARD|SEARCH_IGNORECASE)
385
- end
386
-
387
- unless cat_item.nil?
388
- self.expandTree(cat_item)
389
- class_item = self.findItem(fclass, cat_item,SEARCH_FORWARD|SEARCH_IGNORECASE)
390
- end
391
-
392
-
393
- unless class_item.nil?
394
- puts "Expanding #{class_item} (#{class_item.object_id})-> #{cat_item} -> #{site_item}"
395
- self.expandTree(class_item)
375
+ site_item = self.findItem(fsite, nil, SEARCH_FORWARD|SEARCH_IGNORECASE)
376
+
377
+ unless site_item.nil?
378
+ self.expandTree(site_item)
379
+ cat_item = self.findItem(fcat, site_item, SEARCH_FORWARD|SEARCH_IGNORECASE)
380
+ end
381
+
382
+ unless cat_item.nil?
383
+ self.expandTree(cat_item)
384
+ class_item = self.findItem(fclass, cat_item, SEARCH_FORWARD|SEARCH_IGNORECASE)
385
+ end
386
+
387
+
388
+ unless class_item.nil?
389
+ puts "Expanding #{class_item} (#{class_item.object_id})-> #{cat_item} -> #{site_item}"
390
+ self.expandTree(class_item)
396
391
  else
397
392
  puts "Could not find tree item for #{class_item} (#{class_item.object_id})-> #{cat_item} -> #{site_item}"
398
393
  end
399
-
400
-
401
394
  }
402
- target = FXMenuCommand.new(sub, "Unset False Positive" )
395
+ target = FXMenuCommand.new(sub, "Unset False Positive")
403
396
  target.connect(SEL_COMMAND) {
404
397
  fclass = item.parent.text
405
398
  fcat = item.parent.parent.text
406
399
  fsite = item.parent.parent.parent.text
407
-
400
+
408
401
  notify(:unset_false_positive, findings)
409
402
  reload
410
- site_item = cat_item = class_item = nil
411
- site_item = self.findItem(fsite, nil,SEARCH_FORWARD|SEARCH_IGNORECASE)
412
-
413
- unless site_item.nil?
414
- self.expandTree(site_item)
415
- cat_item = self.findItem(fcat, site_item,SEARCH_FORWARD|SEARCH_IGNORECASE)
416
- end
417
-
418
- unless cat_item.nil?
419
- self.expandTree(cat_item)
420
- class_item = self.findItem(fclass, cat_item,SEARCH_FORWARD|SEARCH_IGNORECASE)
421
- end
422
-
423
-
424
- unless class_item.nil?
425
- puts "Expanding #{class_item} (#{class_item.object_id})-> #{cat_item} -> #{site_item}"
426
- self.expandTree(class_item)
403
+ site_item = cat_item = class_item = nil
404
+ site_item = self.findItem(fsite, nil, SEARCH_FORWARD|SEARCH_IGNORECASE)
405
+
406
+ unless site_item.nil?
407
+ self.expandTree(site_item)
408
+ cat_item = self.findItem(fcat, site_item, SEARCH_FORWARD|SEARCH_IGNORECASE)
409
+ end
410
+
411
+ unless cat_item.nil?
412
+ self.expandTree(cat_item)
413
+ class_item = self.findItem(fclass, cat_item, SEARCH_FORWARD|SEARCH_IGNORECASE)
414
+ end
415
+
416
+
417
+ unless class_item.nil?
418
+ puts "Expanding #{class_item} (#{class_item.object_id})-> #{cat_item} -> #{site_item}"
419
+ self.expandTree(class_item)
427
420
  else
428
421
  puts "Could not find tree item for #{class_item} (#{class_item.object_id})-> #{cat_item} -> #{site_item}"
429
422
  end
430
423
  }
431
424
 
432
425
  FXMenuSeparator.new(sub)
433
-
434
- FXMenuCommand.new(sub, "Purge - NO UNDO!" ).connect(SEL_COMMAND) {
426
+
427
+ FXMenuCommand.new(sub, "Purge - NO UNDO!").connect(SEL_COMMAND) {
435
428
  notify(:purge_findings, findings)
436
429
  reload
437
- }
430
+ }
438
431
  end
439
- FXMenuCascade.new(menu_pane, "All \"#{item}\"", nil, fp_submenu)
440
-
441
- FXMenuSeparator.new(menu_pane)
442
- info = FXMenuCommand.new(menu_pane, "Details..." )
432
+ FXMenuCascade.new(menu_pane, "All \"#{item}\"", nil, fp_submenu)
433
+
434
+ FXMenuSeparator.new(menu_pane)
435
+ info = FXMenuCommand.new(menu_pane, "Details...")
443
436
  info.connect(SEL_COMMAND) {
444
- #@interface.showFindingDetails(item.data)}
437
+ #@interface.showFindingDetails(item.data)}
445
438
  notify(:show_finding_details, findings.first)
446
439
  }
447
440
 
@@ -449,75 +442,75 @@ module Watobo#:nodoc: all
449
442
  #puts "FINDING_CLASS"
450
443
  # COPY SUBMENU
451
444
  findings = []
452
- item.each do |c|
453
- c.each do |ft|
454
- f = self.getItemData(ft)
455
- findings << f if f.is_a? Watobo::Finding
456
- end
445
+ item.each do |c|
446
+ c.each do |ft|
447
+ f = self.getItemData(ft)
448
+ findings << f if f.is_a? Watobo::Finding
449
+ end
450
+
451
+ end
457
452
 
458
- end
459
-
460
453
  fp_submenu = FXMenuPane.new(self) do |sub|
461
-
462
- target = FXMenuCommand.new(sub, "Copy URLs" )
454
+
455
+ target = FXMenuCommand.new(sub, "Copy URLs")
463
456
  target.connect(SEL_COMMAND) {
464
-
465
- urls = []
466
- findings.each do |f|
467
- proto = f.request.proto
468
- site = f.request.site
469
- path = f.request.path
470
- urls << "#{proto}://#{site}/#{path}"
471
- end
472
- types = [ FXWindow.stringType ]
473
- if acquireClipboard(types)
474
- @clipboard = urls.uniq.join("\n")
475
- end
457
+
458
+ urls = []
459
+ findings.each do |f|
460
+ proto = f.request.proto
461
+ site = f.request.site
462
+ path = f.request.path
463
+ urls << "#{proto}://#{site}/#{path}"
464
+ end
465
+ types = [FXWindow.stringType]
466
+ if acquireClipboard(types)
467
+ @clipboard = urls.uniq.join("\n")
468
+ end
476
469
  }
477
470
 
478
- target = FXMenuCommand.new(sub, "Set False Positive" )
471
+ target = FXMenuCommand.new(sub, "Set False Positive")
479
472
  target.connect(SEL_COMMAND) {
480
-
473
+
481
474
  fcat = item.parent.text
482
475
  fsite = item.parent.parent.text
483
-
476
+
484
477
  notify(:set_false_positive, findings)
485
478
  reload
486
- site_item = cat_item = class_item = nil
487
- site_item = self.findItem(fsite, nil,SEARCH_FORWARD|SEARCH_IGNORECASE)
488
-
489
- unless site_item.nil?
490
- self.expandTree(site_item)
491
- cat_item = self.findItem(fcat, site_item,SEARCH_FORWARD|SEARCH_IGNORECASE)
492
- end
493
-
494
- unless cat_item.nil?
495
- self.expandTree(cat_item)
496
- end
479
+ site_item = cat_item = class_item = nil
480
+ site_item = self.findItem(fsite, nil, SEARCH_FORWARD|SEARCH_IGNORECASE)
481
+
482
+ unless site_item.nil?
483
+ self.expandTree(site_item)
484
+ cat_item = self.findItem(fcat, site_item, SEARCH_FORWARD|SEARCH_IGNORECASE)
485
+ end
486
+
487
+ unless cat_item.nil?
488
+ self.expandTree(cat_item)
489
+ end
497
490
 
498
491
  }
499
- target = FXMenuCommand.new(sub, "Unset False Positive" )
492
+ target = FXMenuCommand.new(sub, "Unset False Positive")
500
493
  target.connect(SEL_COMMAND) {
501
494
  fcat = item.parent.text
502
495
  fsite = item.parent.parent.text
503
496
  notify(:unset_false_positive, findings)
504
497
  reload
505
498
  site_item = cat_item = class_item = nil
506
- site_item = self.findItem(fsite, nil,SEARCH_FORWARD|SEARCH_IGNORECASE)
507
-
508
- unless site_item.nil?
509
- self.expandTree(site_item)
510
- cat_item = self.findItem(fcat, site_item,SEARCH_FORWARD|SEARCH_IGNORECASE)
511
- end
512
-
513
- unless cat_item.nil?
514
- self.expandTree(cat_item)
515
- end
499
+ site_item = self.findItem(fsite, nil, SEARCH_FORWARD|SEARCH_IGNORECASE)
500
+
501
+ unless site_item.nil?
502
+ self.expandTree(site_item)
503
+ cat_item = self.findItem(fcat, site_item, SEARCH_FORWARD|SEARCH_IGNORECASE)
504
+ end
505
+
506
+ unless cat_item.nil?
507
+ self.expandTree(cat_item)
508
+ end
516
509
  }
517
510
 
518
511
  FXMenuSeparator.new(sub)
519
- FXMenuCommand.new(sub, "Purge - NO UNDO!" ).connect(SEL_COMMAND) {
520
-
512
+ FXMenuCommand.new(sub, "Purge - NO UNDO!").connect(SEL_COMMAND) {
513
+
521
514
  puts "* purge findings #{findings.length}"
522
515
 
523
516
  notify(:purge_findings, findings)
@@ -526,32 +519,32 @@ module Watobo#:nodoc: all
526
519
 
527
520
  end
528
521
  FXMenuCascade.new(menu_pane, "All \"#{item}\"", nil, fp_submenu)
529
-
530
- FXMenuSeparator.new(menu_pane)
531
- info = FXMenuCommand.new(menu_pane, "Details..." )
522
+
523
+ FXMenuSeparator.new(menu_pane)
524
+ info = FXMenuCommand.new(menu_pane, "Details...")
532
525
  info.connect(SEL_COMMAND) {
533
- #@interface.showFindingDetails(item.data)}
526
+ #@interface.showFindingDetails(item.data)}
534
527
  notify(:show_finding_details, findings.first)
535
528
  }
536
529
 
537
530
  elsif data.is_a? Watobo::Finding then
538
- FXMenuCommand.new(menu_pane, "Copy URL" ).connect(SEL_COMMAND){
539
- types = [ FXWindow.stringType ]
540
- if acquireClipboard(types)
541
- @clipboard = item.data.request.url.to_s
542
- end
543
-
531
+ FXMenuCommand.new(menu_pane, "Copy URL").connect(SEL_COMMAND) {
532
+ types = [FXWindow.stringType]
533
+ if acquireClipboard(types)
534
+ @clipboard = item.data.request.url.to_s
535
+ end
536
+
544
537
  }
545
- # FXMenuSeparator.new(menu_pane)
546
- doManual = FXMenuCommand.new(menu_pane, "Manual Request.." )
538
+ # FXMenuSeparator.new(menu_pane)
539
+ doManual = FXMenuCommand.new(menu_pane, "Manual Request..")
547
540
  doManual.connect(SEL_COMMAND) {
548
- # @interface.open_manual_request_editor(item.data)
541
+ # @interface.open_manual_request_editor(item.data)
549
542
  notify(:open_manual_request, item.data)
550
543
 
551
544
  }
552
- info = FXMenuCommand.new(menu_pane, "Details..." )
545
+ info = FXMenuCommand.new(menu_pane, "Details...")
553
546
  info.connect(SEL_COMMAND) {
554
- #@interface.showFindingDetails(item.data)}
547
+ #@interface.showFindingDetails(item.data)}
555
548
  notify(:show_finding_details, item.data)
556
549
  }
557
550
  end
@@ -566,16 +559,16 @@ module Watobo#:nodoc: all
566
559
  end
567
560
 
568
561
  private
569
-
562
+
570
563
  def expand_findings()
571
564
  self.each do |site|
572
565
  expandTree site
573
- %w(Vulnerabilities Hints Info).each do |item|
574
- f = self.findItem(item, site,SEARCH_FORWARD|SEARCH_IGNORECASE)
575
- expandTree(f) unless site.nil?
576
- end
566
+ %w(Vulnerabilities Hints Info).each do |item|
567
+ f = self.findItem(item, site, SEARCH_FORWARD|SEARCH_IGNORECASE)
568
+ expandTree(f) unless site.nil?
569
+ end
577
570
  end
578
-
571
+
579
572
  end
580
573
 
581
574
  def notify(event, *args)
@@ -586,6 +579,6 @@ module Watobo#:nodoc: all
586
579
  end
587
580
  end
588
581
  end
589
- # namespace end
582
+ # namespace end
590
583
  end
591
584
  end