watobo 0.9.9.pre3 → 0.9.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. data/.yardopts +24 -0
  2. data/CHANGELOG +17 -7
  3. data/README +4 -60
  4. data/bin/nfq_server.rb +191 -0
  5. data/config/interceptor.yml +2 -6
  6. data/lib/watobo/adapters/data_store.rb +1 -1
  7. data/lib/watobo/adapters/file/file_store.rb +50 -33
  8. data/lib/watobo/ca.rb +22 -0
  9. data/lib/watobo/config.rb +6 -0
  10. data/lib/watobo/core/ca.rb +411 -0
  11. data/lib/watobo/core/cert_store.rb +56 -0
  12. data/lib/watobo/core/forwarding_proxy.rb +38 -0
  13. data/lib/watobo/core/http_socket.rb +18 -0
  14. data/lib/watobo/core/intercept_carver.rb +179 -0
  15. data/lib/watobo/core/intercept_filter.rb +257 -0
  16. data/lib/watobo/core/interceptor.rb +342 -79
  17. data/lib/watobo/core/netfilter_queue.rb +191 -0
  18. data/lib/watobo/core/project.rb +84 -138
  19. data/lib/watobo/core/proxy.rb +61 -0
  20. data/lib/watobo/core/request.rb +40 -0
  21. data/lib/watobo/core/response.rb +30 -0
  22. data/lib/watobo/core/scanner.rb +64 -58
  23. data/lib/watobo/core/session.rb +70 -77
  24. data/lib/watobo/core.rb +1 -1
  25. data/lib/watobo/framework/create_project.rb +25 -10
  26. data/lib/watobo/framework/init.rb +13 -0
  27. data/lib/watobo/gui/browser_preview.rb +5 -4
  28. data/lib/watobo/gui/checks_policy_frame.rb +1 -0
  29. data/lib/watobo/gui/client_cert_dialog.rb +11 -6
  30. data/lib/watobo/gui/conversation_table.rb +7 -4
  31. data/lib/watobo/gui/fuzzer_gui.rb +9 -11
  32. data/lib/watobo/gui/intercept_filter_dialog.rb +210 -0
  33. data/lib/watobo/gui/interceptor_gui.rb +59 -21
  34. data/lib/watobo/gui/interceptor_settings_dialog.rb +39 -5
  35. data/lib/watobo/gui/list_box.rb +2 -1
  36. data/lib/watobo/gui/log_viewer.rb +79 -5
  37. data/lib/watobo/gui/main_window.rb +159 -113
  38. data/lib/watobo/gui/manual_request_editor.rb +11 -5
  39. data/lib/watobo/gui/mixins/subscriber.rb +47 -0
  40. data/lib/watobo/gui/project_wizzard.rb +3 -3
  41. data/lib/watobo/gui/proxy_dialog.rb +17 -18
  42. data/lib/watobo/gui/request_editor.rb +1 -1
  43. data/lib/watobo/gui/rewrite_filters_dialog.rb +416 -0
  44. data/lib/watobo/gui/rewrite_rules_dialog.rb +394 -0
  45. data/lib/watobo/gui/scanner_settings_dialog.rb +9 -6
  46. data/lib/watobo/gui/session_management_dialog.rb +33 -23
  47. data/lib/watobo/gui/sites_tree.rb +5 -6
  48. data/lib/watobo/gui/status_bar.rb +101 -49
  49. data/lib/watobo/gui/table_editor.rb +1 -1
  50. data/lib/watobo/gui/templates/plugin2.rb +23 -27
  51. data/lib/watobo/gui/utils/save_default_settings.rb +9 -9
  52. data/lib/watobo/gui/utils/save_proxy_settings.rb +25 -9
  53. data/lib/watobo/gui/utils/save_scanner_settings.rb +10 -7
  54. data/lib/watobo/gui/utils/session_history.rb +1 -1
  55. data/lib/watobo/gui/www_auth_dialog.rb +25 -21
  56. data/lib/watobo/gui.rb +3 -1
  57. data/lib/watobo/mixins/httpparser.rb +47 -40
  58. data/lib/watobo/mixins/request_parser.rb +126 -41
  59. data/lib/watobo/mixins/shapers.rb +124 -15
  60. data/lib/watobo/utils/hexprint.rb +31 -0
  61. data/lib/watobo/utils/load_chat.rb +2 -0
  62. data/lib/watobo/utils/response_builder.rb +111 -0
  63. data/lib/watobo.rb +4 -1
  64. data/modules/active/discovery/http_methods.rb +6 -4
  65. data/modules/active/fileinclusion/lfi_simple.rb +3 -3
  66. data/modules/active/sqlinjection/sqli_timing.rb +6 -6
  67. data/modules/passive/redirectionz.rb +5 -6
  68. data/plugins/catalog/catalog.rb +240 -56
  69. data/plugins/catalog/db_tests +1 -6483
  70. data/plugins/catalog/db_variables +2 -29
  71. data/plugins/crawler/gui/auth_frame.rb +15 -3
  72. data/plugins/crawler/gui/crawler_gui.rb +24 -0
  73. data/plugins/crawler/gui/hooks_frame.rb +7 -2
  74. data/plugins/crawler/gui/settings_tabbook.rb +4 -0
  75. data/plugins/crawler/gui.rb +3 -3
  76. data/plugins/crawler/lib/engine.rb +1 -1
  77. data/plugins/filefinder/filefinder.rb +21 -17
  78. data/plugins/sqlmap/bin/test.rb +100 -0
  79. data/plugins/sqlmap/gui/main.rb +227 -0
  80. data/plugins/sqlmap/gui/options_frame.rb +119 -0
  81. data/plugins/sqlmap/gui.rb +27 -0
  82. data/plugins/sqlmap/icons/sqlmap.ico +0 -0
  83. data/plugins/sqlmap/lib/sqlmap_ctrl.rb +116 -0
  84. data/plugins/sqlmap/sqlmap.rb +26 -0
  85. data/plugins/sslchecker/gui/gui.rb +45 -30
  86. metadata +32 -9
  87. data/certificates/cert.pem +0 -19
  88. data/certificates/privkey.pem +0 -15
  89. data/certificates/watobo_dh.key +0 -5
  90. data/lib/watobo/core/simple_ca.rb +0 -393
