watobo 0.9.8.677

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (260) hide show
  1. data/bin/watobo_gui.rb +39 -0
  2. data/certificates/cert.pem +19 -0
  3. data/certificates/privkey.pem +15 -0
  4. data/certificates/watobo_dh.key +5 -0
  5. data/config/datastore.yml +5 -0
  6. data/config/forwarding_proxy.yml +12 -0
  7. data/config/general.yml +4 -0
  8. data/config/gui.yml +23 -0
  9. data/config/interceptor.yml +16 -0
  10. data/config/scan_policy.yml +13 -0
  11. data/config/scanner.yml +34 -0
  12. data/icons/Add.ico +0 -0
  13. data/icons/Add_24x24.ico +0 -0
  14. data/icons/Bandwidth.ico +0 -0
  15. data/icons/Bandwidth_24x24.ico +0 -0
  16. data/icons/Mr. Bomb.ico +0 -0
  17. data/icons/Mr. Bomb_16x16.ico +0 -0
  18. data/icons/Mr. Bomb_24x24.ico +0 -0
  19. data/icons/Orange Ball.ico +0 -0
  20. data/icons/Orange Ball_16x16.ico +0 -0
  21. data/icons/Orange Ball_24x24.ico +0 -0
  22. data/icons/Pause.ico +0 -0
  23. data/icons/Play.ico +0 -0
  24. data/icons/Play_24x24.ico +0 -0
  25. data/icons/Red Ball.ico +0 -0
  26. data/icons/Red Ball_16x16.ico +0 -0
  27. data/icons/Red Ball_24x24.ico +0 -0
  28. data/icons/Run.ico +0 -0
  29. data/icons/Stop.ico +0 -0
  30. data/icons/Stop_24x24.ico +0 -0
  31. data/icons/Terminal.ico +0 -0
  32. data/icons/Transfer.ico +0 -0
  33. data/icons/Transfer_16x16.ico +0 -0
  34. data/icons/User.ico +0 -0
  35. data/icons/User_16x16.ico +0 -0
  36. data/icons/User_24x24.ico +0 -0
  37. data/icons/Web Browser.ico +0 -0
  38. data/icons/Web Browser_16x16.ico +0 -0
  39. data/icons/Write Document.ico +0 -0
  40. data/icons/Yellow Ball.ico +0 -0
  41. data/icons/Yellow Ball_16x16.ico +0 -0
  42. data/icons/Yellow Ball_24x24.ico +0 -0
  43. data/icons/advanced.ico +0 -0
  44. data/icons/advanced_16x16.ico +0 -0
  45. data/icons/advanced_24x24.ico +0 -0
  46. data/icons/applications.ico +0 -0
  47. data/icons/applications_16x16.ico +0 -0
  48. data/icons/applications_24x24.ico +0 -0
  49. data/icons/browser_16x16.ico +0 -0
  50. data/icons/browser_24x24.ico +0 -0
  51. data/icons/burn.ico +0 -0
  52. data/icons/burn_16x16.ico +0 -0
  53. data/icons/burn_24x24.ico +0 -0
  54. data/icons/calculator.ico +0 -0
  55. data/icons/calculator_24x24.ico +0 -0
  56. data/icons/cb_checked.ico +0 -0
  57. data/icons/cb_checked_orange.ico +0 -0
  58. data/icons/cb_unchecked.ico +0 -0
  59. data/icons/coin_24x24.ico +0 -0
  60. data/icons/conversation.ico +0 -0
  61. data/icons/conversation_24x24.ico +0 -0
  62. data/icons/engine.ico +0 -0
  63. data/icons/filter.ico +0 -0
  64. data/icons/folder.ico +0 -0
  65. data/icons/folder_16x16.ico +0 -0
  66. data/icons/fuzzer_16x16.ico +0 -0
  67. data/icons/fuzzer_24x24.ico +0 -0
  68. data/icons/go-down_16x16.png +0 -0
  69. data/icons/go-up_16x16.png +0 -0
  70. data/icons/help.ico +0 -0
  71. data/icons/help_16x16.ico +0 -0
  72. data/icons/help_24x24.ico +0 -0
  73. data/icons/iChat.ico +0 -0
  74. data/icons/iChat_16x16.ico +0 -0
  75. data/icons/iChat_24x24.ico +0 -0
  76. data/icons/icons.txt +3 -0
  77. data/icons/info.ico +0 -0
  78. data/icons/info_16x16.ico +0 -0
  79. data/icons/info_24x24.ico +0 -0
  80. data/icons/interceptor_24x24.ico +0 -0
  81. data/icons/lock.ico +0 -0
  82. data/icons/lock_12x12.ico +0 -0
  83. data/icons/lock_16x16.ico +0 -0
  84. data/icons/monitor.ico +0 -0
  85. data/icons/plugin.ico +0 -0
  86. data/icons/plugin_24x24.ico +0 -0
  87. data/icons/scan_16x16.png +0 -0
  88. data/icons/send.ico +0 -0
  89. data/icons/server.ico +0 -0
  90. data/icons/server_16x16.ico +0 -0
  91. data/icons/siberas_logo_x24.gif +0 -0
  92. data/icons/tag_blue_32x32.ico +0 -0
  93. data/icons/watobo-48x48.png +0 -0
  94. data/icons/watobo-logo.png +0 -0
  95. data/icons/watobo.ico +0 -0
  96. data/lib/watobo/adapters/data_store.rb +38 -0
  97. data/lib/watobo/adapters/file/file_store.rb +211 -0
  98. data/lib/watobo/adapters/session_store.rb +27 -0
  99. data/lib/watobo/adapters.rb +26 -0
  100. data/lib/watobo/config.rb +143 -0
  101. data/lib/watobo/constants.rb +92 -0
  102. data/lib/watobo/core/active_check.rb +404 -0
  103. data/lib/watobo/core/cookie.rb +69 -0
  104. data/lib/watobo/core/fuzz_gen.rb +160 -0
  105. data/lib/watobo/core/http_socket.rb +142 -0
  106. data/lib/watobo/core/interceptor.rb +729 -0
  107. data/lib/watobo/core/passive_check.rb +141 -0
  108. data/lib/watobo/core/project.rb +1058 -0
  109. data/lib/watobo/core/scanner.rb +396 -0
  110. data/lib/watobo/core/session.rb +1320 -0
  111. data/lib/watobo/core/simple_ca.rb +393 -0
  112. data/lib/watobo/core.rb +34 -0
  113. data/lib/watobo/defaults.rb +40 -0
  114. data/lib/watobo/external/diff/lcs/array.rb +42 -0
  115. data/lib/watobo/external/diff/lcs/block.rb +72 -0
  116. data/lib/watobo/external/diff/lcs/callbacks.rb +343 -0
  117. data/lib/watobo/external/diff/lcs/change.rb +190 -0
  118. data/lib/watobo/external/diff/lcs/hunk.rb +279 -0
  119. data/lib/watobo/external/diff/lcs/ldiff.rb +247 -0
  120. data/lib/watobo/external/diff/lcs/string.rb +40 -0
  121. data/lib/watobo/external/diff/lcs.rb +1124 -0
  122. data/lib/watobo/external/ntlm/ntlm.rb +797 -0
  123. data/lib/watobo/externals.rb +28 -0
  124. data/lib/watobo/framework/create_project.rb +55 -0
  125. data/lib/watobo/framework/init.rb +149 -0
  126. data/lib/watobo/framework/init_modules.rb +116 -0
  127. data/lib/watobo/framework/license_text.rb +50 -0
  128. data/lib/watobo/framework.rb +26 -0
  129. data/lib/watobo/gui/about_watobo.rb +68 -0
  130. data/lib/watobo/gui/browser_preview.rb +460 -0
  131. data/lib/watobo/gui/certificate_dialog.rb +132 -0
  132. data/lib/watobo/gui/chat_diff.rb +415 -0
  133. data/lib/watobo/gui/chatviewer_frame.rb +427 -0
  134. data/lib/watobo/gui/checkboxtree.rb +221 -0
  135. data/lib/watobo/gui/checks_policy_frame.rb +123 -0
  136. data/lib/watobo/gui/client_cert_dialog.rb +227 -0
  137. data/lib/watobo/gui/confirm_scan_dialog.rb +67 -0
  138. data/lib/watobo/gui/conversation_table.rb +386 -0
  139. data/lib/watobo/gui/conversation_table_ctrl.rb +175 -0
  140. data/lib/watobo/gui/csrf_token_dialog.rb +446 -0
  141. data/lib/watobo/gui/dashboard.rb +341 -0
  142. data/lib/watobo/gui/define_scope_frame.rb +380 -0
  143. data/lib/watobo/gui/edit_comment.rb +70 -0
  144. data/lib/watobo/gui/edit_scope_dialog.rb +69 -0
  145. data/lib/watobo/gui/finding_info.rb +212 -0
  146. data/lib/watobo/gui/findings_tree.rb +459 -0
  147. data/lib/watobo/gui/full_scan_dialog.rb +269 -0
  148. data/lib/watobo/gui/fuzzer_gui.rb +1522 -0
  149. data/lib/watobo/gui/hex_viewer.rb +106 -0
  150. data/lib/watobo/gui/interceptor_gui.rb +994 -0
  151. data/lib/watobo/gui/interceptor_settings_dialog.rb +201 -0
  152. data/lib/watobo/gui/log_viewer.rb +97 -0
  153. data/lib/watobo/gui/login_wizzard.rb +301 -0
  154. data/lib/watobo/gui/main_window.rb +1815 -0
  155. data/lib/watobo/gui/manual_request_editor.rb +1105 -0
  156. data/lib/watobo/gui/master_pw_dialog.rb +142 -0
  157. data/lib/watobo/gui/password_policy_dialog.rb +98 -0
  158. data/lib/watobo/gui/plugin/base.rb +82 -0
  159. data/lib/watobo/gui/plugin_board.rb +95 -0
  160. data/lib/watobo/gui/preferences_dialog.rb +116 -0
  161. data/lib/watobo/gui/progress_window.rb +102 -0
  162. data/lib/watobo/gui/project_wizzard.rb +369 -0
  163. data/lib/watobo/gui/proxy_dialog.rb +550 -0
  164. data/lib/watobo/gui/quick_scan_dialog.rb +242 -0
  165. data/lib/watobo/gui/request_editor.rb +480 -0
  166. data/lib/watobo/gui/save_chat_dialog.rb +158 -0
  167. data/lib/watobo/gui/scanner_settings_dialog.rb +360 -0
  168. data/lib/watobo/gui/select_chat_dialog.rb +169 -0
  169. data/lib/watobo/gui/session_management_dialog.rb +688 -0
  170. data/lib/watobo/gui/sites_tree.rb +347 -0
  171. data/lib/watobo/gui/status_bar.rb +88 -0
  172. data/lib/watobo/gui/table_editor.rb +445 -0
  173. data/lib/watobo/gui/tagless_viewer.rb +62 -0
  174. data/lib/watobo/gui/templates/plugin.rb +80 -0
  175. data/lib/watobo/gui/templates/plugin2.rb +103 -0
  176. data/lib/watobo/gui/text_viewer.rb +247 -0
  177. data/lib/watobo/gui/transcoder_window.rb +215 -0
  178. data/lib/watobo/gui/utils/gui_utils.rb +129 -0
  179. data/lib/watobo/gui/utils/init_icons.rb +106 -0
  180. data/lib/watobo/gui/utils/load_icons.rb +54 -0
  181. data/lib/watobo/gui/utils/load_plugins.rb +94 -0
  182. data/lib/watobo/gui/utils/master_password.rb +90 -0
  183. data/lib/watobo/gui/utils/save_default_settings.rb +99 -0
  184. data/lib/watobo/gui/utils/save_project_settings.rb +21 -0
  185. data/lib/watobo/gui/utils/save_proxy_settings.rb +45 -0
  186. data/lib/watobo/gui/utils/save_session_settings.rb +21 -0
  187. data/lib/watobo/gui/utils/session_history.rb +134 -0
  188. data/lib/watobo/gui/workspace_dialog.rb +89 -0
  189. data/lib/watobo/gui/www_auth_dialog.rb +348 -0
  190. data/lib/watobo/gui/xml_viewer_frame.rb +114 -0
  191. data/lib/watobo/gui.rb +139 -0
  192. data/lib/watobo/mixins/httpparser.rb +664 -0
  193. data/lib/watobo/mixins/request_parser.rb +210 -0
  194. data/lib/watobo/mixins/shapers.rb +345 -0
  195. data/lib/watobo/mixins/transcoders.rb +88 -0
  196. data/lib/watobo/mixins.rb +32 -0
  197. data/lib/watobo/utils/check_regex.rb +36 -0
  198. data/lib/watobo/utils/copy_object.rb +29 -0
  199. data/lib/watobo/utils/crypto.rb +74 -0
  200. data/lib/watobo/utils/expand_range.rb +45 -0
  201. data/lib/watobo/utils/file_management.rb +73 -0
  202. data/lib/watobo/utils/load_chat.rb +219 -0
  203. data/lib/watobo/utils/load_icon.rb +47 -0
  204. data/lib/watobo/utils/print_debug.rb +34 -0
  205. data/lib/watobo/utils/response_hash.rb +143 -0
  206. data/lib/watobo/utils/secure_eval.rb +57 -0
  207. data/lib/watobo/utils/text2request.rb +96 -0
  208. data/lib/watobo/utils.rb +32 -0
  209. data/lib/watobo.rb +76 -0
  210. data/modules/active/Apache/mod_status.rb +123 -0
  211. data/modules/active/Flash/crossdomain.rb +102 -0
  212. data/modules/active/directories/dirwalker.rb +89 -0
  213. data/modules/active/discovery/fileextensions.rb +151 -0
  214. data/modules/active/discovery/http_methods.rb +135 -0
  215. data/modules/active/domino/domino_db.lst +164 -0
  216. data/modules/active/domino/domino_db.rb +128 -0
  217. data/modules/active/fileinclusion/lfi_simple.rb +134 -0
  218. data/modules/active/jboss/jboss_basic.rb +119 -0
  219. data/modules/active/sap/business_objects.rb +73 -0
  220. data/modules/active/sap/its_commands.rb +101 -0
  221. data/modules/active/sap/its_service_parameter.rb +105 -0
  222. data/modules/active/sap/its_services.rb +103 -0
  223. data/modules/active/sap/its_xss.rb +98 -0
  224. data/modules/active/sqlinjection/sql_boolean.rb +262 -0
  225. data/modules/active/sqlinjection/sqli_simple.rb +205 -0
  226. data/modules/active/xss/xss_simple.rb +179 -0
  227. data/modules/passive/cookie_options.rb +97 -0
  228. data/modules/passive/cookie_xss.rb +85 -0
  229. data/modules/passive/detect_code.rb +89 -0
  230. data/modules/passive/detect_fileupload.rb +80 -0
  231. data/modules/passive/detect_infrastructure.rb +98 -0
  232. data/modules/passive/detect_one_time_tokens.rb +86 -0
  233. data/modules/passive/dirindexing.rb +81 -0
  234. data/modules/passive/disclosure_emails.rb +82 -0
  235. data/modules/passive/disclosure_ipaddr.rb +87 -0
  236. data/modules/passive/filename_as_parameter.rb +85 -0
  237. data/modules/passive/form_spotter.rb +75 -0
  238. data/modules/passive/hotspots.rb +86 -0
  239. data/modules/passive/in_script_parameter.rb +92 -0
  240. data/modules/passive/multiple_server_headers.rb +98 -0
  241. data/modules/passive/possible_login.rb +134 -0
  242. data/modules/passive/redirect_url.rb +88 -0
  243. data/modules/passive/redirectionz.rb +96 -0
  244. data/modules/passive/xss_dom.rb +91 -0
  245. data/plugins/catalog/catalog.ico +0 -0
  246. data/plugins/catalog/catalog.rb +726 -0
  247. data/plugins/catalog/db_tests +6483 -0
  248. data/plugins/catalog/db_variables +29 -0
  249. data/plugins/filefinder/dbs/hbci.db +12 -0
  250. data/plugins/filefinder/filefinder.rb +602 -0
  251. data/plugins/sslchecker/cli/sslchecker_cli.rb +21 -0
  252. data/plugins/sslchecker/gui/cipher_table.rb +260 -0
  253. data/plugins/sslchecker/gui/gui.rb +245 -0
  254. data/plugins/sslchecker/gui/sslchecker.rb +26 -0
  255. data/plugins/sslchecker/icons/green_16x16.ico +0 -0
  256. data/plugins/sslchecker/icons/grey_16x16.ico +0 -0
  257. data/plugins/sslchecker/icons/red_16x16.ico +0 -0
  258. data/plugins/sslchecker/icons/sslchecker.ico +0 -0
  259. data/plugins/sslchecker/lib/check.rb +117 -0
  260. metadata +317 -0
