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,123 @@
|
|
1
|
+
# .
|
2
|
+
# checks_policy_frame.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 ChecksPolicyFrame < FXVerticalFrame
|
25
|
+
attr :policy_name
|
26
|
+
def onPolicyChanged(sender, sel, item)
|
27
|
+
@policy_name = @policyCombo.getItemText(@policyCombo.currentItem)
|
28
|
+
policy = @policyCombo.getItemData(@policyCombo.currentItem)
|
29
|
+
applyPolicy(policy)
|
30
|
+
end
|
31
|
+
|
32
|
+
def isElementChecked(data)
|
33
|
+
item = @tree.findItemByData(data)
|
34
|
+
item.checked
|
35
|
+
end
|
36
|
+
|
37
|
+
def applyPolicy(policy)
|
38
|
+
return false if policy.nil?
|
39
|
+
tree_elements = []
|
40
|
+
@checks.each do |check|
|
41
|
+
status = true
|
42
|
+
begin
|
43
|
+
status = policy[check.class.to_s]
|
44
|
+
rescue
|
45
|
+
puts "unknown policy or unknown test [#{@policy}] - [#{check.class.to_s}"
|
46
|
+
end
|
47
|
+
a = {
|
48
|
+
:name => "#{check.info[:check_group]}|#{check.info[:check_name]}",
|
49
|
+
:enabled => status,
|
50
|
+
:data => check
|
51
|
+
}
|
52
|
+
tree_elements.push a
|
53
|
+
end
|
54
|
+
|
55
|
+
showTree(tree_elements)
|
56
|
+
end
|
57
|
+
|
58
|
+
def showInfo(check)
|
59
|
+
|
60
|
+
end
|
61
|
+
|
62
|
+
def showTree(elements)
|
63
|
+
@tree.createTree(elements)
|
64
|
+
end
|
65
|
+
|
66
|
+
def getSelectedModules()
|
67
|
+
sel = @tree.getCheckedData
|
68
|
+
#sel.map { |i| p i.class }
|
69
|
+
end
|
70
|
+
|
71
|
+
def initialize(parent, checks, policy)
|
72
|
+
# Invoke base class initialize function first
|
73
|
+
super(parent, :opts => LAYOUT_FILL_X| LAYOUT_FILL_Y, :padding => 0)
|
74
|
+
|
75
|
+
@checks = checks
|
76
|
+
@policy_list = policy.is_a?(Hash) ? policy : default_policy(checks) # policy settings
|
77
|
+
|
78
|
+
policy_frame = FXHorizontalFrame.new(self, :opts => LAYOUT_FILL_X|LAYOUT_SIDE_TOP)
|
79
|
+
|
80
|
+
policy_name = @policy_list[:default_policy] if @policy_list.has_key? :default_policy
|
81
|
+
@current_policy = @policy_list[policy_name] if @policy_list.has_key? policy_name
|
82
|
+
|
83
|
+
policy_count = ( @policy_list.is_a? Hash ) ? @policy_list.length-1 : 0
|
84
|
+
|
85
|
+
@policyCombo = FXComboBox.new(policy_frame, policy_count, nil, 0,
|
86
|
+
COMBOBOX_INSERT_LAST|FRAME_SUNKEN|FRAME_THICK|LAYOUT_SIDE_TOP|LAYOUT_FILL_X)
|
87
|
+
|
88
|
+
@policyCombo.numVisible = policy_count
|
89
|
+
@policyCombo.connect(SEL_COMMAND, method(:onPolicyChanged))
|
90
|
+
|
91
|
+
tree_frame = FXVerticalFrame.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_GROOVE)
|
92
|
+
@tree = CheckBoxTreeList.new(tree_frame)
|
93
|
+
|
94
|
+
if @policy_list
|
95
|
+
@policy_list.each do |pname, p|
|
96
|
+
next if pname.is_a? Symbol
|
97
|
+
@policyCombo.appendItem(pname, p)
|
98
|
+
end
|
99
|
+
# select policy
|
100
|
+
index = @policyCombo.findItem(policy_name)
|
101
|
+
if index >= 0 then
|
102
|
+
@policyCombo.setCurrentItem(index)
|
103
|
+
end
|
104
|
+
applyPolicy(@current_policy)
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
private
|
109
|
+
|
110
|
+
def default_policy(checks)
|
111
|
+
@policy_list = Hash.new
|
112
|
+
@policy_list[:default_policy] = 'default'
|
113
|
+
dp = @policy_list['default'] = Hash.new
|
114
|
+
checks.each do |ac|
|
115
|
+
dp[ac.class.to_s] = false
|
116
|
+
end
|
117
|
+
@current_policy = dp
|
118
|
+
@policy_list
|
119
|
+
end
|
120
|
+
end
|
121
|
+
#--
|
122
|
+
end
|
123
|
+
end
|
@@ -0,0 +1,227 @@
|
|
1
|
+
# .
|
2
|
+
# client_cert_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 ClientCertDialog < FXDialogBox
|
25
|
+
|
26
|
+
NO_SELECTION = "no site selected"
|
27
|
+
|
28
|
+
attr :client_certificates
|
29
|
+
def savePasswords?()
|
30
|
+
@save_pws_cbt.checked?
|
31
|
+
end
|
32
|
+
|
33
|
+
include Responder
|
34
|
+
|
35
|
+
def initialize(owner, project, prefs={})
|
36
|
+
|
37
|
+
super(owner, "Client Certificates", :opts => DECOR_ALL)
|
38
|
+
@project = project
|
39
|
+
FXMAPFUNC(SEL_COMMAND, ID_ACCEPT, :onAccept)
|
40
|
+
|
41
|
+
@password_policy = {
|
42
|
+
:save_passwords => false
|
43
|
+
}
|
44
|
+
|
45
|
+
@cert_path = nil
|
46
|
+
@client_certificates = {}
|
47
|
+
@client_certificates = project.getClientCertificates unless project.getClientCertificates.nil?
|
48
|
+
puts client_certificates.to_yaml
|
49
|
+
|
50
|
+
@password_policy.update prefs[:password_policy] if prefs.has_key? :password_policy
|
51
|
+
|
52
|
+
@site_dt = FXDataTarget.new('')
|
53
|
+
@client_cert_dt = FXDataTarget.new('')
|
54
|
+
@client_key_dt = FXDataTarget.new('')
|
55
|
+
@password_dt = FXDataTarget.new('')
|
56
|
+
@retype_dt = FXDataTarget.new('')
|
57
|
+
|
58
|
+
main_frame = FXVerticalFrame.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_GROOVE)
|
59
|
+
|
60
|
+
frame = FXHorizontalFrame.new(main_frame, :opts => LAYOUT_FILL_X)
|
61
|
+
|
62
|
+
@scope_only_cb = FXCheckButton.new(frame, "scope only", nil, 0, ICON_BEFORE_TEXT|LAYOUT_SIDE_LEFT)
|
63
|
+
@scope_only_cb.setCheck(false)
|
64
|
+
|
65
|
+
@scope_only_cb.connect(SEL_COMMAND) { updateSitesCombo() }
|
66
|
+
|
67
|
+
@sites_combo = FXComboBox.new(frame, 5, @site_dt, FXDataTarget::ID_VALUE,
|
68
|
+
COMBOBOX_STATIC|FRAME_SUNKEN|FRAME_THICK|LAYOUT_SIDE_TOP|LAYOUT_FILL_X)
|
69
|
+
|
70
|
+
@sites_combo.numVisible = @sites_combo.numItems >= 20 ? 20 : @sites_combo.numItems
|
71
|
+
@sites_combo.numColumns = 25
|
72
|
+
@sites_combo.editable = true
|
73
|
+
updateSitesCombo()
|
74
|
+
|
75
|
+
@sites_combo.connect(SEL_COMMAND, method(:update_fields))
|
76
|
+
matrix = FXMatrix.new(main_frame, 3, :opts => MATRIX_BY_COLUMNS|LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
77
|
+
|
78
|
+
FXLabel.new(matrix, "Certificate File:", nil, LAYOUT_TOP|JUSTIFY_RIGHT)
|
79
|
+
@client_cert_txt = FXTextField.new(matrix, 25,
|
80
|
+
:target => @client_cert_dt, :selector => FXDataTarget::ID_VALUE,
|
81
|
+
:opts => TEXTFIELD_NORMAL|LAYOUT_SIDE_RIGHT)
|
82
|
+
|
83
|
+
FXButton.new(matrix, "Select").connect(SEL_COMMAND){ select_cert_file }
|
84
|
+
|
85
|
+
FXLabel.new(matrix, "Key File:", nil, LAYOUT_TOP|JUSTIFY_RIGHT)
|
86
|
+
@client_key_txt = FXTextField.new(matrix, 25,
|
87
|
+
:target => @client_key_dt, :selector => FXDataTarget::ID_VALUE,
|
88
|
+
:opts => TEXTFIELD_NORMAL|LAYOUT_SIDE_RIGHT)
|
89
|
+
FXButton.new(matrix, "Select").connect(SEL_COMMAND){ select_key_file }
|
90
|
+
|
91
|
+
matrix = FXMatrix.new(main_frame, 2, :opts => MATRIX_BY_COLUMNS|LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
92
|
+
FXLabel.new(matrix, "Password:", nil, LAYOUT_TOP|JUSTIFY_RIGHT)
|
93
|
+
@password_txt = FXTextField.new(matrix, 25,
|
94
|
+
:target => @password_dt, :selector => FXDataTarget::ID_VALUE,
|
95
|
+
:opts => TEXTFIELD_NORMAL|LAYOUT_SIDE_RIGHT|TEXTFIELD_PASSWD)
|
96
|
+
|
97
|
+
FXLabel.new(matrix, "Retype:", nil, LAYOUT_TOP|JUSTIFY_RIGHT)
|
98
|
+
@retype_txt = FXTextField.new(matrix, 25,
|
99
|
+
:target => @retype_dt, :selector => FXDataTarget::ID_VALUE,
|
100
|
+
:opts => TEXTFIELD_NORMAL|LAYOUT_SIDE_RIGHT|TEXTFIELD_PASSWD)
|
101
|
+
|
102
|
+
@save_pws_cbt = FXCheckButton.new(matrix, "save passwords")
|
103
|
+
@save_pws_cbt.checkState = false
|
104
|
+
@save_pws_cbt.checkState = true if @password_policy[:save_passwords] == true
|
105
|
+
note_label = FXLabel.new(matrix, "This setting affects all passwords!!!")
|
106
|
+
|
107
|
+
buttons = FXHorizontalFrame.new(main_frame, :opts => LAYOUT_SIDE_BOTTOM|LAYOUT_FILL_X|PACK_UNIFORM_WIDTH,
|
108
|
+
:padLeft => 40, :padRight => 40, :padTop => 20, :padBottom => 20)
|
109
|
+
|
110
|
+
accept = FXButton.new(buttons, "&Accept", nil, self, ID_ACCEPT,
|
111
|
+
FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y)
|
112
|
+
accept.enable
|
113
|
+
# Cancel
|
114
|
+
FXButton.new(buttons, "&Cancel", nil, self, ID_CANCEL,
|
115
|
+
FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y)
|
116
|
+
end
|
117
|
+
|
118
|
+
private
|
119
|
+
|
120
|
+
def updateSitesCombo()
|
121
|
+
@sites_combo.clearItems
|
122
|
+
@sites_combo.appendItem(NO_SELECTION, nil)
|
123
|
+
@site_dt.value = NO_SELECTION
|
124
|
+
@project.listSites(:in_scope => @scope_only_cb.checked? ){ |site|
|
125
|
+
#puts "Site: #{site}"
|
126
|
+
@sites_combo.appendItem(site, site)
|
127
|
+
}
|
128
|
+
@sites_combo.numVisible = @sites_combo.numItems >= 20 ? 20 : @sites_combo.numItems
|
129
|
+
@sites_combo.setCurrentItem(0, true) if @sites_combo.numItems > 0
|
130
|
+
# @sites_combo.text = @sites_combo.getItemText(@sites_combo.currentItem)
|
131
|
+
@sites_combo.handle(self, FXSEL(SEL_UPDATE, 1), nil)
|
132
|
+
end
|
133
|
+
|
134
|
+
def select_cert_file()
|
135
|
+
cert_filename = FXFileDialog.getOpenFilename(self, "Select Certificate File", @cert_path)
|
136
|
+
if cert_filename != "" then
|
137
|
+
if File.exists?(cert_filename) then
|
138
|
+
@client_cert_dt.value = cert_filename
|
139
|
+
@client_cert_txt.handle(self, FXSEL(SEL_UPDATE, 0), nil)
|
140
|
+
@cert_path = File.dirname(cert_filename)
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
def select_key_file()
|
146
|
+
|
147
|
+
key_filename = FXFileDialog.getOpenFilename(self, "Select Key File", @cert_path)
|
148
|
+
if key_filename != "" then
|
149
|
+
if File.exists?(key_filename) then
|
150
|
+
@client_key_dt.value = key_filename
|
151
|
+
@client_key_txt.handle(self, FXSEL(SEL_UPDATE, 0), nil)
|
152
|
+
@cert_path = File.dirname(key_filename)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
def updateFields()
|
158
|
+
# @sites_combo.handle(self, FXSEL(SEL_UPDATE, 1), nil)
|
159
|
+
@client_cert_txt.handle(self, FXSEL(SEL_UPDATE, 0), nil)
|
160
|
+
@client_key_txt.handle(self, FXSEL(SEL_UPDATE, 0), nil)
|
161
|
+
end
|
162
|
+
|
163
|
+
def update_fields(sender, sel, item)
|
164
|
+
@site_dt.value = item
|
165
|
+
if @client_certificates.has_key? item
|
166
|
+
puts "* certs found"
|
167
|
+
c = @client_certificates[item]
|
168
|
+
@client_cert_dt.value = c[:certificate_file]
|
169
|
+
@client_key_dt.value = c[:key_file]
|
170
|
+
@password_dt.value = c[:password]
|
171
|
+
@retype_dt.value = c[:password]
|
172
|
+
@client_cert_txt.handle(self, FXSEL(SEL_UPDATE, 0), nil)
|
173
|
+
@client_key_txt.handle(self, FXSEL(SEL_UPDATE, 0), nil)
|
174
|
+
@password_txt.handle(self, FXSEL(SEL_UPDATE, 0), nil)
|
175
|
+
@retype_txt.handle(self, FXSEL(SEL_UPDATE, 0), nil)
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
def onAccept(sender, sel, event)
|
180
|
+
|
181
|
+
password = nil
|
182
|
+
if @site_dt.value.empty? or @site_dt.value == NO_SELECTION
|
183
|
+
FXMessageBox.information(self, MBOX_OK, "No Site Selected", "You must select a site from the drop down list.")
|
184
|
+
return 0
|
185
|
+
end
|
186
|
+
|
187
|
+
unless @password_dt.value.empty?
|
188
|
+
puts "* password is set"
|
189
|
+
if @password_dt.value != @retype_dt.value
|
190
|
+
FXMessageBox.information(self, MBOX_OK, "Passwords", "Passwords don't match!")
|
191
|
+
return 0
|
192
|
+
end
|
193
|
+
password = @password_dt.value
|
194
|
+
end
|
195
|
+
|
196
|
+
unless File.exist?(@client_cert_dt.value)
|
197
|
+
FXMessageBox.information(self, MBOX_OK, "File not found", "#{@client_cert_dt.value} does not exist!")
|
198
|
+
return 0
|
199
|
+
|
200
|
+
end
|
201
|
+
unless File.exist?(@client_key_dt.value)
|
202
|
+
FXMessageBox.information(self, MBOX_OK, "File not found", "#{@client_key_dt.value} does not exist!")
|
203
|
+
return 0
|
204
|
+
|
205
|
+
end
|
206
|
+
# last but not least check if private key can be accessed
|
207
|
+
begin
|
208
|
+
key = OpenSSL::PKey::RSA.new(File.open(@client_key_dt.value), password)
|
209
|
+
rescue => bang
|
210
|
+
FXMessageBox.information(self, MBOX_OK, "Wrong Password", "Could not open private key file. Wrong password?")
|
211
|
+
return 0
|
212
|
+
end
|
213
|
+
# puts @auth_table.settings.to_yaml
|
214
|
+
@client_certificates[@site_dt.value] = {
|
215
|
+
:certificate_file => @client_cert_dt.value,
|
216
|
+
:key_file => @client_key_dt.value,
|
217
|
+
:password => password.nil? ? "" : password
|
218
|
+
}
|
219
|
+
|
220
|
+
getApp().stopModal(self, 1)
|
221
|
+
self.hide()
|
222
|
+
return 1
|
223
|
+
end
|
224
|
+
end
|
225
|
+
|
226
|
+
end
|
227
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# .
|
2
|
+
# confirm_scan_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
|
+
require 'watobo/gui/conversation_table'
|
23
|
+
|
24
|
+
module Watobo
|
25
|
+
module Gui
|
26
|
+
class ConfirmScanDialog < FXDialogBox
|
27
|
+
|
28
|
+
include Responder
|
29
|
+
|
30
|
+
attr :scope
|
31
|
+
def onAccept(sender, sel, event)
|
32
|
+
|
33
|
+
getApp().stopModal(self, 1)
|
34
|
+
self.hide()
|
35
|
+
return 1
|
36
|
+
end
|
37
|
+
|
38
|
+
def initialize(owner, chatlist, scan_settings={})
|
39
|
+
super(owner, "Confirm Scan", DECOR_ALL, :width => 500, :height => 400)
|
40
|
+
|
41
|
+
FXMAPFUNC(SEL_COMMAND, ID_ACCEPT, :onAccept)
|
42
|
+
|
43
|
+
base_frame = FXVerticalFrame.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :padding => 0)
|
44
|
+
FXLabel.new(base_frame, "The following #{chatlist.length} chats will be scanned:")
|
45
|
+
|
46
|
+
# @chatTable = ConversationTable.new(base_frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
47
|
+
@chatTable = ConversationTable.new(base_frame)
|
48
|
+
@chatTable.showConversation(chatlist)
|
49
|
+
|
50
|
+
buttons_frame = FXHorizontalFrame.new(base_frame,
|
51
|
+
:opts => LAYOUT_FILL_X|LAYOUT_SIDE_TOP)
|
52
|
+
|
53
|
+
@finishButton = FXButton.new(buttons_frame, "Accept" , nil, nil, :opts => BUTTON_NORMAL|LAYOUT_RIGHT)
|
54
|
+
@finishButton.enable
|
55
|
+
@finishButton.connect(SEL_COMMAND) do |sender, sel, item|
|
56
|
+
#self.handle(self, FXSEL(SEL_COMMAND, ID_CANCEL), nil)
|
57
|
+
self.handle(self, FXSEL(SEL_COMMAND, ID_ACCEPT), nil)
|
58
|
+
end
|
59
|
+
|
60
|
+
@cancelButton = FXButton.new(buttons_frame, "Cancel" ,
|
61
|
+
:target => self, :selector => FXDialogBox::ID_CANCEL,
|
62
|
+
:opts => BUTTON_NORMAL|LAYOUT_RIGHT)
|
63
|
+
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|