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,380 @@
|
|
1
|
+
# .
|
2
|
+
# define_scope_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
|
+
require 'fox16'
|
23
|
+
|
24
|
+
include Fox
|
25
|
+
|
26
|
+
module Watobo
|
27
|
+
module Gui
|
28
|
+
|
29
|
+
|
30
|
+
class ScopeDetailsFrame < FXVerticalFrame
|
31
|
+
|
32
|
+
# def fxMessageBox()
|
33
|
+
# FXMessageBox.information(self, MBOX_OK, "Wrong Signature Format", "Signature Format is wrong. Must be a valid regular expression, e.g.(<Regex>) <^Location.*action=logout>")
|
34
|
+
# end
|
35
|
+
|
36
|
+
def getDetails
|
37
|
+
d = Hash.new
|
38
|
+
d[:root_path] = @rootpath_dt.value
|
39
|
+
path_array = []
|
40
|
+
@expath_list.each do |p|
|
41
|
+
path_array.push p.data
|
42
|
+
end
|
43
|
+
d[:excluded_paths] = path_array
|
44
|
+
d
|
45
|
+
end
|
46
|
+
|
47
|
+
def removePattern(list_box, pattern)
|
48
|
+
index = list_box.currentItem
|
49
|
+
if index >= 0
|
50
|
+
list_box.removeItem(index)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def addPattern(list_box, pattern)
|
55
|
+
if pattern != "" then
|
56
|
+
pattern_ok, *error = Watobo::Utils.checkRegex(pattern)
|
57
|
+
if pattern_ok == true
|
58
|
+
item = list_box.appendItem("#{pattern}")
|
59
|
+
list_box.setItemData(item, pattern)
|
60
|
+
list_box.sortItems()
|
61
|
+
|
62
|
+
else
|
63
|
+
FXMessageBox.information(self, MBOX_OK, "Wrong Path Format", "Path must be a Regex!!!\nError: #{error.join('\n')}")
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def updateFrame(details)
|
69
|
+
@rootpath_dt.value = details[:root_path]
|
70
|
+
@rootpath_field.handle(self, FXSEL(SEL_UPDATE, 0), nil)
|
71
|
+
details[:excluded_paths].each do |p|
|
72
|
+
addPattern(@expath_list, p)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
def initialize(parent, details=nil)
|
77
|
+
|
78
|
+
@rootpath_dt = FXDataTarget.new('')
|
79
|
+
@expath_dt = FXDataTarget.new('')
|
80
|
+
|
81
|
+
|
82
|
+
super(parent, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
83
|
+
|
84
|
+
# main_frame = FXVerticalFrame.new(self, :opts => LAYOUT_FILL_Y|LAYOUT_FILL_X|FRAME_NONE, :padding => 0)
|
85
|
+
title_frame = FXHorizontalFrame.new(self, :opts => LAYOUT_FILL_X|FRAME_GROOVE)
|
86
|
+
title = FXLabel.new(title_frame, "Site:", :opts => LAYOUT_TOP)
|
87
|
+
title = FXLabel.new(title_frame, "#{details[:site]}")
|
88
|
+
title.setFont(FXFont.new(getApp(), "helvetica", 12, FONTWEIGHT_BOLD, FONTSLANT_ITALIC, FONTENCODING_DEFAULT))
|
89
|
+
#
|
90
|
+
# ROOT PATH BOX
|
91
|
+
gbframe = FXGroupBox.new(self, "Root Path", LAYOUT_SIDE_RIGHT|FRAME_GROOVE|LAYOUT_FILL_X|LAYOUT_FILL_Y, 0, 0, 0, 0)
|
92
|
+
frame = FXVerticalFrame.new(gbframe, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :padding => 0)
|
93
|
+
#text_frame = FXHorizontalFrame.new(frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_NONE, :padding =>0)
|
94
|
+
fxtext = FXText.new(frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|TEXT_WORDWRAP)
|
95
|
+
fxtext.backColor = fxtext.parent.backColor
|
96
|
+
fxtext.disable
|
97
|
+
text = "The Root Path defines the application root of the site. " +
|
98
|
+
"Only URLs which include the Root Path will be tested during a scan." +
|
99
|
+
"\nSetting the Root Path to 'myapp', only URLs that begin with http://#{details[:site]}/myapp/ will be tested."
|
100
|
+
fxtext.setText(text)
|
101
|
+
|
102
|
+
input_frame = FXHorizontalFrame.new(frame, :opts => LAYOUT_FILL_X|FRAME_NONE)
|
103
|
+
FXLabel.new(input_frame,"Root Path (RegEx):")
|
104
|
+
@rootpath_field = FXTextField.new(input_frame, 0, :target => @rootpath_dt, :selector => FXDataTarget::ID_VALUE, :opts => LAYOUT_FILL_X|TEXTFIELD_NORMAL|LAYOUT_SIDE_LEFT)
|
105
|
+
|
106
|
+
#
|
107
|
+
# EXCLUDED
|
108
|
+
|
109
|
+
gbframe = FXGroupBox.new(self, "Excluded Path's", LAYOUT_SIDE_RIGHT|FRAME_GROOVE|LAYOUT_FILL_X, 0, 0, 0, 0)
|
110
|
+
frame = FXVerticalFrame.new(gbframe, :opts => LAYOUT_FILL_X, :padding => 0)
|
111
|
+
fxtext = FXText.new(frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|TEXT_WORDWRAP)
|
112
|
+
fxtext.backColor = fxtext.parent.backColor
|
113
|
+
fxtext.disable
|
114
|
+
text = "URLs which match a pattern will not be tested during a scan."
|
115
|
+
fxtext.setText(text)
|
116
|
+
input_frame = FXHorizontalFrame.new(frame, :opts => LAYOUT_FILL_X)
|
117
|
+
@expath_field = FXTextField.new(input_frame, 20, :target => @expath_dt, :selector => FXDataTarget::ID_VALUE, :opts => TEXTFIELD_NORMAL|LAYOUT_SIDE_LEFT|LAYOUT_FILL_X)
|
118
|
+
@remExPath = FXButton.new(input_frame, "Remove" , :opts => BUTTON_NORMAL|LAYOUT_RIGHT)
|
119
|
+
@addExPath = FXButton.new(input_frame, "Add" , :opts => BUTTON_NORMAL|LAYOUT_RIGHT)
|
120
|
+
|
121
|
+
list_frame = FXVerticalFrame.new(frame, :opts => LAYOUT_FILL_X|FRAME_SUNKEN, :padding => 0)
|
122
|
+
@expath_list = FXList.new(list_frame, :opts => LIST_EXTENDEDSELECT|LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
123
|
+
@expath_list.numVisible = 5
|
124
|
+
|
125
|
+
@expath_list.connect(SEL_COMMAND){ |sender, sel, item|
|
126
|
+
@expath_dt.value = sender.getItemText(item)
|
127
|
+
@expath_field.handle(self, FXSEL(SEL_UPDATE, 0), nil)
|
128
|
+
}
|
129
|
+
|
130
|
+
@remExPath.connect(SEL_COMMAND){ |sender, sel, item|
|
131
|
+
removePattern(@expath_list, @expath_dt.value) if @expath_dt.value != ''
|
132
|
+
@expath_dt.value = ''
|
133
|
+
@expath_field.handle(self, FXSEL(SEL_UPDATE, 0), nil)
|
134
|
+
}
|
135
|
+
@addExPath.connect(SEL_COMMAND){ |sender, sel, item|
|
136
|
+
|
137
|
+
addPattern(@expath_list, @expath_dt.value) if @expath_dt.value != ''
|
138
|
+
@expath_dt.value = ''
|
139
|
+
@expath_field.handle(self, FXSEL(SEL_UPDATE, 0), nil)
|
140
|
+
}
|
141
|
+
|
142
|
+
@expath_dt.connect(SEL_COMMAND){ |sender, sel, item|
|
143
|
+
|
144
|
+
addPattern(@expath_list, @expath_dt.value) if @expath_dt.value != ''
|
145
|
+
@expath_dt.value = ''
|
146
|
+
@expath_field.handle(self, FXSEL(SEL_UPDATE, 0), nil)
|
147
|
+
}
|
148
|
+
|
149
|
+
updateFrame(details)
|
150
|
+
self.update
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
class EditScopeDetailsDialog < FXDialogBox
|
157
|
+
|
158
|
+
attr :details
|
159
|
+
|
160
|
+
include Responder
|
161
|
+
|
162
|
+
def onAccept(sender, sel, event)
|
163
|
+
@details = @scopeDetailsFrame.getDetails()
|
164
|
+
root_path_ok, *error = Watobo::Utils.checkRegex(@details[:root_path])
|
165
|
+
if root_path_ok == true
|
166
|
+
getApp().stopModal(self, 1)
|
167
|
+
self.hide()
|
168
|
+
return 1
|
169
|
+
else
|
170
|
+
FXMessageBox.information(self, MBOX_OK, "Wrong Root Path Format", "Root Path must be a Regex!!!\nError: #{error.join('\n')}")
|
171
|
+
end
|
172
|
+
|
173
|
+
end
|
174
|
+
|
175
|
+
def initialize(owner, details)
|
176
|
+
|
177
|
+
super(owner, "Scope Details",
|
178
|
+
:opts => DECOR_TITLE|DECOR_BORDER|LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT, :width => 350, :height => 500)
|
179
|
+
|
180
|
+
FXMAPFUNC(SEL_COMMAND, ID_ACCEPT, :onAccept)
|
181
|
+
|
182
|
+
@details = (details.is_a? Hash) ? details : Hash.new
|
183
|
+
|
184
|
+
@root_path = FXDataTarget.new('')
|
185
|
+
main_frame = FXVerticalFrame.new(self, :opts => LAYOUT_FILL_Y|LAYOUT_FILL_X|FRAME_NONE, :padding => 0)
|
186
|
+
@scopeDetailsFrame = ScopeDetailsFrame.new(main_frame, details)
|
187
|
+
|
188
|
+
button_frame = FXHorizontalFrame.new(main_frame, :opts => LAYOUT_FILL_X)
|
189
|
+
accept = FXButton.new(button_frame, "&Accept", nil, self, ID_ACCEPT,
|
190
|
+
FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y)
|
191
|
+
accept.enable
|
192
|
+
# Cancel
|
193
|
+
FXButton.new(button_frame, "&Cancel", nil, self, ID_CANCEL,
|
194
|
+
FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y)
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
class DefineScopeFrame < FXVerticalFrame
|
199
|
+
|
200
|
+
def onDeselectAll(sender, sel, item)
|
201
|
+
@dummy_scope.each do |site, val|
|
202
|
+
@cb_sites[site].setCheck(false)
|
203
|
+
@edit_btns[site].disable
|
204
|
+
end
|
205
|
+
@sel_all_btn.setFocus()
|
206
|
+
@sel_all_btn.setDefault()
|
207
|
+
|
208
|
+
end
|
209
|
+
|
210
|
+
def onSelectAll(sender, sel, item)
|
211
|
+
sites = []
|
212
|
+
@dummy_scope.each do |site, scope|
|
213
|
+
@cb_sites[site].setCheck(true)
|
214
|
+
@edit_btns[site].enable
|
215
|
+
end
|
216
|
+
@desel_all_btn.setFocus()
|
217
|
+
@desel_all_btn.setDefault()
|
218
|
+
end
|
219
|
+
|
220
|
+
def editSiteDetails(site)
|
221
|
+
dlg = EditScopeDetailsDialog.new(self, @dummy_scope[site])
|
222
|
+
|
223
|
+
if dlg.execute != 0
|
224
|
+
@dummy_scope[site].update dlg.details
|
225
|
+
puts dlg.details.to_yaml
|
226
|
+
end
|
227
|
+
end
|
228
|
+
|
229
|
+
def getScope()
|
230
|
+
scope = Hash.new
|
231
|
+
@cb_sites.keys.each do |site|
|
232
|
+
@dummy_scope.delete(site) if !@cb_sites[site].checked?
|
233
|
+
# scope[site] = @dummy_scope[site] if @cb_sites[site].checked?
|
234
|
+
end
|
235
|
+
return @dummy_scope
|
236
|
+
end
|
237
|
+
|
238
|
+
def updateFrame()
|
239
|
+
@dummy_scope.each do |site, scope|
|
240
|
+
next if @cb_sites[site].nil?
|
241
|
+
@cb_sites[site].setCheck(scope[:enabled])
|
242
|
+
@cb_sites[site].checked? ? @edit_btns[site].enable : @edit_btns[site].disable
|
243
|
+
end
|
244
|
+
|
245
|
+
end
|
246
|
+
|
247
|
+
def setScope(scope)
|
248
|
+
@scope = scope
|
249
|
+
@dummy_scope.keys.each do |site|
|
250
|
+
@dummy_scope[site].update @scope[site] if !@scope[site].nil?
|
251
|
+
end
|
252
|
+
updateFrame()
|
253
|
+
end
|
254
|
+
|
255
|
+
def initialize(owner, sites, scope, opts)
|
256
|
+
super(owner, :opts => opts, :padding => 0)
|
257
|
+
|
258
|
+
@dummy_scope = Hash.new
|
259
|
+
@dummy_scope = YAML.load(YAML.dump(scope)) if scope.is_a? Hash
|
260
|
+
|
261
|
+
@cb_sites = Hash.new
|
262
|
+
@edit_btns = Hash.new
|
263
|
+
|
264
|
+
title = FXLabel.new(self, "Target Scope")
|
265
|
+
info_frame = FXVerticalFrame.new(self, :opts => LAYOUT_FILL_X|FRAME_GROOVE)
|
266
|
+
title.setFont(FXFont.new(getApp(), "helvetica", 12, FONTWEIGHT_BOLD, FONTSLANT_ITALIC, FONTENCODING_DEFAULT))
|
267
|
+
|
268
|
+
scope_text =<<'EOF'
|
269
|
+
The target scopes affects primarly the
|
270
|
+
behaviour all WATOBO scanner tools.
|
271
|
+
Click the appropriate edit-button for more
|
272
|
+
detailed settings.
|
273
|
+
EOF
|
274
|
+
btn = FXButton.new(info_frame, scope_text,
|
275
|
+
:opts => LAYOUT_FILL_X|LAYOUT_FIX_HEIGHT, :height => 90)
|
276
|
+
#btn.font = @font
|
277
|
+
#btn.backColor = FXColor::White
|
278
|
+
btn.justify = JUSTIFY_LEFT
|
279
|
+
quickSelectFrame = FXHorizontalFrame.new(self, LAYOUT_FILL_X)
|
280
|
+
@sel_all_btn = FXButton.new(quickSelectFrame, "Select All", nil, nil, 0, FRAME_RAISED|FRAME_THICK|LAYOUT_FILL_X)
|
281
|
+
@sel_all_btn.connect(SEL_COMMAND, method(:onSelectAll))
|
282
|
+
|
283
|
+
@sel_all_btn.setFocus()
|
284
|
+
@sel_all_btn.setDefault()
|
285
|
+
|
286
|
+
@desel_all_btn = FXButton.new(quickSelectFrame, "Deselect All", nil, nil, 0, FRAME_RAISED|FRAME_THICK|LAYOUT_FILL_X)
|
287
|
+
@desel_all_btn.connect(SEL_COMMAND, method(:onDeselectAll))
|
288
|
+
frame = FXVerticalFrame.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_GROOVE, :padding => 0)
|
289
|
+
sitesArea = FXScrollWindow.new(frame, SCROLLERS_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
290
|
+
sitesFrame = FXVerticalFrame.new(sitesArea, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :padding => 0)
|
291
|
+
|
292
|
+
sites.sort.each do |site|
|
293
|
+
site_frame = FXHorizontalFrame.new(sitesFrame, :opts => LAYOUT_FILL_X)
|
294
|
+
b = FXCheckButton.new(site_frame, site, nil, 0, ICON_BEFORE_TEXT|LAYOUT_SIDE_LEFT)
|
295
|
+
eb = FXButton.new(site_frame, "edit..", nil, nil, 0, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT)
|
296
|
+
@edit_btns[site] = eb
|
297
|
+
|
298
|
+
b.connect(SEL_COMMAND){
|
299
|
+
b.checked? ? @edit_btns[site].enable : @edit_btns[site].disable
|
300
|
+
@dummy_scope[site][:enabled] = true
|
301
|
+
}
|
302
|
+
|
303
|
+
|
304
|
+
@cb_sites[site] = b
|
305
|
+
b.setCheck(false)
|
306
|
+
scope_details = {
|
307
|
+
:site => site,
|
308
|
+
:enabled => false,
|
309
|
+
:root_path => '',
|
310
|
+
:excluded_paths => [],
|
311
|
+
#:exclude_pattern => []
|
312
|
+
}
|
313
|
+
|
314
|
+
if !@dummy_scope[site]
|
315
|
+
@dummy_scope[site] = scope_details
|
316
|
+
else
|
317
|
+
@dummy_scope[site][:enabled] = true
|
318
|
+
end
|
319
|
+
|
320
|
+
|
321
|
+
eb.connect(SEL_COMMAND){
|
322
|
+
editSiteDetails(site)
|
323
|
+
}
|
324
|
+
|
325
|
+
end
|
326
|
+
updateFrame()
|
327
|
+
end
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
end #EOC
|
332
|
+
#--
|
333
|
+
end
|
334
|
+
end
|
335
|
+
|
336
|
+
|
337
|
+
if __FILE__ == $0
|
338
|
+
require '../utils/check_regex'
|
339
|
+
|
340
|
+
class TestGui < FXMainWindow
|
341
|
+
|
342
|
+
def initialize(app)
|
343
|
+
# Call base class initializer first
|
344
|
+
super(app, "Test Application", :width => 800, :height => 600)
|
345
|
+
frame = FXVerticalFrame.new(self, LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_GROOVE)
|
346
|
+
|
347
|
+
pbButton = FXButton.new(frame, "create FXProgressBar",:opts => FRAME_THICK|FRAME_RAISED|LAYOUT_FILL_X|LAYOUT_TOP|LAYOUT_LEFT,:padLeft => 10, :padRight => 10, :padTop => 5, :padBottom => 5)
|
348
|
+
|
349
|
+
@scope_details = {
|
350
|
+
:site => "127.0.0.1",
|
351
|
+
:enabled => false,
|
352
|
+
:root_path => '',
|
353
|
+
:excluded_paths => [],
|
354
|
+
#:exclude_pattern => []
|
355
|
+
}
|
356
|
+
pbButton.connect(SEL_COMMAND) {
|
357
|
+
|
358
|
+
dlg = Watobo::Gui::EditScopeDetailsDialog.new(self,scope_details)
|
359
|
+
|
360
|
+
if dlg.execute != 0
|
361
|
+
puts dlg.details.to_yaml
|
362
|
+
end
|
363
|
+
}
|
364
|
+
end
|
365
|
+
# Create and show the main window
|
366
|
+
def create
|
367
|
+
super # Create the windows
|
368
|
+
show(PLACEMENT_SCREEN) # Make the main window appear
|
369
|
+
dlg = Watobo::Gui::EditScopeDetailsDialog.new(self, @scope_details)
|
370
|
+
|
371
|
+
if dlg.execute != 0
|
372
|
+
puts dlg.details.to_yaml
|
373
|
+
end
|
374
|
+
end
|
375
|
+
end
|
376
|
+
application = FXApp.new('LayoutTester', 'FoxTest')
|
377
|
+
TestGui.new(application)
|
378
|
+
application.create
|
379
|
+
application.run
|
380
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# .
|
2
|
+
# edit_comment.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 EditCommentDialog < FXDialogBox
|
25
|
+
def comment()
|
26
|
+
@textbox.to_s
|
27
|
+
end
|
28
|
+
|
29
|
+
def initialize(owner, chat)
|
30
|
+
#super(owner, "Edit Target Scope", DECOR_TITLE|DECOR_BORDER, :width => 300, :height => 425)
|
31
|
+
super(owner, "Edit Comment", DECOR_ALL, :width => 300, :height => 150)
|
32
|
+
|
33
|
+
base_frame = FXVerticalFrame.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
34
|
+
|
35
|
+
# puts "create scopeframe with scope:"
|
36
|
+
# @project.scope
|
37
|
+
text_frame = FXVerticalFrame.new(base_frame, LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN|FRAME_THICK, :padding => 0)
|
38
|
+
@textbox = FXText.new(text_frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|TEXT_WORDWRAP)
|
39
|
+
@textbox.setText(chat.comment)
|
40
|
+
@textbox.setFocus()
|
41
|
+
@textbox.setDefault()
|
42
|
+
|
43
|
+
@textbox.connect(SEL_KEYPRESS) { |sender, sel, event|
|
44
|
+
if event.code == KEY_Tab
|
45
|
+
@finishButton.setFocus()
|
46
|
+
@finishButton.setDefault()
|
47
|
+
true
|
48
|
+
else
|
49
|
+
false
|
50
|
+
end
|
51
|
+
|
52
|
+
}
|
53
|
+
buttons_frame = FXHorizontalFrame.new(base_frame,
|
54
|
+
:opts => LAYOUT_FILL_X|LAYOUT_SIDE_TOP)
|
55
|
+
|
56
|
+
@finishButton = FXButton.new(buttons_frame, "Accept" , nil, nil, :opts => BUTTON_NORMAL|LAYOUT_RIGHT)
|
57
|
+
@finishButton.enable
|
58
|
+
@finishButton.connect(SEL_COMMAND) do |sender, sel, item|
|
59
|
+
#self.handle(self, FXSEL(SEL_COMMAND, ID_CANCEL), nil)
|
60
|
+
self.handle(self, FXSEL(SEL_COMMAND, ID_ACCEPT), nil)
|
61
|
+
end
|
62
|
+
|
63
|
+
@cancelButton = FXButton.new(buttons_frame, "Cancel" ,
|
64
|
+
:target => self, :selector => FXDialogBox::ID_CANCEL,
|
65
|
+
:opts => BUTTON_NORMAL|LAYOUT_RIGHT)
|
66
|
+
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# .
|
2
|
+
# edit_scope_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 EditScopeDialog < FXDialogBox
|
25
|
+
|
26
|
+
include Responder
|
27
|
+
|
28
|
+
attr :scope
|
29
|
+
def onAccept(sender, sel, event)
|
30
|
+
|
31
|
+
@scope = @defineScopeFrame.getScope()
|
32
|
+
|
33
|
+
getApp().stopModal(self, 1)
|
34
|
+
self.hide()
|
35
|
+
return 1
|
36
|
+
end
|
37
|
+
|
38
|
+
def initialize(owner, project, prefs)
|
39
|
+
#super(owner, "Edit Target Scope", DECOR_TITLE|DECOR_BORDER, :width => 300, :height => 425)
|
40
|
+
super(owner, "Edit Target Scope", DECOR_ALL, :width => 300, :height => 425)
|
41
|
+
@project = project
|
42
|
+
@scope = Hash.new
|
43
|
+
|
44
|
+
FXMAPFUNC(SEL_COMMAND, ID_ACCEPT, :onAccept)
|
45
|
+
|
46
|
+
base_frame = FXVerticalFrame.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
47
|
+
|
48
|
+
# puts "create scopeframe with scope:"
|
49
|
+
# @project.scope
|
50
|
+
@defineScopeFrame = DefineScopeFrame.new(base_frame, @project.listSites(), YAML.load(YAML.dump(@project.scope)), prefs)
|
51
|
+
|
52
|
+
buttons_frame = FXHorizontalFrame.new(base_frame,
|
53
|
+
:opts => LAYOUT_FILL_X|LAYOUT_SIDE_TOP)
|
54
|
+
|
55
|
+
@finishButton = FXButton.new(buttons_frame, "Accept" , nil, nil, :opts => BUTTON_NORMAL|LAYOUT_RIGHT)
|
56
|
+
@finishButton.enable
|
57
|
+
@finishButton.connect(SEL_COMMAND) do |sender, sel, item|
|
58
|
+
#self.handle(self, FXSEL(SEL_COMMAND, ID_CANCEL), nil)
|
59
|
+
self.handle(self, FXSEL(SEL_COMMAND, ID_ACCEPT), nil)
|
60
|
+
end
|
61
|
+
|
62
|
+
@cancelButton = FXButton.new(buttons_frame, "Cancel" ,
|
63
|
+
:target => self, :selector => FXDialogBox::ID_CANCEL,
|
64
|
+
:opts => BUTTON_NORMAL|LAYOUT_RIGHT)
|
65
|
+
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|