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,201 @@
|
|
1
|
+
# .
|
2
|
+
# interceptor_settings_dialog.rb
|
3
|
+
#
|
4
|
+
# Copyright 2012 by siberas, http://www.siberas.de
|
5
|
+
#
|
6
|
+
# This file is part of WATOBO (Web Application Tool Box)
|
7
|
+
# http://watobo.sourceforge.com
|
8
|
+
#
|
9
|
+
# WATOBO is free software; you can redistribute it and/or modify
|
10
|
+
# it under the terms of the GNU General Public License as published by
|
11
|
+
# the Free Software Foundation version 2 of the License.
|
12
|
+
#
|
13
|
+
# WATOBO is distributed in the hope that it will be useful,
|
14
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
# GNU General Public License for more details.
|
17
|
+
#
|
18
|
+
# You should have received a copy of the GNU General Public License
|
19
|
+
# along with WATOBO; if not, write to the Free Software
|
20
|
+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
21
|
+
# .
|
22
|
+
module Watobo
|
23
|
+
module Gui
|
24
|
+
|
25
|
+
class InterceptorSettingsFrame < FXVerticalFrame
|
26
|
+
|
27
|
+
def getSettings()
|
28
|
+
settings = Hash.new
|
29
|
+
settings[:port] = @port_dt.value
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
dummy = []
|
34
|
+
@ct_list.each do |nup|
|
35
|
+
dummy.push nup.data
|
36
|
+
end
|
37
|
+
settings[:pass_through] = {
|
38
|
+
:content_types => dummy,
|
39
|
+
:content_length => @content_length_dt.value
|
40
|
+
}
|
41
|
+
|
42
|
+
return settings
|
43
|
+
end
|
44
|
+
|
45
|
+
def addItem(list_box, item)
|
46
|
+
if item != "" then
|
47
|
+
list_item = list_box.appendItem("#{item}")
|
48
|
+
list_box.setItemData(list_item, item)
|
49
|
+
list_box.sortItems()
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def removePattern(list_box)
|
54
|
+
index = list_box.currentItem
|
55
|
+
if index >= 0
|
56
|
+
list_box.removeItem(index)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def initialize(owner, opts)
|
61
|
+
super(owner, opts)
|
62
|
+
|
63
|
+
#@settings = interceptor_settings
|
64
|
+
scroller = FXScrollWindow.new(self, :opts => SCROLLERS_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
65
|
+
scroll_area = FXVerticalFrame.new(scroller, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :padding => 0)
|
66
|
+
|
67
|
+
gbox = FXGroupBox.new(scroll_area, "Listening Port", LAYOUT_SIDE_RIGHT|FRAME_GROOVE|LAYOUT_FILL_X, 0, 0, 0, 0)
|
68
|
+
gbox_frame = FXVerticalFrame.new(gbox, :opts => LAYOUT_SIDE_TOP|PACK_UNIFORM_WIDTH)
|
69
|
+
|
70
|
+
frame = FXHorizontalFrame.new(gbox_frame, :opts => LAYOUT_FILL_X)
|
71
|
+
FXLabel.new(frame, "Listen Port:")
|
72
|
+
@port_dt = FXDataTarget.new(0)
|
73
|
+
#@port_dt.value = @settings[:port]
|
74
|
+
@port_dt.value = Watobo::Conf::Interceptor.port
|
75
|
+
lport = FXTextField.new(frame, 5, @port_dt, FXDataTarget::ID_VALUE, :opts => JUSTIFY_RIGHT|FRAME_GROOVE|FRAME_SUNKEN)
|
76
|
+
lport.handle(self, FXSEL(SEL_UPDATE, 0), nil)
|
77
|
+
|
78
|
+
|
79
|
+
gbframe = FXGroupBox.new(scroll_area, "Pass-Through Content-Length", LAYOUT_SIDE_RIGHT|FRAME_GROOVE|LAYOUT_FILL_X, 0, 0, 0, 0)
|
80
|
+
frame = FXVerticalFrame.new(gbframe, :opts => LAYOUT_FILL_X, :padding => 0)
|
81
|
+
fxtext = FXText.new(frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|TEXT_WORDWRAP)
|
82
|
+
fxtext.backColor = fxtext.parent.backColor
|
83
|
+
fxtext.disable
|
84
|
+
text = "Define Content-Length threshold for Pass-Through. Responses which Content-Length exceed this size will be forwarded."
|
85
|
+
fxtext.setText(text)
|
86
|
+
input_frame = FXHorizontalFrame.new(frame, :opts => LAYOUT_FILL_X)
|
87
|
+
FXLabel.new(input_frame, "Max. Content-Length:")
|
88
|
+
@content_length_dt = FXDataTarget.new('')
|
89
|
+
#@content_length_dt.value = @settings[:pass_through][:content_length]
|
90
|
+
@content_length_dt.value = Watobo::Conf::Interceptor.pass_through[:content_length]
|
91
|
+
content_length_field = FXTextField.new(input_frame, 7, :target => @content_length_dt, :selector => FXDataTarget::ID_VALUE, :opts => TEXTFIELD_NORMAL|LAYOUT_SIDE_LEFT)
|
92
|
+
content_length_field.handle(self, FXSEL(SEL_UPDATE, 0), nil)
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
gbframe = FXGroupBox.new(scroll_area, "Pass-Through Content-Types", LAYOUT_SIDE_RIGHT|FRAME_GROOVE|LAYOUT_FILL_X, 0, 0, 0, 0)
|
97
|
+
frame = FXVerticalFrame.new(gbframe, :opts => LAYOUT_FILL_X, :padding => 0)
|
98
|
+
fxtext = FXText.new(frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|TEXT_WORDWRAP)
|
99
|
+
fxtext.backColor = fxtext.parent.backColor
|
100
|
+
fxtext.disable
|
101
|
+
text = "Define Content-Types for Pass-Through. Responses which are forwarded will not be inspected by Passive-Checks. So you only should define Content-Types which in general contain binary data."
|
102
|
+
fxtext.setText(text)
|
103
|
+
input_frame = FXHorizontalFrame.new(frame, :opts => LAYOUT_FILL_X)
|
104
|
+
@ct_dt = FXDataTarget.new('')
|
105
|
+
@ct_field = FXTextField.new(input_frame, 20, :target => @ct_dt, :selector => FXDataTarget::ID_VALUE, :opts => TEXTFIELD_NORMAL|LAYOUT_SIDE_LEFT|LAYOUT_FILL_X)
|
106
|
+
@rem_ct_btn = FXButton.new(input_frame, "Remove" , :opts => BUTTON_NORMAL|LAYOUT_RIGHT)
|
107
|
+
@add_ct_btn = FXButton.new(input_frame, "Add" , :opts => BUTTON_NORMAL|LAYOUT_RIGHT)
|
108
|
+
|
109
|
+
list_frame = FXVerticalFrame.new(frame, :opts => LAYOUT_FILL_X|FRAME_SUNKEN, :padding => 0)
|
110
|
+
@ct_list = FXList.new(list_frame, :opts => LIST_EXTENDEDSELECT|LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
111
|
+
@ct_list.numVisible = 5
|
112
|
+
|
113
|
+
@ct_list.connect(SEL_COMMAND){ |sender, sel, item|
|
114
|
+
@ct_dt.value = sender.getItemText(item)
|
115
|
+
@ct_field.handle(self, FXSEL(SEL_UPDATE, 0), nil)
|
116
|
+
}
|
117
|
+
|
118
|
+
# @settings[:pass_through][:content_types].each do |nup|
|
119
|
+
Watobo::Conf::Interceptor.pass_through[:content_types].each do |nup|
|
120
|
+
addItem(@ct_list, nup)
|
121
|
+
end
|
122
|
+
|
123
|
+
@rem_ct_btn.connect(SEL_COMMAND){ |sender, sel, item|
|
124
|
+
removePattern(@ct_list) if @ct_dt.value != ''
|
125
|
+
@ct_dt.value = ''
|
126
|
+
@ct_field.handle(self, FXSEL(SEL_UPDATE, 0), nil)
|
127
|
+
}
|
128
|
+
@add_ct_btn.connect(SEL_COMMAND){ |sender, sel, item|
|
129
|
+
|
130
|
+
addItem(@ct_list, @ct_dt.value) if @ct_dt.value != ''
|
131
|
+
@ct_dt.value = ''
|
132
|
+
@ct_field.handle(self, FXSEL(SEL_UPDATE, 0), nil)
|
133
|
+
}
|
134
|
+
|
135
|
+
@ct_dt.connect(SEL_COMMAND){ |sender, sel, item|
|
136
|
+
|
137
|
+
addItem(@ct_list, @ct_dt.value) if @ct_dt.value != ''
|
138
|
+
@ct_dt.value = ''
|
139
|
+
@ct_field.handle(self, FXSEL(SEL_UPDATE, 0), nil)
|
140
|
+
}
|
141
|
+
|
142
|
+
end
|
143
|
+
|
144
|
+
end
|
145
|
+
|
146
|
+
#
|
147
|
+
# Class: SelectNonUniqueParmsDialog
|
148
|
+
#
|
149
|
+
class InterceptorSettingsDialog < FXDialogBox
|
150
|
+
|
151
|
+
include Responder
|
152
|
+
attr :interceptor_settings
|
153
|
+
|
154
|
+
|
155
|
+
def onAccept(sender, sel, event)
|
156
|
+
|
157
|
+
@interceptor_settings = @interceptorSettingsFrame.getSettings()
|
158
|
+
|
159
|
+
getApp().stopModal(self, 1)
|
160
|
+
self.hide()
|
161
|
+
return 1
|
162
|
+
end
|
163
|
+
|
164
|
+
|
165
|
+
def initialize(owner)
|
166
|
+
super(owner, "Interceptor Settings", DECOR_TITLE|DECOR_BORDER, :width => 400, :height => 500)
|
167
|
+
#@interceptor_settings = interceptor_settings
|
168
|
+
FXMAPFUNC(SEL_COMMAND, ID_ACCEPT, :onAccept)
|
169
|
+
|
170
|
+
|
171
|
+
base_frame = FXVerticalFrame.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
172
|
+
|
173
|
+
# puts "create scopeframe with scope:"
|
174
|
+
# @project.scope
|
175
|
+
# @defineScopeFrame = DefineScopeFrame.new(base_frame, @project.listSites(), YAML.load(YAML.dump(@project.scope)), prefs)
|
176
|
+
@interceptorSettingsFrame = InterceptorSettingsFrame.new(base_frame, :opts => SCROLLERS_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
177
|
+
|
178
|
+
buttons_frame = FXHorizontalFrame.new(base_frame,
|
179
|
+
:opts => LAYOUT_FILL_X|LAYOUT_SIDE_TOP)
|
180
|
+
|
181
|
+
@finishButton = FXButton.new(buttons_frame, "Accept" , nil, nil, :opts => BUTTON_NORMAL|LAYOUT_RIGHT)
|
182
|
+
@finishButton.enable
|
183
|
+
@finishButton.connect(SEL_COMMAND) do |sender, sel, item|
|
184
|
+
#self.handle(self, FXSEL(SEL_COMMAND, ID_CANCEL), nil)
|
185
|
+
self.handle(self, FXSEL(SEL_COMMAND, ID_ACCEPT), nil)
|
186
|
+
end
|
187
|
+
|
188
|
+
@cancelButton = FXButton.new(buttons_frame, "Cancel" ,
|
189
|
+
:target => self, :selector => FXDialogBox::ID_CANCEL,
|
190
|
+
:opts => BUTTON_NORMAL|LAYOUT_RIGHT)
|
191
|
+
|
192
|
+
|
193
|
+
end
|
194
|
+
end
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
|
199
|
+
if __FILE__ == $0
|
200
|
+
# TODO Generated stub
|
201
|
+
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
# .
|
2
|
+
# log_viewer.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 LogViewer < FXVerticalFrame
|
25
|
+
|
26
|
+
include Watobo::Constants
|
27
|
+
|
28
|
+
def purge
|
29
|
+
@lock.synchronize do
|
30
|
+
@log_viewer.text = ''
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def log(sender=nil, log_level, msg )
|
35
|
+
puts "#{sender.class} => #{msg}" if $DEBUG
|
36
|
+
begin
|
37
|
+
t = Time.now
|
38
|
+
now = t.strftime("%m/%d/%Y @ %H:%M:%S")
|
39
|
+
|
40
|
+
begin
|
41
|
+
log_text = case log_level
|
42
|
+
when LOG_INFO
|
43
|
+
"#{now}: #{msg}\n"
|
44
|
+
else
|
45
|
+
""
|
46
|
+
end
|
47
|
+
rescue => bang
|
48
|
+
puts bang
|
49
|
+
puts bang.backtrace if $DEBUG
|
50
|
+
end
|
51
|
+
@lock.synchronize do
|
52
|
+
log_text << @log_message unless @log_message.nil?
|
53
|
+
@log_message = log_text
|
54
|
+
end
|
55
|
+
rescue => bang
|
56
|
+
puts bang
|
57
|
+
puts bang.backtrace
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
|
62
|
+
def start_update_timer
|
63
|
+
@timer = FXApp.instance.addTimeout( 50, :repeat => true) {
|
64
|
+
@lock.synchronize do
|
65
|
+
unless @log_message.nil?
|
66
|
+
@log_viewer.insertText(0,@log_message) unless @log_message.empty?
|
67
|
+
@log_message = nil
|
68
|
+
end
|
69
|
+
end
|
70
|
+
}
|
71
|
+
end
|
72
|
+
|
73
|
+
def destroy
|
74
|
+
getApp().removeTimeout(@timer) unless @timer.nil?
|
75
|
+
super
|
76
|
+
1
|
77
|
+
end
|
78
|
+
|
79
|
+
def initialize(parent, opts)
|
80
|
+
opts[:padding] = 0
|
81
|
+
super(parent, opts)
|
82
|
+
|
83
|
+
@log_message = nil
|
84
|
+
@lock = Mutex.new
|
85
|
+
@timer = nil
|
86
|
+
|
87
|
+
#self.connect(SEL_CLOSE, method(:onClose))
|
88
|
+
|
89
|
+
@log_viewer = FXText.new(self, nil, 0, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
90
|
+
@log_viewer.editable = false
|
91
|
+
start_update_timer
|
92
|
+
end
|
93
|
+
|
94
|
+
end
|
95
|
+
|
96
|
+
end
|
97
|
+
end
|
@@ -0,0 +1,301 @@
|
|
1
|
+
# .
|
2
|
+
# login_wizzard.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
|
+
|
27
|
+
class FXLoginWizzard < FXDialogBox
|
28
|
+
|
29
|
+
attr_accessor :sid_patterns
|
30
|
+
attr_accessor :requestids
|
31
|
+
attr_accessor :project
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def onPatternClick(sender,sel,item)
|
36
|
+
@lastpattern=item
|
37
|
+
highlight_pattern(@pattern_list.getItemText(item))
|
38
|
+
@pattern.value = @pattern_list.getItemText(item)
|
39
|
+
@pattern.handle(self, FXSEL(SEL_UPDATE, 0), nil)
|
40
|
+
end
|
41
|
+
|
42
|
+
def onRequestClick(sender,sel,item)
|
43
|
+
@lastid=item
|
44
|
+
chat = @project.getChat(@request_list.getItemText(@lastid))
|
45
|
+
if chat then
|
46
|
+
show_chat(chat)
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
def show_chat(chat)
|
52
|
+
@requestView.setText('')
|
53
|
+
# Enable the style buffer for this text widget
|
54
|
+
@requestView.styled = true
|
55
|
+
|
56
|
+
atext=chat.request.join
|
57
|
+
atext.gsub!(/\r/, "")
|
58
|
+
@requestView.appendStyledText("#{atext}")
|
59
|
+
|
60
|
+
@responseView.setText('')
|
61
|
+
# Enable the style buffer for this text widget
|
62
|
+
@responseView.styled = true
|
63
|
+
|
64
|
+
atext=chat.response.join
|
65
|
+
atext.gsub!(/\r/, "")
|
66
|
+
@responseView.appendStyledText("#{atext}")
|
67
|
+
end
|
68
|
+
|
69
|
+
def update_request_list(idlist)
|
70
|
+
@request_list.clearItems
|
71
|
+
idlist.each do |chatid|
|
72
|
+
|
73
|
+
chat = @project.getChat(chatid)
|
74
|
+
puts chat.id
|
75
|
+
if chat then
|
76
|
+
#puts chatid
|
77
|
+
@lastid = @request_list.appendItem("#{chatid}")
|
78
|
+
@request_list.setItemData(@lastid, chat)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
def highlight_pattern(pattern)
|
87
|
+
return if @lastpattern < 0
|
88
|
+
return if @lastid < 0
|
89
|
+
|
90
|
+
chat = @request_list.getItemData(@lastid)
|
91
|
+
req_text=chat.request.join
|
92
|
+
req_text.gsub!(/\r/, "")
|
93
|
+
|
94
|
+
@requestView.setText("")
|
95
|
+
@requestView.appendStyledText("#{req_text}")
|
96
|
+
|
97
|
+
resp_text=chat.response.join
|
98
|
+
resp_text.gsub!(/\r/, "")
|
99
|
+
@responseView.setText("")
|
100
|
+
@responseView.appendStyledText("#{resp_text}")
|
101
|
+
begin
|
102
|
+
if req_text =~ /#{pattern}/ then
|
103
|
+
if $1 and $2 then
|
104
|
+
string1 = $1
|
105
|
+
string2 = $2
|
106
|
+
else
|
107
|
+
string1 = pattern
|
108
|
+
string2 = pattern
|
109
|
+
end
|
110
|
+
if req_text.index(string1) then
|
111
|
+
@requestView.changeStyle(req_text.index(string1),string1.length,1)
|
112
|
+
@requestView.changeStyle(req_text.index(string2),string2.length,1)
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
if resp_text =~ /#{pattern}/ then
|
117
|
+
if $1 and $2 then
|
118
|
+
string1 = $1
|
119
|
+
string2 = $2
|
120
|
+
else
|
121
|
+
string1 = pattern
|
122
|
+
string2 = pattern
|
123
|
+
end
|
124
|
+
if resp_text.index(string1) then
|
125
|
+
@responseView.changeStyle(resp_text.index(string1),string1.length,1)
|
126
|
+
@responseView.changeStyle(resp_text.index(string2),string2.length,1)
|
127
|
+
end
|
128
|
+
end
|
129
|
+
rescue
|
130
|
+
puts "+ no valid regex"
|
131
|
+
end
|
132
|
+
|
133
|
+
end
|
134
|
+
|
135
|
+
def addPattern(sender,sel,id)
|
136
|
+
if @pattern != "" then
|
137
|
+
@sid_patterns.push @pattern.value
|
138
|
+
update_pattern_list
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
def remPattern(sender,sel,id)
|
143
|
+
if @lastpattern >= 0 then
|
144
|
+
pattern = @pattern_list.getItemText(@lastpattern)
|
145
|
+
#@pattern_list.removeItem(@lastpattern)
|
146
|
+
@sid_patterns.delete(pattern)
|
147
|
+
@lastpattern = -1
|
148
|
+
update_pattern_list
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
def remRequest(sender,sel,id)
|
153
|
+
if @lastid >= 0 then
|
154
|
+
id = @request_list.getItemText(@lastid)
|
155
|
+
|
156
|
+
#@pattern_list.removeItem(@lastpattern)
|
157
|
+
@requestids.delete(id)
|
158
|
+
@lastid = -1
|
159
|
+
update_request_list(@requestids)
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
def updatePatternList
|
164
|
+
@pattern_list.clearItems
|
165
|
+
@sid_patterns.each do |pat|
|
166
|
+
@pattern_list.appendItem("#{pat}")
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
public
|
171
|
+
|
172
|
+
def add_request(chatid)
|
173
|
+
|
174
|
+
@requestids.push "#{chatid}"
|
175
|
+
chat = nil
|
176
|
+
|
177
|
+
|
178
|
+
@project.chat_list.each do |c|
|
179
|
+
chat = c
|
180
|
+
# puts "#{chat.id} : #{chatid}"
|
181
|
+
break if c.id == chatid
|
182
|
+
end
|
183
|
+
|
184
|
+
|
185
|
+
show_chat(chat)
|
186
|
+
update_request_list(@requestids)
|
187
|
+
|
188
|
+
end
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
def initialize(owner, project)
|
194
|
+
@project = project
|
195
|
+
# Invoke base class initialize function first
|
196
|
+
# super(owner, "LoginScript Wizzard", DECOR_TITLE|DECOR_BORDER,:width=>800, :height=>600)
|
197
|
+
super(owner, "LoginScript Wizzard", DECOR_ALL,:width=>800, :height=>600)
|
198
|
+
|
199
|
+
#self.icon = icon
|
200
|
+
# @project = nil
|
201
|
+
@sid_patterns = []
|
202
|
+
@requestids = []
|
203
|
+
@pattern = FXDataTarget.new("")
|
204
|
+
|
205
|
+
@sid_patterns = @project.settings[:sid_patterns].clone
|
206
|
+
@requestids = @project.loginscript_ids.clone
|
207
|
+
|
208
|
+
|
209
|
+
@lastid=-1
|
210
|
+
@lastpattern=-1
|
211
|
+
|
212
|
+
lw_main = FXPacker.new(self, :opts => LAYOUT_FILL)
|
213
|
+
lw_bottom = FXHorizontalFrame.new(lw_main, :opts => LAYOUT_FILL_X|LAYOUT_SIDE_BOTTOM)
|
214
|
+
lw_body = FXHorizontalFrame.new(lw_main, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|LAYOUT_SIDE_TOP)
|
215
|
+
|
216
|
+
|
217
|
+
#=============================================================================================
|
218
|
+
# body
|
219
|
+
|
220
|
+
lw_left = FXVerticalFrame.new(lw_body, :opts => LAYOUT_FILL_Y|LAYOUT_SIDE_LEFT)
|
221
|
+
lw_right = FXVerticalFrame.new(lw_body, :opts => LAYOUT_FILL_Y|LAYOUT_SIDE_RIGHT|LAYOUT_FILL_X)
|
222
|
+
|
223
|
+
|
224
|
+
#=============================================================================================
|
225
|
+
# lw_right
|
226
|
+
|
227
|
+
req_frame = FXVerticalFrame.new(lw_right, :opts => LAYOUT_FILL_X| LAYOUT_FILL_Y|FRAME_GROOVE)
|
228
|
+
resp_frame = FXVerticalFrame.new(lw_right, :opts => LAYOUT_FILL_X| LAYOUT_FILL_Y|FRAME_GROOVE)
|
229
|
+
|
230
|
+
FXLabel.new(req_frame, "Requests:" )
|
231
|
+
@requestView = FXText.new(req_frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
232
|
+
|
233
|
+
# Construct some hilite styles
|
234
|
+
hs_red = FXHiliteStyle.new
|
235
|
+
hs_red.normalForeColor = FXRGBA(255,255,255,255) #FXColor::Red
|
236
|
+
hs_red.normalBackColor = FXRGBA(255,0,0,1) # FXColor::White
|
237
|
+
hs_red.style = FXText::STYLE_BOLD
|
238
|
+
# Enable the style buffer for this text widget
|
239
|
+
@requestView.styled = true
|
240
|
+
# Set the styles
|
241
|
+
@requestView.hiliteStyles = [hs_red]
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
FXLabel.new(resp_frame, "Response:" )
|
246
|
+
@responseView = FXText.new(resp_frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
247
|
+
@responseView.styled = true
|
248
|
+
# Set the styles
|
249
|
+
@responseView.hiliteStyles = [hs_red]
|
250
|
+
|
251
|
+
#=============================================================================================
|
252
|
+
# sid-pattern
|
253
|
+
sid_frame = FXVerticalFrame.new(lw_left, :opts => LAYOUT_FILL_X|FRAME_GROOVE)
|
254
|
+
lw_sid = FXHorizontalFrame.new(sid_frame, :opts => LAYOUT_FILL_X)
|
255
|
+
FXLabel.new(lw_sid, "Pattern:" )
|
256
|
+
FXTextField.new(lw_sid, 20,
|
257
|
+
:target => @pattern, :selector => FXDataTarget::ID_VALUE,
|
258
|
+
:opts => TEXTFIELD_NORMAL|LAYOUT_SIDE_LEFT)
|
259
|
+
|
260
|
+
addPattern=FXButton.new(lw_sid, " + " , :opts => BUTTON_NORMAL|LAYOUT_LEFT)
|
261
|
+
addPattern.connect(SEL_COMMAND, method(:addPattern))
|
262
|
+
|
263
|
+
remPattern=FXButton.new(lw_sid, " - " , :opts => BUTTON_NORMAL|LAYOUT_LEFT)
|
264
|
+
remPattern.connect(SEL_COMMAND, method(:remPattern))
|
265
|
+
|
266
|
+
@pattern_list = FXList.new(sid_frame, :opts => LIST_EXTENDEDSELECT|LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
267
|
+
@pattern_list.numVisible = 8
|
268
|
+
|
269
|
+
@pattern_list.connect(SEL_COMMAND,method(:onPatternClick))
|
270
|
+
|
271
|
+
updatePatternList
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
#=============================================================================================
|
276
|
+
# request-list
|
277
|
+
|
278
|
+
lw_req_list = FXVerticalFrame.new(lw_left, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_GROOVE)
|
279
|
+
lw_request_list_header = FXHorizontalFrame.new(lw_req_list, :opts => LAYOUT_FILL_X)
|
280
|
+
FXLabel.new(lw_request_list_header, "Login-Requests:" )
|
281
|
+
|
282
|
+
@request_list = FXList.new(lw_req_list, :opts => LIST_EXTENDEDSELECT|LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
283
|
+
@request_list.connect(SEL_COMMAND,method(:onRequestClick))
|
284
|
+
|
285
|
+
remRequest=FXButton.new(lw_request_list_header, " - " , :opts => BUTTON_NORMAL|LAYOUT_RIGHT)
|
286
|
+
remRequest.connect(SEL_COMMAND, method(:remRequest))
|
287
|
+
#=============================================================================================
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
#=============================================================================================
|
292
|
+
# lw_bottom
|
293
|
+
|
294
|
+
FXButton.new(lw_bottom, "OK" ,
|
295
|
+
:target => self, :selector => FXDialogBox::ID_ACCEPT,
|
296
|
+
:opts => BUTTON_NORMAL|LAYOUT_RIGHT)
|
297
|
+
FXButton.new(lw_bottom, "Cancel" ,
|
298
|
+
:target => self, :selector => FXDialogBox::ID_CANCEL,
|
299
|
+
:opts => BUTTON_NORMAL|LAYOUT_RIGHT)
|
300
|
+
end
|
301
|
+
end
|