@@ -0,0 +1,360 @@
1
+ # .
2
+ # scanner_settings_dialog.rb
3
+ #
4
+ # Copyright 2012 by siberas, http://www.siberas.de
5
+ #
6
+ # This file is part of WATOBO (Web Application Tool Box)
7
+ # http://watobo.sourceforge.com
8
+ #
9
+ # WATOBO is free software; you can redistribute it and/or modify
10
+ # it under the terms of the GNU General Public License as published by
11
+ # the Free Software Foundation version 2 of the License.
12
+ #
13
+ # WATOBO is distributed in the hope that it will be useful,
14
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ # GNU General Public License for more details.
17
+ #
18
+ # You should have received a copy of the GNU General Public License
19
+ # along with WATOBO; if not, write to the Free Software
20
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
+ # .
22
+ module Watobo
23
+ module Gui
24
+
25
+ class ScannerSettingsFrame < FXVerticalFrame
26
+
27
+ def getSettings()
28
+ settings = Hash.new
29
+ settings[:max_parallel_checks] = @max_par_checks.value
30
+ settings[:smart_scan] = @enable_smart_scan.checked?
31
+ settings[:run_passive_checks] = @enable_passive_checks.checked?
32
+
33
+ settings[:scanlog_dir] = ''
34
+ if @log_scan_cb.checked? then
35
+ settings[:scanlog_dir] = @scanlog_dir_dt.value
36
+ end
37
+
38
+ dummy = []
39
+ @nup_list.each do |nup|
40
+ dummy.push nup.data
41
+ end
42
+ settings[:non_unique_parms] = dummy
43
+
44
+ dummy = []
45
+ @exp_list.each do |exp|
46
+ dummy.push exp.data
47
+ end
48
+ settings[:excluded_parms] = dummy
49
+
50
+ dummy = []
51
+ @cep_list.each do |exp|
52
+ dummy.push exp.data
53
+ end
54
+ settings[:custom_error_patterns] = dummy
55
+
56
+ return settings
57
+ end
58
+
59
+ def addItem(list_box, item)
60
+ if item != "" then
61
+ list_item = list_box.appendItem("#{item}")
62
+ list_box.setItemData(list_item, item)
63
+ list_box.sortItems()
64
+ end
65
+ end
66
+
67
+ def selectScanlogDirectory(sender, sel, item)
68
+ workspace_dt = FXFileDialog.getOpenDirectory(self, "Select Scanlog Directory", @scanlog_dir_dt.value)
69
+ if workspace_dt != "" then
70
+ if File.exists?(workspace_dt) then
71
+ @scanlog_dir_dt.value = workspace_dt
72
+ @scanlog_dir_text.handle(self, FXSEL(SEL_UPDATE, 0), nil)
73
+ end
74
+ end
75
+ end
76
+
77
+ def removePattern(list_box)
78
+ index = list_box.currentItem
79
+ if index >= 0
80
+ list_box.removeItem(index)
81
+ end
82
+ end
83
+
84
+ def initialize(owner, scan_settings, opts)
85
+ super(owner, opts)
86
+
87
+ @settings = scan_settings
88
+ # puts @settings[:scanlog_dir]
89
+ scroller = FXScrollWindow.new(self, :opts => SCROLLERS_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y)
90
+ scroll_area = FXVerticalFrame.new(scroller, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :padding => 0)
91
+
92
+ gbox = FXGroupBox.new(scroll_area, "Request Limit", LAYOUT_SIDE_RIGHT|FRAME_GROOVE|LAYOUT_FILL_X, 0, 0, 0, 0)
93
+ gbox_frame = FXVerticalFrame.new(gbox, :opts => LAYOUT_SIDE_TOP|PACK_UNIFORM_WIDTH)
94
+ FXLabel.new(gbox_frame, "Maximum limit of parallel requests.")
95
+ frame = FXHorizontalFrame.new(gbox_frame, :opts => LAYOUT_FILL_X)
96
+ FXLabel.new(frame, "Max. Par. Request:")
97
+ @max_par_checks = FXDataTarget.new(0)
98
+ @max_par_checks.value = @settings[:max_parallel_checks]
99
+ mpc = FXTextField.new(frame, 3, @max_par_checks, FXDataTarget::ID_VALUE, :opts => JUSTIFY_RIGHT|FRAME_GROOVE|FRAME_SUNKEN)
100
+ mpc.handle(self, FXSEL(SEL_UPDATE, 0), nil)
101
+
102
+ gbox = FXGroupBox.new(scroll_area, "Smart Scan ", LAYOUT_SIDE_LEFT|FRAME_GROOVE|LAYOUT_FILL_X, 0, 0, 0, 80)
103
+ gbframe = FXVerticalFrame.new(gbox, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :padding => 0)
104
+ frame = FXHorizontalFrame.new(gbframe, :opts => LAYOUT_FILL_X, :padding => 0)
105
+ @enable_smart_scan = FXCheckButton.new(frame, "Enable Smart Scan ", nil, 0, JUSTIFY_LEFT|JUSTIFY_TOP|ICON_BEFORE_TEXT)
106
+ @enable_smart_scan.checkState = @settings[:smart_scan]
107
+
108
+ #@edit_uniq_parms_btn = FXButton.new(frame, "Non-Unique Parms", :opts => LAYOUT_RIGHT|FRAME_RAISED)
109
+
110
+ fxtext = FXText.new(gbframe, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|TEXT_WORDWRAP)
111
+ fxtext.backColor = fxtext.parent.backColor
112
+ fxtext.disable
113
+ text = "If Smart Scan is enabled the scanner will reduce the number of checks."
114
+ fxtext.setText(text)
115
+
116
+
117
+ gbox = FXGroupBox.new(scroll_area, "Passive Checks", LAYOUT_SIDE_LEFT|FRAME_GROOVE|LAYOUT_FILL_X, 0, 0, 0, 150)
118
+ gbframe = FXVerticalFrame.new(gbox, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :padding => 0)
119
+ frame = FXVerticalFrame.new(gbframe, :opts => LAYOUT_FILL_X, :padding => 0)
120
+ @enable_passive_checks = FXCheckButton.new(frame, "Enable Passive Checks", nil, 0, JUSTIFY_LEFT|JUSTIFY_TOP|ICON_BEFORE_TEXT)
121
+ @enable_passive_checks.checkState = @settings[:run_passive_checks]
122
+ fxtext = FXText.new(gbframe, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|TEXT_WORDWRAP)
123
+ fxtext.backColor = fxtext.parent.backColor
124
+ fxtext.disable
125
+ text = "Run Passive Checks on each single test request.\nWARNING!!!\nThis may produce a lot of False Positive Results."
126
+ fxtext.setText(text)
127
+
128
+
129
+
130
+ gbframe = FXGroupBox.new(scroll_area, "Non-Unique-Parameters", LAYOUT_SIDE_RIGHT|FRAME_GROOVE|LAYOUT_FILL_X, 0, 0, 0, 0)
131
+ frame = FXVerticalFrame.new(gbframe, :opts => LAYOUT_FILL_X, :padding => 0)
132
+ fxtext = FXText.new(frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|TEXT_WORDWRAP)
133
+ fxtext.backColor = fxtext.parent.backColor
134
+ fxtext.disable
135
+ text = "Parameters which have a special function should be ignored for smart-scanning, e.g. if you app has parms like 'action=AddUser' or 'action=DeleteUser' you should add 'action' to this list."
136
+ fxtext.setText(text)
137
+ input_frame = FXHorizontalFrame.new(frame, :opts => LAYOUT_FILL_X)
138
+ @nup_dt = FXDataTarget.new('')
139
+ @nup_field = FXTextField.new(input_frame, 20, :target => @nup_dt, :selector => FXDataTarget::ID_VALUE, :opts => TEXTFIELD_NORMAL|LAYOUT_SIDE_LEFT|LAYOUT_FILL_X)
140
+ @rem_nup_btn = FXButton.new(input_frame, "Remove" , :opts => BUTTON_NORMAL|LAYOUT_RIGHT)
141
+ @add_nup_btn = FXButton.new(input_frame, "Add" , :opts => BUTTON_NORMAL|LAYOUT_RIGHT)
142
+
143
+ list_frame = FXVerticalFrame.new(frame, :opts => LAYOUT_FILL_X|FRAME_SUNKEN, :padding => 0)
144
+ @nup_list = FXList.new(list_frame, :opts => LIST_EXTENDEDSELECT|LAYOUT_FILL_X|LAYOUT_FILL_Y)
145
+ @nup_list.numVisible = 5
146
+
147
+ @nup_list.connect(SEL_COMMAND){ |sender, sel, item|
148
+ @nup_dt.value = sender.getItemText(item)
149
+ @nup_field.handle(self, FXSEL(SEL_UPDATE, 0), nil)
150
+ }
151
+
152
+ @settings[:non_unique_parms].each do |nup|
153
+ addItem(@nup_list, nup)
154
+ end
155
+
156
+ @rem_nup_btn.connect(SEL_COMMAND){ |sender, sel, item|
157
+ removePattern(@nup_list) if @nup_dt.value != ''
158
+ @nup_dt.value = ''
159
+ @nup_field.handle(self, FXSEL(SEL_UPDATE, 0), nil)
160
+ }
161
+ @add_nup_btn.connect(SEL_COMMAND){ |sender, sel, item|
162
+
163
+ addItem(@nup_list, @nup_dt.value) if @nup_dt.value != ''
164
+ @nup_dt.value = ''
165
+ @nup_field.handle(self, FXSEL(SEL_UPDATE, 0), nil)
166
+ }
167
+
168
+ @nup_dt.connect(SEL_COMMAND){ |sender, sel, item|
169
+
170
+ addItem(@nup_list, @nup_dt.value) if @nup_dt.value != ''
171
+ @nup_dt.value = ''
172
+ @nup_field.handle(self, FXSEL(SEL_UPDATE, 0), nil)
173
+ }
174
+
175
+
176
+ @exp_dt = FXDataTarget.new('')
177
+ exp_frame = FXGroupBox.new(scroll_area, "Excluded Parameters", LAYOUT_SIDE_RIGHT|FRAME_GROOVE|LAYOUT_FILL_X, 0, 0, 0, 0)
178
+ frame = FXVerticalFrame.new(exp_frame, :opts => LAYOUT_FILL_X, :padding => 0)
179
+ fxtext = FXText.new(frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|TEXT_WORDWRAP)
180
+ fxtext.backColor = fxtext.parent.backColor
181
+ fxtext.disable
182
+ text = "Parameters which should not be tested during a scan."
183
+ fxtext.setText(text)
184
+ input_frame = FXHorizontalFrame.new(frame, :opts => LAYOUT_FILL_X)
185
+ @exp_dt = FXDataTarget.new('')
186
+ @exp_field = FXTextField.new(input_frame, 20, :target => @exp_dt, :selector => FXDataTarget::ID_VALUE, :opts => TEXTFIELD_NORMAL|LAYOUT_SIDE_LEFT|LAYOUT_FILL_X)
187
+ @rem_exp_btn = FXButton.new(input_frame, "Remove" , :opts => BUTTON_NORMAL|LAYOUT_RIGHT)
188
+ @add_exp_btn = FXButton.new(input_frame, "Add" , :opts => BUTTON_NORMAL|LAYOUT_RIGHT)
189
+
190
+ list_frame = FXVerticalFrame.new(frame, :opts => LAYOUT_FILL_X|FRAME_SUNKEN, :padding => 0)
191
+ @exp_list = FXList.new(list_frame, :opts => LIST_EXTENDEDSELECT|LAYOUT_FILL_X|LAYOUT_FILL_Y)
192
+ @exp_list.numVisible = 5
193
+
194
+ @settings[:excluded_parms].each do |exp|
195
+ addItem(@exp_list, exp)
196
+ end
197
+
198
+ @exp_list.connect(SEL_COMMAND){ |sender, sel, item|
199
+ @exp_dt.value = sender.getItemText(item)
200
+ @exp_field.handle(self, FXSEL(SEL_UPDATE, 0), nil)
201
+ }
202
+
203
+ @rem_exp_btn.connect(SEL_COMMAND){ |sender, sel, item|
204
+ removePattern(@exp_list) if @exp_dt.value != ''
205
+ @exp_dt.value = ''
206
+ @exp_field.handle(self, FXSEL(SEL_UPDATE, 0), nil)
207
+ }
208
+ @add_exp_btn.connect(SEL_COMMAND){ |sender, sel, item|
209
+
210
+ addItem(@exp_list, @exp_dt.value) if @exp_dt.value != ''
211
+ @exp_dt.value = ''
212
+ @exp_field.handle(self, FXSEL(SEL_UPDATE, 0), nil)
213
+ }
214
+
215
+ @exp_dt.connect(SEL_COMMAND){ |sender, sel, item|
216
+
217
+ addItem(@exp_list, @exp_dt.value) if @exp_dt.value != ''
218
+ @exp_dt.value = ''
219
+ @exp_field.handle(self, FXSEL(SEL_UPDATE, 0), nil)
220
+ }
221
+ #############################################################
222
+ @cep_dt = FXDataTarget.new('')
223
+ cep_frame = FXGroupBox.new(scroll_area, "Custom Error Pages", LAYOUT_SIDE_RIGHT|FRAME_GROOVE|LAYOUT_FILL_X, 0, 0, 0, 0)
224
+ frame = FXVerticalFrame.new(cep_frame, :opts => LAYOUT_FILL_X, :padding => 0)
225
+ fxtext = FXText.new(frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|TEXT_WORDWRAP)
226
+ fxtext.backColor = fxtext.parent.backColor
227
+ fxtext.disable
228
+ text = "Regex-Pattern to identify custom error pages. Header and Body will be checked."
229
+ fxtext.setText(text)
230
+ input_frame = FXHorizontalFrame.new(frame, :opts => LAYOUT_FILL_X)
231
+ @cep_dt = FXDataTarget.new('')
232
+ @cep_field = FXTextField.new(input_frame, 20, :target => @cep_dt, :selector => FXDataTarget::ID_VALUE, :opts => TEXTFIELD_NORMAL|LAYOUT_SIDE_LEFT|LAYOUT_FILL_X)
233
+ @rem_cep_btn = FXButton.new(input_frame, "Remove" , :opts => BUTTON_NORMAL|LAYOUT_RIGHT)
234
+ @add_cep_btn = FXButton.new(input_frame, "Add" , :opts => BUTTON_NORMAL|LAYOUT_RIGHT)
235
+
236
+ list_frame = FXVerticalFrame.new(frame, :opts => LAYOUT_FILL_X|FRAME_SUNKEN, :padding => 0)
237
+ @cep_list = FXList.new(list_frame, :opts => LIST_EXTENDEDSELECT|LAYOUT_FILL_X|LAYOUT_FILL_Y)
238
+ @cep_list.numVisible = 5
239
+
240
+ @settings[:custom_error_patterns].each do |exp|
241
+ addItem(@cep_list, exp)
242
+ end
243
+
244
+ @cep_list.connect(SEL_COMMAND){ |sender, sel, item|
245
+ @cep_dt.value = sender.getItemText(item)
246
+ @cep_field.handle(self, FXSEL(SEL_UPDATE, 0), nil)
247
+ }
248
+
249
+ @rem_cep_btn.connect(SEL_COMMAND){ |sender, sel, item|
250
+ removePattern(@cep_list) if @cep_dt.value != ''
251
+ @cep_dt.value = ''
252
+ @cep_field.handle(self, FXSEL(SEL_UPDATE, 0), nil)
253
+ }
254
+ @add_cep_btn.connect(SEL_COMMAND){ |sender, sel, item|
255
+
256
+ addItem(@cep_list, @cep_dt.value) if @cep_dt.value != ''
257
+ @cep_dt.value = ''
258
+ @cep_field.handle(self, FXSEL(SEL_UPDATE, 0), nil)
259
+ }
260
+
261
+ @cep_dt.connect(SEL_COMMAND){ |sender, sel, item|
262
+
263
+ addItem(@cep_list, @cep_dt.value) if @cep_dt.value != ''
264
+ @cep_dt.value = ''
265
+ @cep_field.handle(self, FXSEL(SEL_UPDATE, 0), nil)
266
+ }
267
+ #############################################################
268
+
269
+ gbox = FXGroupBox.new(scroll_area, "Logging", LAYOUT_SIDE_LEFT|FRAME_GROOVE|LAYOUT_FILL_X, 0, 0, 0, 150)
270
+ scan_opt_frame = FXVerticalFrame.new(gbox, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :padding => 0)
271
+ @log_scan_cb = FXCheckButton.new(scan_opt_frame, "Log Scan", nil, 0, JUSTIFY_LEFT|JUSTIFY_TOP|ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP)
272
+ @log_scan_cb.checkState = false
273
+ @log_scan_cb.connect(SEL_COMMAND) do |sender, sel, item|
274
+ if @log_scan_cb.checked? then
275
+ @scanlog_dir_text.enabled = true
276
+ @scanlog_dir_label.enabled = true
277
+ @scanlog_dir_btn.enable
278
+ else
279
+ @scanlog_dir_text.enabled = false
280
+ @scanlog_dir_label.enabled = false
281
+ @scanlog_dir_btn.disable
282
+ end
283
+ end
284
+
285
+
286
+ @scanlog_dir_dt = FXDataTarget.new('')
287
+ unless @settings[:scanlog_dir].nil? then @scanlog_dir_dt.value = @settings[:scanlog_dir] if File.exist?(@settings[:scanlog_dir]); end
288
+ @scanlog_dir_label = FXLabel.new(scan_opt_frame, "Scan-Log Directory:" )
289
+ scanlog_frame = FXHorizontalFrame.new(scan_opt_frame,:opts => LAYOUT_FILL_X|LAYOUT_SIDE_TOP)
290
+ @scanlog_dir_text = FXTextField.new(scanlog_frame, 20,
291
+ :target => @scanlog_dir_dt, :selector => FXDataTarget::ID_VALUE,
292
+ :opts => TEXTFIELD_NORMAL|LAYOUT_FILL_COLUMN)
293
+ @scanlog_dir_text.handle(self, FXSEL(SEL_UPDATE, 0), nil)
294
+ @scanlog_dir_btn = FXButton.new(scanlog_frame, "Change")
295
+ @scanlog_dir_btn.connect(SEL_COMMAND, method(:selectScanlogDirectory))
296
+
297
+ @scanlog_dir_text.enabled = false
298
+ @scanlog_dir_label.enabled = false
299
+ @scanlog_dir_btn.disable
300
+ end
301
+
302
+ end
303
+
304
+ #
305
+ # Class: SelectNonUniqueParmsDialog
306
+ #
307
+ class ScannerSettingsDialog < FXDialogBox
308
+
309
+ include Responder
310
+ attr :scanner_settings
311
+
312
+
313
+ def onAccept(sender, sel, event)
314
+
315
+ @scanner_settings = @scannerSettingsFrame.getSettings()
316
+
317
+ getApp().stopModal(self, 1)
318
+ self.hide()
319
+ return 1
320
+ end
321
+
322
+
323
+
324
+ def initialize(owner, scanner_settings, prefs)
325
+ super(owner, "Scanner Settings", DECOR_TITLE|DECOR_BORDER, :width => 400, :height => 500)
326
+ @scanner_settings = scanner_settings
327
+ FXMAPFUNC(SEL_COMMAND, ID_ACCEPT, :onAccept)
328
+
329
+
330
+ base_frame = FXVerticalFrame.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
331
+
332
+ # puts "create scopeframe with scope:"
333
+ # @project.scope
334
+ # @defineScopeFrame = DefineScopeFrame.new(base_frame, @project.listSites(), YAML.load(YAML.dump(@project.scope)), prefs)
335
+ @scannerSettingsFrame = ScannerSettingsFrame.new(base_frame, @scanner_settings, :opts => SCROLLERS_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y)
336
+
337
+ buttons_frame = FXHorizontalFrame.new(base_frame,
338
+ :opts => LAYOUT_FILL_X|LAYOUT_SIDE_TOP)
339
+
340
+ @finishButton = FXButton.new(buttons_frame, "Accept" , nil, nil, :opts => BUTTON_NORMAL|LAYOUT_RIGHT)
341
+ @finishButton.enable
342
+ @finishButton.connect(SEL_COMMAND) do |sender, sel, item|
343
+ #self.handle(self, FXSEL(SEL_COMMAND, ID_CANCEL), nil)
344
+ self.handle(self, FXSEL(SEL_COMMAND, ID_ACCEPT), nil)
345
+ end
346
+
347
+ @cancelButton = FXButton.new(buttons_frame, "Cancel" ,
348
+ :target => self, :selector => FXDialogBox::ID_CANCEL,
349
+ :opts => BUTTON_NORMAL|LAYOUT_RIGHT)
350
+
351
+
352
+ end
353
+ end
354
+ end
355
+ end
356
+
357
+
358
+ if __FILE__ == $0
359
+ # TODO Generated stub
360
+ end
@@ -0,0 +1,169 @@
1
+ # .
2
+ # select_chat_dialog.rb
3
+ #
4
+ # Copyright 2012 by siberas, http://www.siberas.de
5
+ #
6
+ # This file is part of WATOBO (Web Application Tool Box)
7
+ # http://watobo.sourceforge.com
8
+ #
9
+ # WATOBO is free software; you can redistribute it and/or modify
10
+ # it under the terms of the GNU General Public License as published by
11
+ # the Free Software Foundation version 2 of the License.
12
+ #
13
+ # WATOBO is distributed in the hope that it will be useful,
14
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ # GNU General Public License for more details.
17
+ #
18
+ # You should have received a copy of the GNU General Public License
19
+ # along with WATOBO; if not, write to the Free Software
20
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
+ # .
22
+ module Watobo
23
+ module Gui
24
+ class SelectChatDialog < FXDialogBox
25
+ include Watobo::Gui::Utils
26
+ attr :selection
27
+ def chatClicked(item)
28
+ begin
29
+ @request_viewer.setText('')
30
+ @response_viewer.setText('')
31
+ #row = sender.getCurrentRow
32
+ row = item.row
33
+ if row >= 0 then
34
+ @chatTable.selectRow(row)
35
+ chatid = @chatTable.getRowText(row).to_i
36
+ # @logText.appendText("selected ID: (#{chatid})\n")
37
+ @chat_list.each do |chat|
38
+ if chat.id == chatid then
39
+ @sel_chat = chatid
40
+
41
+ showChat(chat)
42
+ break
43
+ end
44
+ end
45
+ end
46
+ rescue => bang
47
+ puts "!!!ERROR: onTableClick"
48
+ puts bang
49
+ puts "!!!"
50
+
51
+ end
52
+ 0
53
+ end
54
+
55
+ def onTableClick(sender, sel, item)
56
+ chatClicked(item)
57
+ end
58
+
59
+ def onTableDoubleClick(sender, sel, item)
60
+ chatClicked(item)
61
+ addSelection()
62
+ end
63
+
64
+ def showChat(chat)
65
+ @request_viewer.setText(cleanupHTTP(chat.request))
66
+
67
+ @response_viewer.setText(cleanupHTTP(chat.response))
68
+ end
69
+
70
+ def selectChat(sender, sel, item)
71
+ addSelection()
72
+ end
73
+
74
+ def updateTable()
75
+ dummy = @chat_list
76
+ unless @project.nil?
77
+
78
+ if @show_scope_only.checked?
79
+
80
+ dummy = @chat_list.select{ |x|
81
+ @project.siteInScope?(x.request.site)
82
+ }
83
+ end
84
+
85
+ end
86
+ @chatTable.showConversation(dummy)
87
+
88
+ end
89
+
90
+ def addSelection()
91
+ if @sel_chat then
92
+ if @selection.value == '' then
93
+ @selection.value = @sel_chat.to_s
94
+ else
95
+ @selection.value = @selection.value + "," + @sel_chat.to_s
96
+ end
97
+ @selection_text.handle(self, FXSEL(SEL_UPDATE, 0), nil)
98
+ end
99
+ end
100
+
101
+ def initialize(owner, title, chat_list=[], project=nil)
102
+ # @chat_selection = []
103
+ @project = project
104
+ @selection = FXDataTarget.new('')
105
+ @chat_list = chat_list
106
+ @sel_chat = nil
107
+ super(owner, title, DECOR_ALL, :width=>600, :height=>600)
108
+ main_frame = FXVerticalFrame.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :padding => 0)
109
+ splitter = FXSplitter.new(main_frame, LAYOUT_SIDE_TOP|LAYOUT_FILL_X|SPLITTER_VERTICAL|LAYOUT_FILL_Y|SPLITTER_TRACKING)
110
+ top_frame = FXVerticalFrame.new(splitter, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_NONE, :height => 300, :padding => 0)
111
+
112
+ preview_frame = FXVerticalFrame.new(splitter, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :height => 300, :padding => 0)
113
+
114
+ unless @project.nil?
115
+ quick_filter_gb = FXGroupBox.new(top_frame, "Quick Filter", FRAME_GROOVE|LAYOUT_FILL_X)
116
+ quick_filter_frame = FXHorizontalFrame.new(quick_filter_gb, :opts => FRAME_NONE|LAYOUT_FILL_X, :padding => 0)
117
+ @show_scope_only = FXCheckButton.new(quick_filter_frame, "scope only", nil, 0, ICON_BEFORE_TEXT|LAYOUT_SIDE_LEFT)
118
+ @show_scope_only.setCheck(false)
119
+ @show_scope_only.connect(SEL_COMMAND) { updateTable }
120
+
121
+ # @show_referer = FXCheckButton.new(quick_filter_frame, "show referer", nil, 0, ICON_BEFORE_TEXT|LAYOUT_SIDE_LEFT)
122
+ # @show_referer.setCheck(false)
123
+ # @show_referer.connect(SEL_COMMAND) { updateTable }
124
+ end
125
+
126
+ table_frame = FXVerticalFrame.new(top_frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_GROOVE)
127
+
128
+ @chatTable = ConversationTable.new(table_frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
129
+ @chatTable.connect(SEL_CLICKED, method(:onTableClick))
130
+ @chatTable.connect(SEL_DOUBLECLICKED, method(:onTableDoubleClick))
131
+
132
+
133
+ selection_frame = FXHorizontalFrame.new(table_frame, :opts => LAYOUT_FILL_X)
134
+ button = FXButton.new(selection_frame, "Select Chat >", nil, nil, 0, FRAME_RAISED|FRAME_THICK|LAYOUT_LEFT)
135
+ button.connect(SEL_COMMAND, method(:selectChat))
136
+
137
+ @selection_text = FXTextField.new(selection_frame, 20, @selection, FXDataTarget::ID_VALUE, FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_X)
138
+ #FXLabel.new(chat_filter_frame, "Filter")
139
+
140
+ updateTable()
141
+
142
+ tabBook = FXTabBook.new(preview_frame, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y|LAYOUT_RIGHT, :padding => 0)
143
+
144
+ req_tab = FXTabItem.new(tabBook, "Request", nil)
145
+ #@request_viewer = Watobo::Gui::ChatViewer.new(tabBook, FRAME_THICK|FRAME_RAISED|LAYOUT_FILL_X|LAYOUT_FILL_Y)
146
+ text_frame = FXVerticalFrame.new(tabBook, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN|FRAME_THICK)
147
+ @request_viewer = FXText.new(text_frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
148
+ @request_viewer.editable = false
149
+
150
+ resp_tab = FXTabItem.new(tabBook, "Response", nil)
151
+ text_frame = FXVerticalFrame.new(tabBook, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN|FRAME_THICK)
152
+ @response_viewer = FXText.new(text_frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
153
+ @response_viewer.editable = false
154
+
155
+ # @response_viewer = Watobo::Gui::ChatViewer.new(tabBook, LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_GROOVE)
156
+
157
+ button_frame = FXHorizontalFrame.new(main_frame, :opts => LAYOUT_FILL_X)
158
+ FXButton.new(button_frame, "OK" ,
159
+ :target => self, :selector => FXDialogBox::ID_ACCEPT,
160
+ :opts => BUTTON_NORMAL|LAYOUT_RIGHT)
161
+ FXButton.new(button_frame, "Cancel" ,
162
+ :target => self, :selector => FXDialogBox::ID_CANCEL,
163
+ :opts => BUTTON_NORMAL|LAYOUT_RIGHT)
164
+
165
+ end
166
+ end
167
+ #--
168
+ end
169
+ end