data/.yardopts ADDED
@@ -0,0 +1,24 @@
1
+ # .
2
+ # .yardopts
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
+ --no-private
23
+ *.xxx
24
+ - CHANGELOG
data/CHANGELOG CHANGED
@@ -1,19 +1,29 @@
1
1
  = Version 0.9.9
2
2
  == NEW
3
- * Time-based SQL injection module
4
- * new XSS module which gives a more accurate exploitability result
5
- * ConversationTable: values in coloumn Parameters are url-decoded
6
- * Added a WebCrawler Plugin based on Mechanize
7
- * Manual Request Editor: Url is displayed in the window title
8
- * Menubar items are disabled if no project is defined
3
+ * [Module] Time-based SQL injection module
4
+ * [Module] Rated XSS which gives a more accurate exploitability result
5
+ * [GUI] ConversationTable: values in coloumn Parameters are url-decoded
6
+ * [Plugin] WebCrawler - based on Mechanize
7
+ * [GUI] Manual Request Editor: Url is displayed in the window title
8
+ * [GUI] Menubar items are disabled if no project is defined
9
+ * [CORE] Create SSL certificates for each target on-the-fly, now you only have to trust the internal CA once
10
+ * [Interceptor] Rewrite/Inject Feature to Interceptor
11
+ * [CORE] added .yml file extension for chats, findings, logs, ...
12
+ * [Plugin] SQLmap - easy to use sqlmap interface
13
+ * [Interceptor] Transparent Proxy Feature - only available on Linux (depends on netfilter_queue)
14
+ * [CatalogScanner] added predefined database paths
15
+ * [CORE] general unzipping and unchunking of server responses
9
16
 
10
17
  == Fixes
11
18
  * CA Directory is now created in WATOBO working directory '.watobo'
12
19
  * Fixed Crash on opening client-certificate dialog
20
+ * Improved Socket communication
13
21
  * ConversationTable: GET and POST parameters are shown in the parameters coloumn
14
22
  * TreeView-Pane: Show full conversation list when Findings tab is selected
15
23
  * Fixed a bug in parsing post parameters
16
- * Also some minor bugs
24
+ * QuickScan: double scanning each module
25
+ * the disclaimer.chk file now is written to .watobo
26
+ * some minor bugs
17
27
 
18
28
 
19
29
  = Version 0.9.8
