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,29 @@
1
+ # .
2
+ # copy_object.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 Utils
24
+ def Utils.copyObject(object)
25
+ copy = secure_eval(YAML.load(YAML.dump(object.inspect)))
26
+ return copy
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,74 @@
1
+ # .
2
+ # crypto.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
+ require 'openssl'
23
+ require 'digest/sha1'
24
+ require 'base64'
25
+
26
+ # Thanks to : http://rails.brentsowers.com/2007/12/aes-encryption-and-decryption-in-ruby.html
27
+ module Watobo
28
+ module Crypto
29
+
30
+ def Crypto.encryptPassword(plain_password, secret)
31
+ Base64.encode64(Crypto.encrypt(plain_password, secret)).strip
32
+ end
33
+
34
+ def Crypto.decryptPassword(b64_encrypted_password, secret)
35
+ ep = Base64.decode64(b64_encrypted_password)
36
+ decrypt(ep, secret)
37
+ end
38
+
39
+
40
+ def Crypto.decrypt(encrypted_data, pass, iv=nil, cipher_type="AES-256-CBC")
41
+ aes = OpenSSL::Cipher::Cipher.new(cipher_type)
42
+ aes.decrypt
43
+ aes.key = Digest::SHA256.digest(pass)
44
+ aes.iv = iv if iv != nil
45
+ aes.update(encrypted_data) + aes.final
46
+ end
47
+
48
+ def Crypto.encrypt(data, pass, iv=nil, cipher_type="AES-256-CBC")
49
+ aes = OpenSSL::Cipher::Cipher.new(cipher_type)
50
+ aes.encrypt
51
+ aes.key = Digest::SHA256.digest(pass)
52
+ aes.iv = iv if iv != nil
53
+ aes.update(data) + aes.final
54
+ end
55
+ end
56
+ end
57
+
58
+ if __FILE__ == $0
59
+ # TODO Generated stub
60
+ # cipher = "AES-256-CBC"
61
+ pass = "password"
62
+ #iv = nil
63
+
64
+ plaintext = "S3cr3t"
65
+ 1000.times do |i|
66
+ plaintext += (rand(65)+35).chr + "OK"
67
+ encrypted = Crypto.encrypt(plaintext, pass)
68
+ puts encrypted
69
+
70
+ puts "* now decrypt again"
71
+ plain = Crypto.decrypt(Base64.decode64(encrypted), pass)
72
+ puts plain
73
+ end
74
+ end
@@ -0,0 +1,45 @@
1
+ # .
2
+ # expand_range.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 Utils
24
+ # expand range creates an array out of
25
+ def self.expand_range(pattern)
26
+ vals = pattern.split(",")
27
+
28
+ result = []
29
+ vals.each do |v|
30
+ v.strip!
31
+ if v =~ /^(\d+)$/ then
32
+ result.push $1.to_i
33
+ elsif v =~ /^(\d+)-(\d+)$/
34
+ start = $1
35
+ stop = $2
36
+ dummy = (start..stop).to_a
37
+ result.concat dummy
38
+ end
39
+ end
40
+ result.uniq!
41
+ return result
42
+ end
43
+
44
+ end
45
+ end
@@ -0,0 +1,73 @@
1
+ # .
2
+ # file_management.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 Utils
24
+ # e.g, save_settings("test-settings.test", 0, "@saved_settings", @saved_settings)
25
+
26
+ def Utils.save_settings(file, settings)
27
+ begin
28
+ if settings.is_a? Hash
29
+ File.open(file, "w") { |fh|
30
+ YAML.dump(settings, fh)
31
+ }
32
+ return true
33
+ else
34
+ return false
35
+ end
36
+ rescue => bang
37
+ puts bang
38
+ puts bang.backtrace if $DEBUG
39
+ end
40
+ return false
41
+ end
42
+
43
+ def Utils.loadSettings(file)
44
+
45
+ if File.exists?(file) then
46
+ # exp = File.open(file).read
47
+ # settings = secure_eval(exp)
48
+ settings = nil
49
+ File.open(file,"r") { |fh|
50
+ settings = YAML.load(fh)
51
+ }
52
+ return settings
53
+ end
54
+ end
55
+
56
+ def Utils.saveChat(chat, filename)
57
+ chat_data = {
58
+ :request => chat.request.map{|x| x.inspect},
59
+ :response => chat.response.map{|x| x.inspect},
60
+ }
61
+
62
+ chat_data.update(chat.settings)
63
+ if File.exists?(filename) then
64
+ puts "Updating #{filename}"
65
+ File.open(filename, "w") { |fh|
66
+ YAML.dump(chat_data, fh)
67
+ }
68
+ chat.file = filename
69
+ end
70
+ end
71
+
72
+ end
73
+ end
@@ -0,0 +1,219 @@
1
+ # .
2
+ # load_chat.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 Utils
24
+
25
+ # loadChat returns a chat object imported from a yaml file
26
+ def Utils.loadChatYAML(file)
27
+ begin
28
+ if File.exists?(file) then
29
+ # p file
30
+ cdata = YAML.load(File.open(file,"rb").read)
31
+ return nil unless cdata
32
+ # need to restore CRLF
33
+ cdata[:request].map!{|l|
34
+ if l =~ /^\"/ then
35
+ x = secure_eval(l)
36
+ else
37
+ x = l.strip + "\r\n"
38
+ x = l if l == cdata[:request].last
39
+ end
40
+
41
+ x
42
+ }
43
+
44
+ cdata[:response].map!{|l|
45
+ if l =~ /^\"/ then
46
+ x = secure_eval(l)
47
+ else
48
+ x = l.strip + "\r\n"
49
+ x = l if l == cdata[:response].last
50
+ end
51
+
52
+ x
53
+ }
54
+ # puts cdata
55
+ # puts cdata.class
56
+
57
+ settings = Hash.new
58
+ settings.update cdata
59
+ settings.delete(:response)
60
+ settings.delete(:request)
61
+
62
+ chat = Watobo::Chat.new(cdata[:request], cdata[:response], settings)
63
+ chat.file = file
64
+
65
+ return chat
66
+
67
+ else
68
+ puts "* file #{file} not found"
69
+ return nil
70
+ end
71
+ rescue => bang
72
+ puts "! could not load chat from file #{file}"
73
+ puts cdata
74
+ #puts bang
75
+ #puts bang.backtrace if $DEBUG
76
+ end
77
+ end
78
+
79
+
80
+ def Utils.loadFindingYAML(file)
81
+ # puts file
82
+ if File.exists?(file) then
83
+ begin
84
+ fdata = YAML.load(File.open(file,"rb").read)
85
+ # need to restore CRLF
86
+ return nil unless fdata
87
+ fdata[:request].map!{|l|
88
+ if l =~ /^\"/ then
89
+ x = secure_eval(l)
90
+ else
91
+ x = l.strip + "\r\n"
92
+ x = l if l == fdata[:request].last
93
+ end
94
+ x
95
+ }
96
+
97
+ fdata[:response].map!{|l|
98
+ if l =~ /^\"/ then
99
+ x = secure_eval(l)
100
+ else
101
+ x = l.strip + "\r\n"
102
+ x = l if l == fdata[:response].last
103
+ end
104
+ x
105
+ }
106
+ finding = Watobo::Finding.new(fdata[:request], fdata[:response], fdata[:details])
107
+
108
+ return finding
109
+ rescue => bang
110
+ puts bang
111
+ puts "could not load finding #{file}"
112
+ return nil
113
+ end
114
+ else
115
+ # puts "* file #{file} not found"
116
+ return nil
117
+ end
118
+ end
119
+
120
+ def Utils.loadChat(path, id, request_pattern, response_pattern)
121
+ chat = nil
122
+ req_file = File.join(path, "#{id}#{request_pattern}")
123
+ res_file = File.join(path, "#{id}#{response_pattern}")
124
+ # puts "* load chat (request): #{req_file}"
125
+ # puts "* load chat (response): #{res_file}"
126
+ request = []
127
+ if File.exists?(req_file) then
128
+ fh = File.open(req_file,"rb")
129
+ fh.each do |line|
130
+ request.push line
131
+ end
132
+ else
133
+ # puts "!! File not found (#{req_file})"
134
+ return nil,nil
135
+ end
136
+
137
+ response = []
138
+ # print "."
139
+ # first only read header as array
140
+ content_length = 0
141
+ response_is_gzipped = false
142
+ content_is_chunked = false
143
+ max_response_size = 50000
144
+
145
+ if File.exists?(res_file) then
146
+ begin
147
+
148
+ resFH = open(res_file, "rb")
149
+
150
+ loop do
151
+ l = resFH.readline
152
+ if l =~ /Content-Length.* (\d*)/ then
153
+ content_length = $1.to_i
154
+ #puts "Content-Length is #{content_length}"
155
+ end
156
+ if l =~ /Content-Encoding.*gzip/ then
157
+ response_is_gzipped = true
158
+ end
159
+ if l=~ /Transfer-Encoding.*chunked/i then
160
+ content_is_chunked = true
161
+ end
162
+ response.push(l)
163
+ # break if l.length < 3 # end of header
164
+ break if l =~ /^\r\n$/ # end of header
165
+ end
166
+
167
+ if content_is_chunked then
168
+ # read rest of file
169
+ response.push "\r\n"
170
+ response.push resFH.read
171
+ #content_length = dummy.chomp.hex
172
+ return request, response
173
+ end
174
+ rescue => bang
175
+ puts "Could not read Header from file #{res_file}"
176
+ end
177
+ # now read response body
178
+ begin
179
+ if response_is_gzipped and content_length > 0 then
180
+ gziped = resFH.read(content_length)
181
+ begin
182
+ gz = Zlib::GzipReader.new( StringIO.new( gziped ) )
183
+ data = gz.read
184
+ if data.length > max_response_size then
185
+ data = data[0..max_response_size]
186
+ puts "!!! chat file (#{res_file}: Response too long"
187
+ # puts data
188
+ end
189
+ response.push data
190
+ rescue => bang
191
+ puts "ERROR: GZIP with file #{res_file}"
192
+ puts bang
193
+ #resFH.each do |l|
194
+ # response.push(l) if response.join.length < @max_response_size
195
+ #end
196
+ end
197
+ return request, response
198
+ end
199
+
200
+ #resFH.each do |l|
201
+ # response.push(l) if response.join.length < max_response_size
202
+ #end
203
+ rest = resFH.read
204
+ response.push(rest)
205
+
206
+ return request, response
207
+ rescue EOFError => bang
208
+ return request, response
209
+ rescue => bang
210
+ puts "!!! Error: Could not read response file #{res_file}"
211
+ puts bang
212
+ end
213
+
214
+ end
215
+ end
216
+
217
+
218
+ end
219
+ end
@@ -0,0 +1,47 @@
1
+ # .
2
+ # load_icon.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 Utils
24
+ def loadIcon(app, filename)
25
+ begin
26
+ icon = nil
27
+
28
+ File.open(filename, "rb") do |f|
29
+ if filename.strip =~ /\.ico$/ then
30
+ icon = FXICOIcon.new(app, f.read)
31
+ #icon = FXICOIcon.new(getApp(), f.read)
32
+ elsif filename.strip =~ /\.png$/ then
33
+ icon = FXPNGIcon.new(app, f.read)
34
+ elsif filename.strip =~ /\.gif$/ then
35
+ icon = FXGIFIcon.new(app, f.read)
36
+ end
37
+ icon.create
38
+ end
39
+
40
+ icon
41
+ rescue => bang
42
+ puts "Couldn't load icon: #{filename}"
43
+ puts bang
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,34 @@
1
+ # .
2
+ # print_debug.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
+ def self.print_debug(*m)
24
+ fl = m.shift
25
+ puts "#"
26
+ puts "# #{fl} #"
27
+ if m.length > 0
28
+ m.each do |l|
29
+ puts l
30
+ end
31
+ puts "# " + "-"*fl.length + " #"
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,143 @@
1
+ # .
2
+ # response_hash.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
+ require 'digest/md5'
23
+
24
+ module Watobo
25
+ module Utils
26
+ def Utils.responseHash(request, response)
27
+ begin
28
+ if request.body and response.body then
29
+ # request.extend Watobo::Mixin::Parser::Web10
30
+ # request.extend Watobo::Mixin::Shaper::Web10
31
+
32
+ # response.extend Watobo::Mixin::Parser::Web10
33
+ # response.extend Watobo::Mixin::Shaper::Web10
34
+
35
+ body = response.body
36
+
37
+ # remove all parm/value pairs
38
+ request.get_parm_names.each do |p|
39
+ body.gsub!(/#{Regexp.quote(p)}/, '')
40
+ val = request.get_parm_value(p)
41
+ body.gsub!(/#{Regexp.quote(val)}/, '')
42
+ end
43
+ request.post_parm_names.each do |p|
44
+ body.gsub!(/#{Regexp.quote(p)}/, '')
45
+ val = request.post_parm_value(p)
46
+ body.gsub!(/#{Regexp.quote(val)}/, '')
47
+ end
48
+ # remove date format 01.02.2009
49
+ body.gsub!(/\d{1,2}\.\d{1,2}.\d{2,4}/, "")
50
+ # remove date format 02/2009
51
+ body.gsub!(/\d{1,2}(.\|\/)d{2,4}/, "")
52
+ #remove time
53
+ body.gsub!(/\d{1,2}:\d{1,2}(:\d{1,2})?/, '')
54
+
55
+ return body, Digest::MD5.hexdigest(body)
56
+
57
+ elsif response.body then
58
+ return body, Digest::MD5.hexdigest(response.body)
59
+ else
60
+ return nil
61
+ end
62
+ rescue => bang
63
+ puts bang
64
+ puts bang.backtrace if $DEBUG
65
+ end
66
+ return nil
67
+
68
+ end
69
+
70
+ # smart hashes are necessary for blind sql injections tests
71
+ # SmartHash means that all dynamic information is removed from the response before creating the hash value.
72
+ # Dynamic information could be date&time as well as parameter names and theire valuse.
73
+ def Utils.smartHash(orig_request, request, response)
74
+ begin
75
+ if request and response.body then
76
+
77
+ body = response.body.dup
78
+ # remove possible chunk values
79
+ body.gsub!(/\r\n[0-9a-fA-F]+\r\n/,'')
80
+ # remove date format 01.02.2009
81
+ body.gsub!(/\d{1,2}\.\d{1,2}.\d{2,4}/, "")
82
+ # remove date format 02/2009
83
+ body.gsub!(/\d{1,2}(.\|\/)d{2,4}/, "")
84
+ #remove time
85
+ body.gsub!(/\d{1,2}:\d{1,2}(:\d{1,2})?/, '')
86
+ # remove all non-printables
87
+ body.gsub!(/[^[:print:]]/,'')
88
+
89
+ request.get_parm_names.each do |p|
90
+ body.gsub!(/#{Regexp.quote(p)}/, '')
91
+ body.gsub!(/#{Regexp.quote(CGI::unescape(p))}/, '')
92
+
93
+ val = request.get_parm_value(p)
94
+ body.gsub!(/#{Regexp.quote(val)}/, '')
95
+ body.gsub!(/#{Regexp.quote(CGI::unescape(val))}/, '')
96
+
97
+ end
98
+
99
+ request.post_parm_names.each do |p|
100
+ body.gsub!(/#{Regexp.quote(p)}/, '')
101
+ body.gsub!(/#{Regexp.quote(CGI::unescape(p))}/, '')
102
+
103
+ val = request.post_parm_value(p)
104
+ body.gsub!(/#{Regexp.quote(val)}/, '')
105
+ body.gsub!(/#{Regexp.quote(CGI::unescape(val))}/, '')
106
+ end
107
+
108
+ # remove all parm/value pairs
109
+ orig_request.get_parm_names.each do |p|
110
+ body.gsub!(/#{Regexp.quote(p)}/, '')
111
+ body.gsub!(/#{Regexp.quote(CGI::unescape(p))}/, '')
112
+
113
+ val = orig_request.get_parm_value(p)
114
+ body.gsub!(/#{Regexp.quote(val)}/, '')
115
+ body.gsub!(/#{Regexp.quote(CGI::unescape(val))}/, '')
116
+ end
117
+
118
+ orig_request.post_parm_names.each do |p|
119
+ body.gsub!(/#{Regexp.quote(p)}/, '')
120
+ body.gsub!(/#{Regexp.quote(CGI::unescape(p))}/, '')
121
+
122
+ val = orig_request.post_parm_value(p)
123
+ body.gsub!(/#{Regexp.quote(val)}/, '')
124
+ body.gsub!(/#{Regexp.quote(CGI::unescape(val))}/, '')
125
+ end
126
+ return body, Digest::MD5.hexdigest(body)
127
+ else
128
+ puts "!!! SMART-HASH is NIL !!!!"
129
+ # puts request
130
+ # puts "----------------------"
131
+ # puts response.body
132
+ return nil
133
+ end
134
+ rescue => bang
135
+ puts bang
136
+ puts bang.backtrace if $DEBUG
137
+ return body, Digest::MD5.hexdigest(body||="")
138
+ end
139
+
140
+ end
141
+
142
+ end
143
+ end