watobo 0.9.8.677
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/watobo_gui.rb +39 -0
- data/certificates/cert.pem +19 -0
- data/certificates/privkey.pem +15 -0
- data/certificates/watobo_dh.key +5 -0
- data/config/datastore.yml +5 -0
- data/config/forwarding_proxy.yml +12 -0
- data/config/general.yml +4 -0
- data/config/gui.yml +23 -0
- data/config/interceptor.yml +16 -0
- data/config/scan_policy.yml +13 -0
- data/config/scanner.yml +34 -0
- data/icons/Add.ico +0 -0
- data/icons/Add_24x24.ico +0 -0
- data/icons/Bandwidth.ico +0 -0
- data/icons/Bandwidth_24x24.ico +0 -0
- data/icons/Mr. Bomb.ico +0 -0
- data/icons/Mr. Bomb_16x16.ico +0 -0
- data/icons/Mr. Bomb_24x24.ico +0 -0
- data/icons/Orange Ball.ico +0 -0
- data/icons/Orange Ball_16x16.ico +0 -0
- data/icons/Orange Ball_24x24.ico +0 -0
- data/icons/Pause.ico +0 -0
- data/icons/Play.ico +0 -0
- data/icons/Play_24x24.ico +0 -0
- data/icons/Red Ball.ico +0 -0
- data/icons/Red Ball_16x16.ico +0 -0
- data/icons/Red Ball_24x24.ico +0 -0
- data/icons/Run.ico +0 -0
- data/icons/Stop.ico +0 -0
- data/icons/Stop_24x24.ico +0 -0
- data/icons/Terminal.ico +0 -0
- data/icons/Transfer.ico +0 -0
- data/icons/Transfer_16x16.ico +0 -0
- data/icons/User.ico +0 -0
- data/icons/User_16x16.ico +0 -0
- data/icons/User_24x24.ico +0 -0
- data/icons/Web Browser.ico +0 -0
- data/icons/Web Browser_16x16.ico +0 -0
- data/icons/Write Document.ico +0 -0
- data/icons/Yellow Ball.ico +0 -0
- data/icons/Yellow Ball_16x16.ico +0 -0
- data/icons/Yellow Ball_24x24.ico +0 -0
- data/icons/advanced.ico +0 -0
- data/icons/advanced_16x16.ico +0 -0
- data/icons/advanced_24x24.ico +0 -0
- data/icons/applications.ico +0 -0
- data/icons/applications_16x16.ico +0 -0
- data/icons/applications_24x24.ico +0 -0
- data/icons/browser_16x16.ico +0 -0
- data/icons/browser_24x24.ico +0 -0
- data/icons/burn.ico +0 -0
- data/icons/burn_16x16.ico +0 -0
- data/icons/burn_24x24.ico +0 -0
- data/icons/calculator.ico +0 -0
- data/icons/calculator_24x24.ico +0 -0
- data/icons/cb_checked.ico +0 -0
- data/icons/cb_checked_orange.ico +0 -0
- data/icons/cb_unchecked.ico +0 -0
- data/icons/coin_24x24.ico +0 -0
- data/icons/conversation.ico +0 -0
- data/icons/conversation_24x24.ico +0 -0
- data/icons/engine.ico +0 -0
- data/icons/filter.ico +0 -0
- data/icons/folder.ico +0 -0
- data/icons/folder_16x16.ico +0 -0
- data/icons/fuzzer_16x16.ico +0 -0
- data/icons/fuzzer_24x24.ico +0 -0
- data/icons/go-down_16x16.png +0 -0
- data/icons/go-up_16x16.png +0 -0
- data/icons/help.ico +0 -0
- data/icons/help_16x16.ico +0 -0
- data/icons/help_24x24.ico +0 -0
- data/icons/iChat.ico +0 -0
- data/icons/iChat_16x16.ico +0 -0
- data/icons/iChat_24x24.ico +0 -0
- data/icons/icons.txt +3 -0
- data/icons/info.ico +0 -0
- data/icons/info_16x16.ico +0 -0
- data/icons/info_24x24.ico +0 -0
- data/icons/interceptor_24x24.ico +0 -0
- data/icons/lock.ico +0 -0
- data/icons/lock_12x12.ico +0 -0
- data/icons/lock_16x16.ico +0 -0
- data/icons/monitor.ico +0 -0
- data/icons/plugin.ico +0 -0
- data/icons/plugin_24x24.ico +0 -0
- data/icons/scan_16x16.png +0 -0
- data/icons/send.ico +0 -0
- data/icons/server.ico +0 -0
- data/icons/server_16x16.ico +0 -0
- data/icons/siberas_logo_x24.gif +0 -0
- data/icons/tag_blue_32x32.ico +0 -0
- data/icons/watobo-48x48.png +0 -0
- data/icons/watobo-logo.png +0 -0
- data/icons/watobo.ico +0 -0
- data/lib/watobo/adapters/data_store.rb +38 -0
- data/lib/watobo/adapters/file/file_store.rb +211 -0
- data/lib/watobo/adapters/session_store.rb +27 -0
- data/lib/watobo/adapters.rb +26 -0
- data/lib/watobo/config.rb +143 -0
- data/lib/watobo/constants.rb +92 -0
- data/lib/watobo/core/active_check.rb +404 -0
- data/lib/watobo/core/cookie.rb +69 -0
- data/lib/watobo/core/fuzz_gen.rb +160 -0
- data/lib/watobo/core/http_socket.rb +142 -0
- data/lib/watobo/core/interceptor.rb +729 -0
- data/lib/watobo/core/passive_check.rb +141 -0
- data/lib/watobo/core/project.rb +1058 -0
- data/lib/watobo/core/scanner.rb +396 -0
- data/lib/watobo/core/session.rb +1320 -0
- data/lib/watobo/core/simple_ca.rb +393 -0
- data/lib/watobo/core.rb +34 -0
- data/lib/watobo/defaults.rb +40 -0
- data/lib/watobo/external/diff/lcs/array.rb +42 -0
- data/lib/watobo/external/diff/lcs/block.rb +72 -0
- data/lib/watobo/external/diff/lcs/callbacks.rb +343 -0
- data/lib/watobo/external/diff/lcs/change.rb +190 -0
- data/lib/watobo/external/diff/lcs/hunk.rb +279 -0
- data/lib/watobo/external/diff/lcs/ldiff.rb +247 -0
- data/lib/watobo/external/diff/lcs/string.rb +40 -0
- data/lib/watobo/external/diff/lcs.rb +1124 -0
- data/lib/watobo/external/ntlm/ntlm.rb +797 -0
- data/lib/watobo/externals.rb +28 -0
- data/lib/watobo/framework/create_project.rb +55 -0
- data/lib/watobo/framework/init.rb +149 -0
- data/lib/watobo/framework/init_modules.rb +116 -0
- data/lib/watobo/framework/license_text.rb +50 -0
- data/lib/watobo/framework.rb +26 -0
- data/lib/watobo/gui/about_watobo.rb +68 -0
- data/lib/watobo/gui/browser_preview.rb +460 -0
- data/lib/watobo/gui/certificate_dialog.rb +132 -0
- data/lib/watobo/gui/chat_diff.rb +415 -0
- data/lib/watobo/gui/chatviewer_frame.rb +427 -0
- data/lib/watobo/gui/checkboxtree.rb +221 -0
- data/lib/watobo/gui/checks_policy_frame.rb +123 -0
- data/lib/watobo/gui/client_cert_dialog.rb +227 -0
- data/lib/watobo/gui/confirm_scan_dialog.rb +67 -0
- data/lib/watobo/gui/conversation_table.rb +386 -0
- data/lib/watobo/gui/conversation_table_ctrl.rb +175 -0
- data/lib/watobo/gui/csrf_token_dialog.rb +446 -0
- data/lib/watobo/gui/dashboard.rb +341 -0
- data/lib/watobo/gui/define_scope_frame.rb +380 -0
- data/lib/watobo/gui/edit_comment.rb +70 -0
- data/lib/watobo/gui/edit_scope_dialog.rb +69 -0
- data/lib/watobo/gui/finding_info.rb +212 -0
- data/lib/watobo/gui/findings_tree.rb +459 -0
- data/lib/watobo/gui/full_scan_dialog.rb +269 -0
- data/lib/watobo/gui/fuzzer_gui.rb +1522 -0
- data/lib/watobo/gui/hex_viewer.rb +106 -0
- data/lib/watobo/gui/interceptor_gui.rb +994 -0
- data/lib/watobo/gui/interceptor_settings_dialog.rb +201 -0
- data/lib/watobo/gui/log_viewer.rb +97 -0
- data/lib/watobo/gui/login_wizzard.rb +301 -0
- data/lib/watobo/gui/main_window.rb +1815 -0
- data/lib/watobo/gui/manual_request_editor.rb +1105 -0
- data/lib/watobo/gui/master_pw_dialog.rb +142 -0
- data/lib/watobo/gui/password_policy_dialog.rb +98 -0
- data/lib/watobo/gui/plugin/base.rb +82 -0
- data/lib/watobo/gui/plugin_board.rb +95 -0
- data/lib/watobo/gui/preferences_dialog.rb +116 -0
- data/lib/watobo/gui/progress_window.rb +102 -0
- data/lib/watobo/gui/project_wizzard.rb +369 -0
- data/lib/watobo/gui/proxy_dialog.rb +550 -0
- data/lib/watobo/gui/quick_scan_dialog.rb +242 -0
- data/lib/watobo/gui/request_editor.rb +480 -0
- data/lib/watobo/gui/save_chat_dialog.rb +158 -0
- data/lib/watobo/gui/scanner_settings_dialog.rb +360 -0
- data/lib/watobo/gui/select_chat_dialog.rb +169 -0
- data/lib/watobo/gui/session_management_dialog.rb +688 -0
- data/lib/watobo/gui/sites_tree.rb +347 -0
- data/lib/watobo/gui/status_bar.rb +88 -0
- data/lib/watobo/gui/table_editor.rb +445 -0
- data/lib/watobo/gui/tagless_viewer.rb +62 -0
- data/lib/watobo/gui/templates/plugin.rb +80 -0
- data/lib/watobo/gui/templates/plugin2.rb +103 -0
- data/lib/watobo/gui/text_viewer.rb +247 -0
- data/lib/watobo/gui/transcoder_window.rb +215 -0
- data/lib/watobo/gui/utils/gui_utils.rb +129 -0
- data/lib/watobo/gui/utils/init_icons.rb +106 -0
- data/lib/watobo/gui/utils/load_icons.rb +54 -0
- data/lib/watobo/gui/utils/load_plugins.rb +94 -0
- data/lib/watobo/gui/utils/master_password.rb +90 -0
- data/lib/watobo/gui/utils/save_default_settings.rb +99 -0
- data/lib/watobo/gui/utils/save_project_settings.rb +21 -0
- data/lib/watobo/gui/utils/save_proxy_settings.rb +45 -0
- data/lib/watobo/gui/utils/save_session_settings.rb +21 -0
- data/lib/watobo/gui/utils/session_history.rb +134 -0
- data/lib/watobo/gui/workspace_dialog.rb +89 -0
- data/lib/watobo/gui/www_auth_dialog.rb +348 -0
- data/lib/watobo/gui/xml_viewer_frame.rb +114 -0
- data/lib/watobo/gui.rb +139 -0
- data/lib/watobo/mixins/httpparser.rb +664 -0
- data/lib/watobo/mixins/request_parser.rb +210 -0
- data/lib/watobo/mixins/shapers.rb +345 -0
- data/lib/watobo/mixins/transcoders.rb +88 -0
- data/lib/watobo/mixins.rb +32 -0
- data/lib/watobo/utils/check_regex.rb +36 -0
- data/lib/watobo/utils/copy_object.rb +29 -0
- data/lib/watobo/utils/crypto.rb +74 -0
- data/lib/watobo/utils/expand_range.rb +45 -0
- data/lib/watobo/utils/file_management.rb +73 -0
- data/lib/watobo/utils/load_chat.rb +219 -0
- data/lib/watobo/utils/load_icon.rb +47 -0
- data/lib/watobo/utils/print_debug.rb +34 -0
- data/lib/watobo/utils/response_hash.rb +143 -0
- data/lib/watobo/utils/secure_eval.rb +57 -0
- data/lib/watobo/utils/text2request.rb +96 -0
- data/lib/watobo/utils.rb +32 -0
- data/lib/watobo.rb +76 -0
- data/modules/active/Apache/mod_status.rb +123 -0
- data/modules/active/Flash/crossdomain.rb +102 -0
- data/modules/active/directories/dirwalker.rb +89 -0
- data/modules/active/discovery/fileextensions.rb +151 -0
- data/modules/active/discovery/http_methods.rb +135 -0
- data/modules/active/domino/domino_db.lst +164 -0
- data/modules/active/domino/domino_db.rb +128 -0
- data/modules/active/fileinclusion/lfi_simple.rb +134 -0
- data/modules/active/jboss/jboss_basic.rb +119 -0
- data/modules/active/sap/business_objects.rb +73 -0
- data/modules/active/sap/its_commands.rb +101 -0
- data/modules/active/sap/its_service_parameter.rb +105 -0
- data/modules/active/sap/its_services.rb +103 -0
- data/modules/active/sap/its_xss.rb +98 -0
- data/modules/active/sqlinjection/sql_boolean.rb +262 -0
- data/modules/active/sqlinjection/sqli_simple.rb +205 -0
- data/modules/active/xss/xss_simple.rb +179 -0
- data/modules/passive/cookie_options.rb +97 -0
- data/modules/passive/cookie_xss.rb +85 -0
- data/modules/passive/detect_code.rb +89 -0
- data/modules/passive/detect_fileupload.rb +80 -0
- data/modules/passive/detect_infrastructure.rb +98 -0
- data/modules/passive/detect_one_time_tokens.rb +86 -0
- data/modules/passive/dirindexing.rb +81 -0
- data/modules/passive/disclosure_emails.rb +82 -0
- data/modules/passive/disclosure_ipaddr.rb +87 -0
- data/modules/passive/filename_as_parameter.rb +85 -0
- data/modules/passive/form_spotter.rb +75 -0
- data/modules/passive/hotspots.rb +86 -0
- data/modules/passive/in_script_parameter.rb +92 -0
- data/modules/passive/multiple_server_headers.rb +98 -0
- data/modules/passive/possible_login.rb +134 -0
- data/modules/passive/redirect_url.rb +88 -0
- data/modules/passive/redirectionz.rb +96 -0
- data/modules/passive/xss_dom.rb +91 -0
- data/plugins/catalog/catalog.ico +0 -0
- data/plugins/catalog/catalog.rb +726 -0
- data/plugins/catalog/db_tests +6483 -0
- data/plugins/catalog/db_variables +29 -0
- data/plugins/filefinder/dbs/hbci.db +12 -0
- data/plugins/filefinder/filefinder.rb +602 -0
- data/plugins/sslchecker/cli/sslchecker_cli.rb +21 -0
- data/plugins/sslchecker/gui/cipher_table.rb +260 -0
- data/plugins/sslchecker/gui/gui.rb +245 -0
- data/plugins/sslchecker/gui/sslchecker.rb +26 -0
- data/plugins/sslchecker/icons/green_16x16.ico +0 -0
- data/plugins/sslchecker/icons/grey_16x16.ico +0 -0
- data/plugins/sslchecker/icons/red_16x16.ico +0 -0
- data/plugins/sslchecker/icons/sslchecker.ico +0 -0
- data/plugins/sslchecker/lib/check.rb +117 -0
- metadata +317 -0
@@ -0,0 +1,404 @@
|
|
1
|
+
# .
|
2
|
+
# active_check.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
|
+
class ActiveCheck < Watobo::Session # Base Class for Passive Checks
|
24
|
+
|
25
|
+
attr :info
|
26
|
+
attr :numChecks
|
27
|
+
|
28
|
+
# @@running_checks = 0
|
29
|
+
@@max_checks = 5
|
30
|
+
@@check_count = 0
|
31
|
+
@@pool = []
|
32
|
+
@@pool_mutex = Mutex.new
|
33
|
+
@@pool_cv = ConditionVariable.new
|
34
|
+
|
35
|
+
@@status = :running # :running, :paused, :canceled
|
36
|
+
@@lock = Mutex.new
|
37
|
+
|
38
|
+
def addFinding(request, response, details)
|
39
|
+
@@lock.synchronize {
|
40
|
+
|
41
|
+
t = Time.now
|
42
|
+
now = t.strftime("%m/%d/%Y@%H:%M:%S")
|
43
|
+
|
44
|
+
new_details = Hash.new
|
45
|
+
new_details.update(@finding)
|
46
|
+
|
47
|
+
new_details.update(details)
|
48
|
+
new_details[:tstamp] = now
|
49
|
+
|
50
|
+
id_string = ''
|
51
|
+
id_string << request.site
|
52
|
+
id_string << request.path
|
53
|
+
id_string << new_details[:test_item] if new_details[:test_item]
|
54
|
+
id_string << new_details[:class] if new_details[:class]
|
55
|
+
id_string << new_details[:title] if new_details[:title]
|
56
|
+
|
57
|
+
if id_string == '' then
|
58
|
+
id_string = rand(10000)
|
59
|
+
end
|
60
|
+
#
|
61
|
+
new_details[:fid] = Digest::MD5.hexdigest(id_string)
|
62
|
+
|
63
|
+
new_details[:module] = self.class.to_s
|
64
|
+
# new_details[:module] = Module.nesting[]
|
65
|
+
|
66
|
+
new_details[:chat_id] = new_details[:chat].id
|
67
|
+
new_details.delete(:chat)
|
68
|
+
|
69
|
+
new_finding = Watobo::Finding.new(request, response, new_details)
|
70
|
+
# puts new_finding
|
71
|
+
notify(:new_finding, new_finding)
|
72
|
+
}
|
73
|
+
end
|
74
|
+
|
75
|
+
def reset()
|
76
|
+
# should be overridden, if counters or status information are used!!!
|
77
|
+
end
|
78
|
+
|
79
|
+
def resetCounters()
|
80
|
+
@numChecks = 0
|
81
|
+
@counters = Hash.new
|
82
|
+
@progress = 0
|
83
|
+
reset()
|
84
|
+
end
|
85
|
+
|
86
|
+
def updateCounters(chat, *prefs)
|
87
|
+
@settings[:excluded_parms] = prefs[:excluded_parms] if prefs.is_a? Hash and prefs[:excluded_parms]
|
88
|
+
@counters[chat.id] = getCheckCount(chat)
|
89
|
+
@numChecks += @counters[chat.id]
|
90
|
+
|
91
|
+
#puts "#{chat.id} : #{@numChecks}"
|
92
|
+
end
|
93
|
+
|
94
|
+
def urlParmNames(chat)
|
95
|
+
begin
|
96
|
+
pnames = chat.request.get_parm_names
|
97
|
+
# puts @settings.to_yaml
|
98
|
+
if @settings.has_key? :excluded_parms
|
99
|
+
@settings[:excluded_parms].each do |p|
|
100
|
+
pnames.delete(p)
|
101
|
+
end
|
102
|
+
end
|
103
|
+
rescue => bang
|
104
|
+
puts "! settings 'excluded_parms' missing !"
|
105
|
+
# puts @project.settings.to_yaml
|
106
|
+
puts bang
|
107
|
+
puts bang.backtrace if $DEBUG
|
108
|
+
end
|
109
|
+
return pnames
|
110
|
+
end
|
111
|
+
|
112
|
+
def postParmNames(chat)
|
113
|
+
pnames = chat.request.post_parm_names
|
114
|
+
begin
|
115
|
+
@settings[:excluded_parms].each do |p|
|
116
|
+
pnames.delete(p)
|
117
|
+
end
|
118
|
+
rescue => bang
|
119
|
+
puts "! settings 'excluded_parms' missing !"
|
120
|
+
# puts @project.settings.to_yaml
|
121
|
+
puts bang
|
122
|
+
puts bang.backtrace if $DEBUG
|
123
|
+
end
|
124
|
+
return pnames
|
125
|
+
end
|
126
|
+
|
127
|
+
def getCheckCount(chat)
|
128
|
+
count = 0
|
129
|
+
generateChecks(chat) do |check|
|
130
|
+
count += 1 if check.respond_to? :call
|
131
|
+
end
|
132
|
+
count
|
133
|
+
end
|
134
|
+
|
135
|
+
def maxChecks=(m)
|
136
|
+
@@max_checks = m
|
137
|
+
end
|
138
|
+
|
139
|
+
def maxChecks()
|
140
|
+
@@max_checks
|
141
|
+
end
|
142
|
+
|
143
|
+
def enabled?
|
144
|
+
@enabled
|
145
|
+
end
|
146
|
+
|
147
|
+
def enabled=(status)
|
148
|
+
@enabled = status.is_a? TrueClass|FalseClass
|
149
|
+
end
|
150
|
+
|
151
|
+
def enable
|
152
|
+
@enabled = true
|
153
|
+
end
|
154
|
+
|
155
|
+
def checksRunning?
|
156
|
+
begin
|
157
|
+
puts @inner_pool.size
|
158
|
+
return true if @inner_pool.size > 0
|
159
|
+
return false
|
160
|
+
rescue => bang
|
161
|
+
p bang
|
162
|
+
p bang.backtrace
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
def disable
|
167
|
+
@enable = false
|
168
|
+
end
|
169
|
+
|
170
|
+
def generateChecks(chat)
|
171
|
+
raise "Missing method generateChecks()!!!"
|
172
|
+
end
|
173
|
+
|
174
|
+
def waitLogin(state)
|
175
|
+
@@login_in_progress = state
|
176
|
+
@inner_pool_cv.signal if state == false
|
177
|
+
end
|
178
|
+
|
179
|
+
def continue()
|
180
|
+
@@pool.each do |thr|
|
181
|
+
# puts "Stopping #{thr}"
|
182
|
+
begin
|
183
|
+
thr.run if not thr.run?
|
184
|
+
rescue
|
185
|
+
puts "could not continue thread #{thr}"
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
def cancel()
|
191
|
+
@@status = :stopped
|
192
|
+
@inner_pool.each do |thr|
|
193
|
+
begin
|
194
|
+
if thr.alive?
|
195
|
+
puts "Stopping #{thr}" if $DEBUG
|
196
|
+
|
197
|
+
Thread.kill( thr ) #.kill if not thr.kill?
|
198
|
+
|
199
|
+
end
|
200
|
+
@inner_pool.delete(thr)
|
201
|
+
rescue => bang
|
202
|
+
puts "could not kill thread #{thr}"
|
203
|
+
puts bang
|
204
|
+
puts bang.backtrace if $DEBUG
|
205
|
+
end
|
206
|
+
end
|
207
|
+
@inner_pool_cv.signal
|
208
|
+
|
209
|
+
end
|
210
|
+
|
211
|
+
def stop()
|
212
|
+
# TODO: real stop/pause function
|
213
|
+
cancel()
|
214
|
+
end
|
215
|
+
|
216
|
+
def fileExists?(request, prefs={})
|
217
|
+
begin
|
218
|
+
t_request, t_response = doRequest(request, prefs)
|
219
|
+
#puts t_response.status
|
220
|
+
return true, t_request, t_response if t_response.status =~ /^403/
|
221
|
+
return false, t_request, t_response if t_response.status =~ /^40\d/
|
222
|
+
|
223
|
+
puts @settings[:custom_error_patterns] if $debug_active_check
|
224
|
+
|
225
|
+
if @settings.has_key? :custom_error_patterns
|
226
|
+
@settings[:custom_error_patterns].each do |pat|
|
227
|
+
# puts pat
|
228
|
+
t_response.headers.each do |hl|
|
229
|
+
return false if hl =~ /#{pat}/
|
230
|
+
end
|
231
|
+
# puts t_response.body.class
|
232
|
+
unless t_response.body.nil?
|
233
|
+
# puts "* check body"
|
234
|
+
# puts t_response.body
|
235
|
+
return false if t_response.body =~ /#{pat}/
|
236
|
+
end
|
237
|
+
end
|
238
|
+
end
|
239
|
+
# if t_request.path_ext != ""
|
240
|
+
#TODO: Check for custom error pages
|
241
|
+
# end
|
242
|
+
|
243
|
+
return true, t_request, t_response
|
244
|
+
rescue => bang
|
245
|
+
end
|
246
|
+
return false, nil, nil
|
247
|
+
end
|
248
|
+
|
249
|
+
# +++ run_checks +++
|
250
|
+
# + function: wrapper function for doRequest(r). Needed for additional checks like smartchecks.
|
251
|
+
#
|
252
|
+
# :run_passive_checks false,
|
253
|
+
# :do_login
|
254
|
+
|
255
|
+
def run_checks(chat, opts={})
|
256
|
+
begin
|
257
|
+
# reset() # reset variables first
|
258
|
+
@@status = :running
|
259
|
+
check_opts = { :run_passive_checks => false}
|
260
|
+
check_opts.update opts
|
261
|
+
@settings.update opts
|
262
|
+
|
263
|
+
updateSessionSettings(opts)
|
264
|
+
# puts @session.to_yaml
|
265
|
+
|
266
|
+
@@proxy = opts[:proxy] if opts[:proxy]
|
267
|
+
# @@max_checks = opts[:max_parallel_checks] if opts.has_key? :max_parallel_checks
|
268
|
+
@@max_checks = Watobo::Conf::Scanner.max_parallel_checks
|
269
|
+
|
270
|
+
do_test(chat) { |request, response|
|
271
|
+
begin
|
272
|
+
|
273
|
+
if request and response then
|
274
|
+
if check_opts[:run_passive_checks] then
|
275
|
+
|
276
|
+
nc = Watobo::Chat.new(request, response, :id => 0)
|
277
|
+
# @project.runPassiveChecks(nc)
|
278
|
+
|
279
|
+
end
|
280
|
+
|
281
|
+
end
|
282
|
+
rescue => bang
|
283
|
+
puts bang
|
284
|
+
puts bang.backtrace if $DEBUG
|
285
|
+
end
|
286
|
+
|
287
|
+
}
|
288
|
+
|
289
|
+
rescue => bang
|
290
|
+
puts bang
|
291
|
+
puts bang.backtrace if $DEBUG
|
292
|
+
|
293
|
+
end
|
294
|
+
|
295
|
+
end
|
296
|
+
|
297
|
+
def do_test(chat, &block)
|
298
|
+
# puts chat.request.site
|
299
|
+
tlist = []
|
300
|
+
@inner_pool = []
|
301
|
+
dummy = Hash.new
|
302
|
+
generateChecks(chat) do |check|
|
303
|
+
dummy[chat.id] ||= 0
|
304
|
+
dummy[chat.id] += 1
|
305
|
+
puts dummy.to_yaml
|
306
|
+
unless @@status == :stopped
|
307
|
+
@@pool_mutex.synchronize do
|
308
|
+
while @@check_count > @@max_checks or @@login_in_progress
|
309
|
+
puts "[#{self.class.to_s.gsub(/Watobo::Modules::Active::/,'')}] do_test on chat [#{chat.id}]: waiting .. #{@@check_count}/#{@@max_checks}" if $DEBUG
|
310
|
+
@@pool_cv.wait(@@pool_mutex)
|
311
|
+
end
|
312
|
+
@@check_count += 1
|
313
|
+
end
|
314
|
+
|
315
|
+
@inner_pool << Thread.new(check) { |c|
|
316
|
+
begin
|
317
|
+
|
318
|
+
if c.respond_to? :call
|
319
|
+
request, response = c.call
|
320
|
+
yield request, response if block_given?
|
321
|
+
|
322
|
+
end
|
323
|
+
rescue => bang
|
324
|
+
# puts "!!!ERROR: running check in #{self.class}"
|
325
|
+
puts bang
|
326
|
+
puts bang.backtrace if $DEBUG
|
327
|
+
# raise
|
328
|
+
ensure
|
329
|
+
|
330
|
+
@@pool_mutex.synchronize do
|
331
|
+
@@check_count -= 1
|
332
|
+
notify(:check_finished, self, request, response)
|
333
|
+
#@inner_pool.delete Thread.current
|
334
|
+
end
|
335
|
+
@@pool_cv.signal
|
336
|
+
|
337
|
+
end
|
338
|
+
}
|
339
|
+
# puts "[#{self.class.to_s.gsub(/Watobo::Modules::Active::/,'')}] [#{chat.id}]: INNER POOL - #{@inner_pool.length} "
|
340
|
+
end
|
341
|
+
end
|
342
|
+
|
343
|
+
@inner_pool.each {|t| t.join }
|
344
|
+
puts ">>>> #{self.class} on chat[#{chat.id}] ... finished!\n"
|
345
|
+
end
|
346
|
+
|
347
|
+
def initialize(session_name=nil, prefs={})
|
348
|
+
#@project = project
|
349
|
+
super(session_name, prefs)
|
350
|
+
|
351
|
+
@enabled = true
|
352
|
+
# @status = "ready"
|
353
|
+
@counters = Hash.new
|
354
|
+
|
355
|
+
#TODO: change @settings to @session, if no bugs!
|
356
|
+
@settings = @session
|
357
|
+
# @settings = {
|
358
|
+
# :custom_error_patterns => [],
|
359
|
+
# :excluded_parms => []
|
360
|
+
# }
|
361
|
+
|
362
|
+
@@max_checks = prefs[:max_parallel_checks] unless prefs[:max_parallel_checks].nil?
|
363
|
+
@running_chats = []
|
364
|
+
|
365
|
+
@numChecks = 0
|
366
|
+
@progress = 0
|
367
|
+
@check_threads = []
|
368
|
+
|
369
|
+
@inner_pool = []
|
370
|
+
@inner_pool_mutex = Mutex.new
|
371
|
+
@inner_pool_cv = ConditionVariable.new
|
372
|
+
|
373
|
+
@checks_cv = ConditionVariable.new
|
374
|
+
@checks_mutex = Mutex.new
|
375
|
+
|
376
|
+
@info = {
|
377
|
+
:check_name => '', # name of check which briefly describes functionality, will be used for tree and progress views
|
378
|
+
:check_group => 'Misc', # groupname of check, will be used to group checks, e.g. :Generic, SAP, :Enumeration
|
379
|
+
:description => '', # description of checkfunction
|
380
|
+
:author => "not modified", # author of check
|
381
|
+
:version => "unversioned", # check version
|
382
|
+
:target => nil # reserved
|
383
|
+
|
384
|
+
}
|
385
|
+
|
386
|
+
@finding = {
|
387
|
+
:title => 'untitled', # [String] title name, used for finding tree
|
388
|
+
:check_pattern => nil, # [String] regex of vulnerability check if possible, will be used for highlighting
|
389
|
+
:proof_pattern => nil, # [String] regex of finding proof if possible, will be used for highlighting
|
390
|
+
:threat => '', # threat of vulnerability, e.g. loss of information
|
391
|
+
:measure => '', # measure
|
392
|
+
:class => "undefined",# [String] vulnerability class, e.g. Stored XSS, SQL-Injection, ...
|
393
|
+
:subclass => nil, # reserved
|
394
|
+
:type => FINDING_TYPE_UNDEFINED, # FINDING_TYPE_HINT, FINDING_TYPE_INFO, FINDING_TYPE_VULN
|
395
|
+
:chat => nil, # related chat must be linked
|
396
|
+
:rating=> VULN_RATING_UNDEFINED, #
|
397
|
+
:cvss => "n/a", # CVSS Base Vector
|
398
|
+
:icon => nil, # Icon Type
|
399
|
+
:timestamp => nil # timestamp
|
400
|
+
}
|
401
|
+
|
402
|
+
end
|
403
|
+
end
|
404
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# .
|
2
|
+
# cookie.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
|
+
|
24
|
+
|
25
|
+
#Set-Cookie: mycookie=b41dc9e55d6163f78321996b10c940edcec1b4e55a76464c4e9d25e160ac0ec5b769806b; path=/; secure
|
26
|
+
|
27
|
+
class Cookie
|
28
|
+
|
29
|
+
attr :name
|
30
|
+
attr :value
|
31
|
+
attr :path
|
32
|
+
attr :secure
|
33
|
+
attr :http_only
|
34
|
+
|
35
|
+
def name_value
|
36
|
+
"#{@name}=#{@value}"
|
37
|
+
end
|
38
|
+
|
39
|
+
def initialize(prefs)
|
40
|
+
@value = nil
|
41
|
+
@name = nil
|
42
|
+
@secure = false
|
43
|
+
@http_only = false
|
44
|
+
@path = nil
|
45
|
+
|
46
|
+
if prefs.is_a? String
|
47
|
+
# remove Set-Cookie: from string
|
48
|
+
# puts "* create new Cookie"
|
49
|
+
# puts ">> #{prefs}"
|
50
|
+
cs = prefs.gsub(/^Set-Cookie:/,'').strip.split(";").map{ |c| c.strip }
|
51
|
+
@name, @value = cs.shift.split("=")
|
52
|
+
cs.each do |o|
|
53
|
+
if o =~ /^path=(.*)/
|
54
|
+
@path = $1
|
55
|
+
end
|
56
|
+
|
57
|
+
@secure = true if o =~ /secure/i
|
58
|
+
@http_only = true if o =~ /httponly/i
|
59
|
+
end
|
60
|
+
elsif prefs.is_a? Hash
|
61
|
+
#TODO: create cookie with hash-settings
|
62
|
+
else
|
63
|
+
raise ArgumentError, "Need hash (:name, :value, ...) or string (Set-Cookie:...)"
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
|
69
|
+
end
|
@@ -0,0 +1,160 @@
|
|
1
|
+
# .
|
2
|
+
# fuzz_gen.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
|
+
|
24
|
+
# base class for generators
|
25
|
+
class FuzzGenerator
|
26
|
+
attr :numRequests
|
27
|
+
attr :name
|
28
|
+
attr :genType
|
29
|
+
attr :actions
|
30
|
+
attr :info
|
31
|
+
|
32
|
+
def is_generator?
|
33
|
+
true
|
34
|
+
end
|
35
|
+
|
36
|
+
def run(imr=nil)
|
37
|
+
result = Hash.new
|
38
|
+
|
39
|
+
result.update imr if imr
|
40
|
+
|
41
|
+
generate do |value|
|
42
|
+
rv = value
|
43
|
+
@actions.each do |p|
|
44
|
+
rv = p.func.call(rv)
|
45
|
+
end
|
46
|
+
result[@fuzzer_tag.name] = rv
|
47
|
+
yield result
|
48
|
+
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def addAction(proc)
|
53
|
+
@actions.push proc
|
54
|
+
end
|
55
|
+
|
56
|
+
def removeAction(action)
|
57
|
+
@actions.delete(action)
|
58
|
+
end
|
59
|
+
|
60
|
+
def generate
|
61
|
+
return true
|
62
|
+
end
|
63
|
+
|
64
|
+
def initialize(fuzzer_tag)
|
65
|
+
@actions = []
|
66
|
+
@numRequests = 0
|
67
|
+
@fuzzer_tag = fuzzer_tag
|
68
|
+
@genType = "Undefined"
|
69
|
+
@info = "undefined"
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
73
|
+
|
74
|
+
class FuzzFile < FuzzGenerator
|
75
|
+
def generate
|
76
|
+
return if not @filename
|
77
|
+
fh = File.open(@filename)
|
78
|
+
fh.each_line do |line|
|
79
|
+
line.chomp!
|
80
|
+
yield line if not line.empty?
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def initialize(fuzzer_tag, filename)
|
85
|
+
super(fuzzer_tag)
|
86
|
+
@genType = "File-Input"
|
87
|
+
@filename = ""
|
88
|
+
@numRequests = 0
|
89
|
+
if File.exists?(filename) then
|
90
|
+
@filename = filename
|
91
|
+
File.open(filename) do |fh|
|
92
|
+
fh.each_line do |l|
|
93
|
+
@numRequests += 1
|
94
|
+
end
|
95
|
+
end
|
96
|
+
else
|
97
|
+
@numRequests = 0
|
98
|
+
end
|
99
|
+
|
100
|
+
@info = "Filename: #{@filename}"
|
101
|
+
|
102
|
+
end
|
103
|
+
|
104
|
+
end
|
105
|
+
|
106
|
+
class FuzzList < FuzzGenerator
|
107
|
+
def generate(&block)
|
108
|
+
@list.each do |item|
|
109
|
+
yield item if block_given?
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
def initialize(fuzzer_tag, list)
|
114
|
+
@list = list
|
115
|
+
super(fuzzer_tag)
|
116
|
+
@genType = "List-Input"
|
117
|
+
@numRequests = @list.length
|
118
|
+
@info = "#{@numRequests} values"
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
class FuzzCounter < FuzzGenerator
|
123
|
+
attr_reader :start, :stop, :count, :step
|
124
|
+
|
125
|
+
def generate
|
126
|
+
return false if @start.nil?
|
127
|
+
return false if @stop.nil? and @count.nil?
|
128
|
+
|
129
|
+
if @stop == 0 and @count > 0 then
|
130
|
+
@stop = @start + @count
|
131
|
+
end
|
132
|
+
|
133
|
+
return 0 if @start == @stop
|
134
|
+
|
135
|
+
@start.step(@stop, @step) do |i|
|
136
|
+
yield i.to_s
|
137
|
+
end
|
138
|
+
|
139
|
+
end
|
140
|
+
|
141
|
+
def initialize(fuzzer_tag, prefs)
|
142
|
+
super(fuzzer_tag)
|
143
|
+
@genType = "Counter"
|
144
|
+
@start = prefs[:start]
|
145
|
+
@stop = prefs[:stop]
|
146
|
+
|
147
|
+
@count = prefs[:count] || 0
|
148
|
+
@step = ( prefs[:step] and prefs[:step] != 0 ) ? prefs[:step] : 1
|
149
|
+
|
150
|
+
if @stop < @start and @step > 0 then
|
151
|
+
@step = @step * -1
|
152
|
+
end
|
153
|
+
@info = "start=#{@start}/stop=#{@stop}/step=#{@step}"
|
154
|
+
@numRequests = (( @stop - @start ) / @step).abs
|
155
|
+
|
156
|
+
end
|
157
|
+
|
158
|
+
end
|
159
|
+
|
160
|
+
end
|