data/README CHANGED
@@ -3,7 +3,9 @@
3
3
  WATOBO is a security tool for web applications. WATOBO is intended to enable security professionals to perform efficient (semi-automated) web application security audits.
4
4
 
5
5
  Most important features:
6
- * WATOBO has Session Management capabilities! You can define login scripts as well as logout signatures. So you don’t have to login manually each time you get logged out.
6
+ * WATOBO has Session Management capabilities! You can define login scripts as well as logout signatures. So you don’t have to login manually each time you get logged out.
7
+ * WATOB can act as an transparent proxy
8
+ * WATOBO has anti-CSRF features
7
9
  * WATOBO can perform vulnerability checks out of the box.
8
10
  * WATOBO supports Inline De-/Encoding, so you don’t have to copy strings to a transcoder and back again. Just do it inside the request/response window with a simple mouse click.
9
11
  * WATOBO has smart filter functions, so you can find and navigate to the most interesting parts of the application easily.
@@ -11,66 +13,8 @@ Most important features:
11
13
  * WATOBO is free software ( licensed under the GNU General Public License Version 2)
12
14
  * It’s by siberas ;)
13
15
 
14
- == Installation
15
- Please install Ruby 1.9.2+ first before you continue.
16
-
17
- Note: Ruby 1.8 is no longer supported!
18
-
19
- Note: WATOBO will not run under Ruby 1.8 anymore!
20
-
21
- Note: Please upgrade Ruby to 1.9.2+, because WATOBO will not run under Ruby 1.8!
22
-
23
- Note: Ruby 1.8 is crap, so get rid of it!
24
-
25
- ... just want to be sure ;)
26
-
27
- === Windows 7/Vista/XP
28
- gem install watobo
29
-
30
- === BackTrack 5
31
- gem install --user-install selenium-webdriver
32
- gem install --user-install watobo
33
-
34
- Add the following line to your ~/.bashrc file:
35
- export PATH=$PATH:/root/.gem/ruby/1.9.2/bin/
36
-
37
- === Generic Linux (with APT)
38
- * Install Ruby via RVM
39
- * Setting up a build environment for linux
40
- Based on Lyle Johnsons tutorial https://github.com/lylejohnson/fxruby/wiki/Setting-Up-a-Linux-Build-Environment
41
- apt-get -y install ruby-full
42
- apt-get -y install install zlib1g-dev libbz2-dev libpng12-dev libjpeg62-dev libtiff4-dev
43
- apt-get -y install zlib1g-dev libbz2-dev libpng12-dev libjpeg62-dev libtiff4-dev
44
- apt-get -y install libx11-dev libglu1-xorg-dev libxcursor-dev libxext-dev libxrandr-dev libxft2-dev
45
- apt-get -y install g++
46
-
47
- * Install the Fox-Toolkit libs
48
- Use version 1.6.44 only. The 1.7 branch is incompatible with fxruby!
49
- You can download it from the fox-tookit homepage http://www.fox-toolkit.org/
50
- wget http://ftp.fox-toolkit.org/pub/fox-1.6.44.tar.gz
51
- tar xzvf fox-1.6.44.tar.gz
52
- cd fox-1.6.44
53
- ./configure
54
- make
55
- make install
56
- cd ..
57
-
58
- * Install the Gems
59
- First install the selenium-webdriver gem which is necessary on xnix platforms for the browser preview feature of watobo.
60
- gem install selenium-webdriver
61
- Finally install the watobo gem.
62
- gem install watobo
63
-
64
- == Usage
65
- In your command prompt start WATOBO with the command:
66
- watobo_gui.rb
67
-
68
- After starting WATOBO the interception proxy is listening on localhost:8081.
69
-
70
- Configure your browser to use WATOBO as its proxy and visit the site you want to audit.
71
-
72
16
  == Documentation
73
- Check the online (video) tutorials at http://watobo.sourceforge.net
17
+ Check out the online documentation and video tutorials at http://watobo.sourceforge.net
74
18
 
75
19
  == Tips & Tricks
76
20
  * On Linux you should use RVM to install Ruby (http://beginrescueend.com/rvm/install/)
data/bin/nfq_server.rb ADDED
@@ -0,0 +1,191 @@
1
+ #!/usr/bin/ruby
2
+ # .
3
+ # nfq_server.rb
4
+ #
5
+ # Copyright 2012 by siberas, http://www.siberas.de
6
+ #
7
+ # This file is part of WATOBO (Web Application Tool Box)
8
+ # http://watobo.sourceforge.com
9
+ #
10
+ # WATOBO is free software; you can redistribute it and/or modify
11
+ # it under the terms of the GNU General Public License as published by
12
+ # the Free Software Foundation version 2 of the License.
13
+ #
14
+ # WATOBO is distributed in the hope that it will be useful,
15
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ # GNU General Public License for more details.
18
+ #
19
+ # You should have received a copy of the GNU General Public License
20
+ # along with WATOBO; if not, write to the Free Software
21
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
+ # .
23
+ require 'drb'
24
+ require 'yaml'
25
+ require 'openssl'
26
+
27
+ begin
28
+ require "nfqueue"
29
+ @nfq_present = true
30
+ rescue LoadError
31
+ puts "NFQUEUE not available on this system"
32
+ exit
33
+ end
34
+
35
+ module Watobo
36
+ module NFQ
37
+ class Connections
38
+ attr :nfqueue
39
+ def add_ssl_request(c_host, c_port, s_host, s_port)
40
+ ck = "#{c_host}:#{c_port}"
41
+ sk = "#{s_host}:#{s_port}"
42
+
43
+ begin
44
+
45
+ unless @cert_list.has_key? sk
46
+ if cert = acquire_cert(s_host,s_port)
47
+ @connections[ck] = sk
48
+ @cert_list[sk] = cert
49
+ else
50
+ return false
51
+ end
52
+ else
53
+ @connections[ck] = sk
54
+ end
55
+
56
+ return true
57
+ rescue => bang
58
+ puts bang
59
+ puts bang.backtrace
60
+ end
61
+ return false
62
+
63
+ end
64
+
65
+ def to_yaml
66
+ @connections.to_yaml
67
+ end
68
+
69
+ def info(data)
70
+ begin
71
+ ck = "#{data['host']}:#{data['port']}"
72
+ target_site = ''
73
+ cert_cn = ''
74
+ @netqueue_lock.synchronize do
75
+ if @connections.has_key? ck
76
+ target_site = @connections[ck]
77
+ if @cert_list.has_key? target_site
78
+ cert = @cert_list[target_site]
79
+ cert_cn = cert.subject.to_s.gsub(/.*=/,"")
80
+ end
81
+ end
82
+ end
83
+ r = { 'target' => target_site, 'cn' => cert_cn}
84
+ return r
85
+ rescue => bang
86
+ puts bang
87
+ puts bang.backtrace
88
+ end
89
+ return {}
90
+ end
91
+
92
+ def initialize
93
+ @connections = Hash.new
94
+ @cert_list = Hash.new
95
+ @netqueue_lock = Mutex.new
96
+ @dh_key = OpenSSL::PKey::DH.new(512)
97
+ @nfqueue = start
98
+ end
99
+
100
+ def acquire_cert(host, port)
101
+
102
+ begin
103
+ tcp_socket = TCPSocket.new( host, port )
104
+ tcp_socket.setsockopt( Socket::SOL_SOCKET, Socket::SO_KEEPALIVE, 1)
105
+ tcp_socket.sync = true
106
+ ctx = OpenSSL::SSL::SSLContext.new()
107
+
108
+ ctx.tmp_dh_callback = proc { |*args|
109
+ @dh_key
110
+ }
111
+
112
+ socket = OpenSSL::SSL::SSLSocket.new(tcp_socket, ctx)
113
+
114
+ socket.connect
115
+ #socket.setsockopt( Socket::SOL_SOCKET, Socket::SO_KEEPALIVE, 1)
116
+ sk = "#{host}:#{port}"
117
+ cert = socket.peer_cert
118
+ @netqueue_lock.synchronize do
119
+ @cert_list[sk] = cert
120
+ end
121
+ # puts cert.subject.methods.sort
122
+ return cert
123
+
124
+ rescue => bang
125
+ puts bang
126
+ puts bang.backtrace if $DEBUG
127
+ end
128
+ return nil
129
+ end
130
+
131
+ def start
132
+
133
+ puts "starting netfilter_queue ..."
134
+ t = Thread.new{
135
+ begin
136
+ Netfilter::Queue.create(0) do |p|
137
+ # puts ">> Netfilter Packet #" + p.id.to_s
138
+ # $stdout.flush
139
+ # puts p.data.class
140
+ raw_src = p.data[12..15]
141
+ raw_dst = p.data[16..19]
142
+ src_port = p.data[20..21].unpack("H4")[0].hex
143
+ dst_port = p.data[22..24].unpack("H4")[0].hex
144
+ # if p.data.length > 47
145
+ # flags = p.data[47].unpack("H*")[0].hex
146
+ # puts flags.to_s
147
+ # if flags == 2
148
+ # puts "ADD SSL REQUEST"
149
+ puts "NFQ >> #{get_ip_string(raw_src)}:#{src_port} -> #{get_ip_string(raw_dst)}:#{dst_port}"
150
+ add_ssl_request(get_ip_string(raw_src), src_port, get_ip_string(raw_dst), dst_port)
151
+
152
+ Netfilter::Packet::ACCEPT
153
+ end
154
+ rescue => bang
155
+ puts bang
156
+ puts bang.backtrace
157
+ # retry
158
+ rescue Netfilter::QueueError
159
+ puts "NetfilterERROR"
160
+ exit
161
+ end
162
+ }
163
+
164
+ t
165
+ end
166
+
167
+ private
168
+
169
+ def get_ip_string(raw_addr)
170
+ begin
171
+ ip = ""
172
+ raw_addr.length.times do |i|
173
+ ip << "." unless ip.empty?
174
+ ip << raw_addr[i].ord.to_s
175
+ end
176
+ rescue => bang
177
+ puts bang
178
+ puts bang.backtrace
179
+ end
180
+ ip
181
+ end
182
+
183
+ end
184
+
185
+ end
186
+ end
187
+
188
+ DRb.start_service "druby://127.0.0.1:666", Watobo::NFQ::Connections.new
189
+ #puts DRb.uri
190
+ DRb.thread.join
191
+
@@ -1,6 +1,3 @@
1
- :cert_file: cert.pem
2
- :key_file: privkey.pem
3
- :dh_key_file: watobo_dh.key
4
1
  :pass_through:
5
2
  :content_types:
6
3
  - application\/audio
@@ -10,7 +7,6 @@
10
7
  - application\/.*flash
11
8
  - image\/
12
9
  :content_length: 100000
13
- :certificate_path: certificates
14
10
  :port: 8081
15
- :server: "127.0.0.1"
16
-
11
+ :proxy_mode: 1
12
+ :bind_addr: "127.0.0.1"
@@ -22,7 +22,7 @@
22
22
  module Watobo
23
23
  class DataStore
24
24
 
25
- def self.aquire(project_name, session_name)
25
+ def self.acquire(project_name, session_name)
26
26
  a = Watobo::Conf::Datastore.adapter
27
27
  store = case
28
28
  when 'file'
@@ -22,15 +22,18 @@
22
22
  module Watobo
23
23
  class FileSessionStore < SessionStore
24
24
  def num_chats
25
- get_file_list(@conversation_path, "*-chat").length
25
+ get_file_list(@conversation_path, "*-chat*").length
26
26
  end
27
27
 
28
28
  def num_findings
29
- get_file_list(@findings_path, "*-finding").length
29
+ get_file_list(@findings_path, "*-finding*").length
30
30
  end
31
31
 
32
32
  def add_finding(finding)
33
- finding_file = File.join("#{@findings_path}", "#{finding.id}-finding")
33
+ return false unless finding.respond_to? :request
34
+ return false unless finding.respond_to? :response
35
+
36
+ finding_file = File.join("#{@findings_path}", "#{finding.id}-finding.yml")
34
37
  if not File.exists?(finding_file) then
35
38
 
36
39
  finding_data = {
@@ -40,23 +43,24 @@ module Watobo
40
43
  }
41
44
  finding_data[:details].update(finding.details)
42
45
 
43
- if not File.exists?(finding_file) then
44
- fh = File.new(finding_file, "w+b")
45
- fh.print YAML.dump(finding_data)
46
- fh.close
47
- end
46
+ fh = File.new(finding_file, "w+b")
47
+ fh.print YAML.dump(finding_data)
48
+ fh.close
49
+ return true
48
50
  end
49
-
51
+ return false
50
52
  end
51
53
 
52
54
  def delete_finding(finding)
53
55
  finding_file = File.join("#{@findings_path}", "#{finding.id}-finding")
54
56
  File.delete finding_file if File.exist? finding_file
57
+ finding_file << ".yml"
58
+ File.delete finding_file if File.exist? finding_file
55
59
 
56
60
  end
57
61
 
58
62
  def update_finding(finding)
59
- finding_file = File.join("#{@findings_path}", "#{finding.id}-finding")
63
+ finding_file = File.join("#{@findings_path}", "#{finding.id}-finding.yml")
60
64
  finding_data = {
61
65
  :request => finding.request.map{|x| x.inspect},
62
66
  :response => finding.response.map{|x| x.inspect},
@@ -77,20 +81,22 @@ module Watobo
77
81
  # needs a scan_name (STRING) as its destination which will be created
78
82
  # if the scan name does not exist.
79
83
  def add_scan_log(chat, scan_name = nil)
84
+ return false unless chat.respond_to? :request
85
+ return false unless chat.respond_to? :response
80
86
  begin
81
87
  return false if scan_name.nil?
82
- # puts ">> scan_name"
88
+ # puts ">> scan_name"
83
89
  path = File.join(@scanlog_path, scan_name)
84
90
 
85
91
  Dir.mkdir path unless File.exist? path
86
92
 
87
- log_file = File.join( path, "log_" + Time.now.to_f.to_s)
93
+ log_file = File.join( path, "log_" + Time.now.to_f.to_s + ".yml")
88
94
 
89
95
  chat_data = {
90
96
  :request => chat.request.map{|x| x.inspect},
91
97
  :response => chat.response.map{|x| x.inspect},
92
98
  }
93
- # puts log_file
99
+ # puts log_file
94
100
  chat_data.update(chat.settings)
95
101
  File.open(log_file, "w") { |fh|
96
102
  YAML.dump(chat_data, fh)
@@ -104,7 +110,8 @@ module Watobo
104
110
  end
105
111
 
106
112
  def add_chat(chat)
107
- chat_file = File.join("#{@conversation_path}", "#{chat.id}-chat")
113
+ return false unless chat_valid? chat
114
+ chat_file = File.join("#{@conversation_path}", "#{chat.id}-chat.yml")
108
115
  chat_data = {
109
116
  :request => chat.request.map{|x| x.inspect},
110
117
  :response => chat.response.map{|x| x.inspect},
@@ -116,11 +123,13 @@ module Watobo
116
123
  YAML.dump(chat_data, fh)
117
124
  }
118
125
  chat.file = chat_file
126
+ return true
119
127
  end
128
+ return false
120
129
  end
121
130
 
122
131
  def each_chat(&block)
123
- get_file_list(@conversation_path, "*-chat").each do |fname|
132
+ get_file_list(@conversation_path, "*-chat*").each do |fname|
124
133
  chat = Watobo::Utils.loadChatYAML(fname)
125
134
  next unless chat
126
135
  yield chat if block_given?
@@ -128,7 +137,7 @@ module Watobo
128
137
  end
129
138
 
130
139
  def each_finding(&block)
131
- get_file_list(@findings_path, "*-finding").each do |fname|
140
+ get_file_list(@findings_path, "*-finding*").each do |fname|
132
141
  f = Watobo::Utils.loadFindingYAML(fname)
133
142
  next unless f
134
143
  yield f if block_given?
@@ -146,7 +155,7 @@ module Watobo
146
155
  Dir.mkdir(@project_path)
147
156
  end
148
157
 
149
- @project_config_path = File.join(@project_path, "config")
158
+ @project_config_path = File.join(@project_path, ".config")
150
159
  Dir.mkdir @project_config_path unless File.exist? @project_config_path
151
160
 
152
161
  @session_path = File.join(@project_path, session_name)
@@ -156,7 +165,7 @@ module Watobo
156
165
  Dir.mkdir(@session_path)
157
166
  end
158
167
 
159
- @session_config_path = File.join(@session_path, "config")
168
+ @session_config_path = File.join(@session_path, ".config")
160
169
  Dir.mkdir @session_config_path unless File.exist? @session_config_path
161
170
 
162
171
  sext = Watobo::Conf::General.session_settings_file_ext
@@ -190,51 +199,51 @@ module Watobo
190
199
  end
191
200
 
192
201
  def save_session_settings(group, session_settings)
193
- # puts ">> save_session_settings <<"
202
+ # puts ">> save_session_settings <<"
194
203
  file = Watobo::Utils.snakecase group.gsub(/\.yml/,'')
195
204
  file << ".yml"
196
205
 
197
206
  session_file = File.join(@session_config_path, file)
198
- # puts "Dest.File: #{session_file}"
199
- # puts session_settings.to_yaml
200
- # puts "---"
207
+ # puts "Dest.File: #{session_file}"
208
+ # puts session_settings.to_yaml
209
+ # puts "---"
201
210
  Watobo::Utils.save_settings(session_file, session_settings)
202
211
  end
203
212
 
204
213
  def load_session_settings(group)
205
- # puts ">> load_session_settings : #{group}"
214
+ # puts ">> load_session_settings : #{group}"
206
215
  file = Watobo::Utils.snakecase group.gsub(/\.yml/,'')
207
216
  file << ".yml"
208
217
 
209
218
  session_file = File.join(@session_config_path, file)
210
- # puts "File: #{session_file}"
211
- # puts "---"
219
+ # puts "File: #{session_file}"
220
+ # puts "---"
212
221
 
213
222
  s = Watobo::Utils.load_settings(session_file)
214
223
  s
215
224
  end
216
225
 
217
226
  def save_project_settings(group, project_settings)
218
- # puts ">> save_project_settings : #{group}"
227
+ # puts ">> save_project_settings : #{group}"
219
228
  file = Watobo::Utils.snakecase group.gsub(/\.yml/,'')
220
229
  file << ".yml"
221
230
 
222
231
  project_file = File.join(@project_config_path, file)
223
- # puts "Dest.File: #{project_file}"
224
- # puts project_settings.to_yaml
225
- # puts "---"
232
+ # puts "Dest.File: #{project_file}"
233
+ # puts project_settings.to_yaml
234
+ # puts "---"
226
235
  Watobo::Utils.save_settings(project_file, project_settings)
227
236
 
228
237
  end
229
238
 
230
239
  def load_project_settings(group)
231
- # puts ">> load_project_settings : #{group}"
240
+ # puts ">> load_project_settings : #{group}"
232
241
  file = Watobo::Utils.snakecase group.gsub(/\.yml/,'')
233
242
  file << ".yml"
234
243
 
235
244
  project_file = File.join(@project_config_path, file)
236
- # puts "File: #{project_file}"
237
- # puts "---"
245
+ # puts "File: #{project_file}"
246
+ # puts "---"
238
247
 
239
248
  s = Watobo::Utils.load_settings(project_file)
240
249
  s
@@ -243,8 +252,16 @@ module Watobo
243
252
 
244
253
  private
245
254
 
255
+ def chat_valid?(chat)
256
+ return false unless chat.respond_to? :request
257
+ return false unless chat.respond_to? :response
258
+ true
259
+ end
260
+
246
261
  def get_file_list(path, pattern)
247
- Dir["#{path}/#{pattern}"].sort_by{ |x| File.basename(x).sub(/[^0-9]*/,'').to_i }
262
+ fl = Dir["#{path}/#{pattern}"].sort_by{ |x| File.basename(x).sub(/[^0-9]*/,'').to_i }
263
+ #puts fl.length
264
+ fl
248
265
  end
249
266
 
250
267
  end
data/lib/watobo/ca.rb ADDED
@@ -0,0 +1,22 @@
1
+ # .
2
+ # ca.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/core/ca.rb'
data/lib/watobo/config.rb CHANGED
@@ -91,6 +91,8 @@ module Watobo
91
91
  def self.save_project(data_store, *filter, &b)
92
92
  raise ArgumentError, "Need a valid Watobo::DataStore" unless data_store.respond_to? :save_project_settings
93
93
  s = filter_settings filter
94
+ # puts @settings.to_yaml
95
+ # puts s.to_yaml
94
96
  data_store.save_project_settings(group_name, s)
95
97
  end
96
98
 
@@ -175,6 +177,10 @@ module Watobo
175
177
  def self.dump
176
178
  @settings
177
179
  end
180
+
181
+ def self.to_h
182
+ @settings
183
+ end
178
184
 
179
185
  #@@settings = settings
180
186
  def self.method_missing(name, *args, &block)