yawast 0.5.0.beta1 → 0.5.0.beta2
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.
- checksums.yaml +4 -4
- data/.travis.yml +3 -1
- data/CHANGELOG.md +8 -0
- data/LICENSE +29 -0
- data/README.md +142 -144
- data/Rakefile +3 -6
- data/bin/yawast +1 -0
- data/lib/resources/common_dir.txt +21332 -0
- data/lib/resources/common_file.txt +13982 -0
- data/lib/scanner/apache.rb +87 -13
- data/lib/scanner/cert.rb +1 -1
- data/lib/scanner/core.rb +4 -3
- data/lib/scanner/generic.rb +35 -3
- data/lib/scanner/iis.rb +7 -10
- data/lib/scanner/plugins/http/directory_search.rb +11 -6
- data/lib/scanner/plugins/http/file_presence.rb +89 -1
- data/lib/scanner/ssl.rb +149 -114
- data/lib/shared/http.rb +7 -3
- data/lib/version.rb +1 -1
- data/lib/yawast.rb +2 -2
- data/test/test_internalssl.rb +31 -0
- data/test/test_object_presence.rb +1 -1
- data/test/test_scan_apache_server_info.rb +1 -1
- metadata +8 -4
- data/lib/resources/common.txt +0 -1960
data/lib/scanner/ssl.rb
CHANGED
@@ -19,75 +19,11 @@ module Yawast
|
|
19
19
|
cert = ssl.peer_cert
|
20
20
|
|
21
21
|
unless cert.nil?
|
22
|
-
|
23
|
-
Yawast::Utilities.puts_info "\t\tIssued To: #{cert.subject.common_name} / #{cert.subject.organization}"
|
24
|
-
Yawast::Utilities.puts_info "\t\tIssuer: #{cert.issuer.common_name} / #{cert.issuer.organization}"
|
25
|
-
Yawast::Utilities.puts_info "\t\tVersion: #{cert.version}"
|
26
|
-
Yawast::Utilities.puts_info "\t\tSerial: #{cert.serial}"
|
27
|
-
Yawast::Utilities.puts_info "\t\tSubject: #{cert.subject}"
|
28
|
-
|
29
|
-
#check to see if cert is expired
|
30
|
-
if cert.not_after > Time.now
|
31
|
-
Yawast::Utilities.puts_info "\t\tExpires: #{cert.not_after}"
|
32
|
-
else
|
33
|
-
Yawast::Utilities.puts_vuln "\t\tExpires: #{cert.not_after} (Expired)"
|
34
|
-
end
|
35
|
-
|
36
|
-
#check for SHA1 & MD5 certs
|
37
|
-
if cert.signature_algorithm.include?('md5') || cert.signature_algorithm.include?('sha1')
|
38
|
-
Yawast::Utilities.puts_vuln "\t\tSignature Algorithm: #{cert.signature_algorithm}"
|
39
|
-
else
|
40
|
-
Yawast::Utilities.puts_info "\t\tSignature Algorithm: #{cert.signature_algorithm}"
|
41
|
-
end
|
42
|
-
|
43
|
-
Yawast::Utilities.puts_info "\t\tKey: #{cert.public_key.class.to_s.gsub('OpenSSL::PKey::', '')}-#{get_x509_pub_key_strength(cert)}"
|
44
|
-
Yawast::Utilities.puts_info "\t\t\tKey Hash: #{Digest::SHA1.hexdigest(cert.public_key.to_s)}"
|
45
|
-
Yawast::Utilities.puts_info "\t\tExtensions:"
|
46
|
-
cert.extensions.each { |ext| Yawast::Utilities.puts_info "\t\t\t#{ext}" unless ext.oid == 'subjectAltName' }
|
47
|
-
|
48
|
-
#alt names
|
49
|
-
alt_names = cert.extensions.find {|e| e.oid == 'subjectAltName'}
|
50
|
-
unless alt_names.nil?
|
51
|
-
Yawast::Utilities.puts_info "\t\tAlternate Names:"
|
52
|
-
alt_names.value.split(',').each { |name| Yawast::Utilities.puts_info "\t\t\t#{name.strip.delete('DNS:')}" }
|
53
|
-
end
|
54
|
-
|
55
|
-
hash = Digest::SHA1.hexdigest(cert.to_der)
|
56
|
-
Yawast::Utilities.puts_info "\t\tHash: #{hash}"
|
57
|
-
puts "\t\t\thttps://censys.io/certificates?q=#{hash}"
|
58
|
-
puts "\t\t\thttps://crt.sh/?q=#{hash}"
|
59
|
-
puts ''
|
22
|
+
get_cert_info cert
|
60
23
|
end
|
61
24
|
|
62
25
|
cert_chain = ssl.peer_cert_chain
|
63
|
-
|
64
|
-
if cert_chain.count == 1
|
65
|
-
#HACK: This is an ugly way to guess if it's a missing intermediate, or self-signed
|
66
|
-
#tIt looks like a change to Ruby's OpenSSL wrapper is needed to actually fix this right.
|
67
|
-
|
68
|
-
if cert.issuer == cert.subject
|
69
|
-
Yawast::Utilities.puts_vuln "\t\tCertificate Is Self-Singed"
|
70
|
-
else
|
71
|
-
Yawast::Utilities.puts_warn "\t\tCertificate Chain Is Incomplete"
|
72
|
-
end
|
73
|
-
|
74
|
-
puts ''
|
75
|
-
end
|
76
|
-
|
77
|
-
unless cert_chain.nil?
|
78
|
-
Yawast::Utilities.puts_info 'Certificate: Chain'
|
79
|
-
cert_chain.each do |c|
|
80
|
-
Yawast::Utilities.puts_info "\t\tIssued To: #{c.subject.common_name} / #{c.subject.organization}"
|
81
|
-
Yawast::Utilities.puts_info "\t\t\tIssuer: #{c.issuer.common_name} / #{c.issuer.organization}"
|
82
|
-
Yawast::Utilities.puts_info "\t\t\tExpires: #{c.not_after}"
|
83
|
-
Yawast::Utilities.puts_info "\t\t\tKey: #{c.public_key.class.to_s.gsub('OpenSSL::PKey::', '')}-#{get_x509_pub_key_strength(c)}"
|
84
|
-
Yawast::Utilities.puts_info "\t\t\tSignature Algorithm: #{c.signature_algorithm}"
|
85
|
-
Yawast::Utilities.puts_info "\t\t\tHash: #{Digest::SHA1.hexdigest(c.to_der)}"
|
86
|
-
puts ''
|
87
|
-
end
|
88
|
-
|
89
|
-
puts ''
|
90
|
-
end
|
26
|
+
get_cert_chain_info cert_chain, cert
|
91
27
|
|
92
28
|
puts "\t\tQualys SSL Labs: https://www.ssllabs.com/ssltest/analyze.html?d=#{uri.host}&hideResults=on"
|
93
29
|
puts ''
|
@@ -104,6 +40,84 @@ module Yawast
|
|
104
40
|
end
|
105
41
|
end
|
106
42
|
|
43
|
+
def self.get_cert_info(cert)
|
44
|
+
Yawast::Utilities.puts_info 'Found X509 Certificate:'
|
45
|
+
Yawast::Utilities.puts_info "\t\tIssued To: #{cert.subject.common_name} / #{cert.subject.organization}"
|
46
|
+
Yawast::Utilities.puts_info "\t\tIssuer: #{cert.issuer.common_name} / #{cert.issuer.organization}"
|
47
|
+
Yawast::Utilities.puts_info "\t\tVersion: #{cert.version}"
|
48
|
+
Yawast::Utilities.puts_info "\t\tSerial: #{cert.serial}"
|
49
|
+
Yawast::Utilities.puts_info "\t\tSubject: #{cert.subject}"
|
50
|
+
|
51
|
+
#check to see if cert is expired
|
52
|
+
if cert.not_after > Time.now
|
53
|
+
Yawast::Utilities.puts_info "\t\tExpires: #{cert.not_after}"
|
54
|
+
else
|
55
|
+
Yawast::Utilities.puts_vuln "\t\tExpires: #{cert.not_after} (Expired)"
|
56
|
+
end
|
57
|
+
|
58
|
+
#check for SHA1 & MD5 certs
|
59
|
+
if cert.signature_algorithm.include?('md5') || cert.signature_algorithm.include?('sha1')
|
60
|
+
Yawast::Utilities.puts_vuln "\t\tSignature Algorithm: #{cert.signature_algorithm}"
|
61
|
+
else
|
62
|
+
Yawast::Utilities.puts_info "\t\tSignature Algorithm: #{cert.signature_algorithm}"
|
63
|
+
end
|
64
|
+
|
65
|
+
Yawast::Utilities.puts_info "\t\tKey: #{cert.public_key.class.to_s.gsub('OpenSSL::PKey::', '')}-#{get_x509_pub_key_strength(cert)}"
|
66
|
+
Yawast::Utilities.puts_info "\t\t\tKey Hash: #{Digest::SHA1.hexdigest(cert.public_key.to_s)}"
|
67
|
+
Yawast::Utilities.puts_info "\t\tExtensions:"
|
68
|
+
cert.extensions.each { |ext| Yawast::Utilities.puts_info "\t\t\t#{ext}" unless ext.oid == 'subjectAltName' || ext.oid == 'ct_precert_scts' }
|
69
|
+
|
70
|
+
#ct_precert_scts
|
71
|
+
scts = cert.extensions.find {|e| e.oid == 'ct_precert_scts'}
|
72
|
+
unless scts.nil?
|
73
|
+
Yawast::Utilities.puts_info "\t\tSCTs:"
|
74
|
+
scts.value.split("\n").each { |line| puts "\t\t\t#{line}" }
|
75
|
+
end
|
76
|
+
|
77
|
+
#alt names
|
78
|
+
alt_names = cert.extensions.find {|e| e.oid == 'subjectAltName'}
|
79
|
+
unless alt_names.nil?
|
80
|
+
Yawast::Utilities.puts_info "\t\tAlternate Names:"
|
81
|
+
alt_names.value.split(',').each { |name| Yawast::Utilities.puts_info "\t\t\t#{name.strip.delete('DNS:')}" }
|
82
|
+
end
|
83
|
+
|
84
|
+
hash = Digest::SHA1.hexdigest(cert.to_der)
|
85
|
+
Yawast::Utilities.puts_info "\t\tHash: #{hash}"
|
86
|
+
puts "\t\t\thttps://censys.io/certificates?q=#{hash}"
|
87
|
+
puts "\t\t\thttps://crt.sh/?q=#{hash}"
|
88
|
+
puts ''
|
89
|
+
end
|
90
|
+
|
91
|
+
def self.get_cert_chain_info(cert_chain, cert)
|
92
|
+
if cert_chain.count == 1
|
93
|
+
#HACK: This is an ugly way to guess if it's a missing intermediate, or self-signed
|
94
|
+
#tIt looks like a change to Ruby's OpenSSL wrapper is needed to actually fix this right.
|
95
|
+
|
96
|
+
if cert.issuer == cert.subject
|
97
|
+
Yawast::Utilities.puts_vuln "\t\tCertificate Is Self-Singed"
|
98
|
+
else
|
99
|
+
Yawast::Utilities.puts_warn "\t\tCertificate Chain Is Incomplete"
|
100
|
+
end
|
101
|
+
|
102
|
+
puts ''
|
103
|
+
end
|
104
|
+
|
105
|
+
unless cert_chain.nil?
|
106
|
+
Yawast::Utilities.puts_info 'Certificate: Chain'
|
107
|
+
cert_chain.each do |c|
|
108
|
+
Yawast::Utilities.puts_info "\t\tIssued To: #{c.subject.common_name} / #{c.subject.organization}"
|
109
|
+
Yawast::Utilities.puts_info "\t\t\tIssuer: #{c.issuer.common_name} / #{c.issuer.organization}"
|
110
|
+
Yawast::Utilities.puts_info "\t\t\tExpires: #{c.not_after}"
|
111
|
+
Yawast::Utilities.puts_info "\t\t\tKey: #{c.public_key.class.to_s.gsub('OpenSSL::PKey::', '')}-#{get_x509_pub_key_strength(c)}"
|
112
|
+
Yawast::Utilities.puts_info "\t\t\tSignature Algorithm: #{c.signature_algorithm}"
|
113
|
+
Yawast::Utilities.puts_info "\t\t\tHash: #{Digest::SHA1.hexdigest(c.to_der)}"
|
114
|
+
puts ''
|
115
|
+
end
|
116
|
+
|
117
|
+
puts ''
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
107
121
|
def self.get_ciphers(uri)
|
108
122
|
puts 'Supported Ciphers (based on your OpenSSL version):'
|
109
123
|
|
@@ -124,14 +138,18 @@ module Yawast
|
|
124
138
|
#try to get the list of ciphers supported for each version
|
125
139
|
ciphers = nil
|
126
140
|
|
141
|
+
get_ciphers_failed = false
|
127
142
|
begin
|
128
143
|
ciphers = OpenSSL::SSL::SSLContext.new(version).ciphers
|
129
144
|
rescue => e
|
130
|
-
Yawast::Utilities.puts_error "\tError getting cipher suites for #{version
|
145
|
+
Yawast::Utilities.puts_error "\tError getting cipher suites for #{version}, skipping. (#{e.message})"
|
146
|
+
get_ciphers_failed = true
|
131
147
|
end
|
132
148
|
|
133
149
|
if ciphers != nil
|
134
150
|
check_version_suites uri, ip, ciphers, version
|
151
|
+
elsif get_ciphers_failed == false
|
152
|
+
Yawast::Utilities.puts_info "\t#{version}: No cipher suites available."
|
135
153
|
end
|
136
154
|
end
|
137
155
|
end
|
@@ -140,7 +158,7 @@ module Yawast
|
|
140
158
|
end
|
141
159
|
|
142
160
|
def self.check_version_suites(uri, ip, ciphers, version)
|
143
|
-
puts "\tChecking for #{version
|
161
|
+
puts "\tChecking for #{version} suites (#{ciphers.count} possible suites)"
|
144
162
|
|
145
163
|
ciphers.each do |cipher|
|
146
164
|
#try to connect and see what happens
|
@@ -153,23 +171,15 @@ module Yawast
|
|
153
171
|
|
154
172
|
ssl.connect
|
155
173
|
|
156
|
-
|
157
|
-
#less than 112 bits or RC4, flag as a vuln
|
158
|
-
Yawast::Utilities.puts_vuln "\t\tVersion: #{ssl.ssl_version.ljust(7)}\tBits: #{cipher[2]}\tCipher: #{cipher[0]}"
|
159
|
-
elsif cipher[2] >= 128
|
160
|
-
#secure, probably safe
|
161
|
-
Yawast::Utilities.puts_info "\t\tVersion: #{ssl.ssl_version.ljust(7)}\tBits: #{cipher[2]}\tCipher: #{cipher[0]}"
|
162
|
-
else
|
163
|
-
#weak, but not "omg!" weak.
|
164
|
-
Yawast::Utilities.puts_warn "\t\tVersion: #{ssl.ssl_version.ljust(7)}\tBits: #{cipher[2]}\tCipher: #{cipher[0]}"
|
165
|
-
end
|
174
|
+
check_cipher_strength cipher, ssl
|
166
175
|
|
167
176
|
ssl.sysclose
|
168
177
|
rescue OpenSSL::SSL::SSLError => e
|
169
178
|
unless e.message.include?('alert handshake failure') ||
|
170
179
|
e.message.include?('no ciphers available') ||
|
171
180
|
e.message.include?('wrong version number') ||
|
172
|
-
e.message.include?('alert protocol version')
|
181
|
+
e.message.include?('alert protocol version') ||
|
182
|
+
e.message.include?('Connection reset by peer')
|
173
183
|
Yawast::Utilities.puts_error "\t\tVersion: #{ssl.ssl_version.ljust(7)}\tBits: #{cipher[2]}\tCipher: #{cipher[0]}\t(Supported But Failed)"
|
174
184
|
end
|
175
185
|
rescue => e
|
@@ -180,6 +190,19 @@ module Yawast
|
|
180
190
|
end
|
181
191
|
end
|
182
192
|
|
193
|
+
def self.check_cipher_strength(cipher, ssl)
|
194
|
+
if cipher[2] < 112 || cipher[0].include?('RC4')
|
195
|
+
#less than 112 bits or RC4, flag as a vuln
|
196
|
+
Yawast::Utilities.puts_vuln "\t\tVersion: #{ssl.ssl_version.ljust(7)}\tBits: #{cipher[2]}\tCipher: #{cipher[0]}"
|
197
|
+
elsif cipher[2] >= 128
|
198
|
+
#secure, probably safe
|
199
|
+
Yawast::Utilities.puts_info "\t\tVersion: #{ssl.ssl_version.ljust(7)}\tBits: #{cipher[2]}\tCipher: #{cipher[0]}"
|
200
|
+
else
|
201
|
+
#weak, but not "omg!" weak.
|
202
|
+
Yawast::Utilities.puts_warn "\t\tVersion: #{ssl.ssl_version.ljust(7)}\tBits: #{cipher[2]}\tCipher: #{cipher[0]}"
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
183
206
|
def self.check_hsts(head)
|
184
207
|
found = ''
|
185
208
|
|
@@ -194,57 +217,69 @@ module Yawast
|
|
194
217
|
else
|
195
218
|
Yawast::Utilities.puts_info "HSTS: Enabled (#{found})"
|
196
219
|
end
|
197
|
-
|
198
|
-
puts ''
|
199
220
|
end
|
200
221
|
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
puts 'TLS Session Request Limit: Checking number of requests accepted using 3DES suites...'
|
222
|
+
def self.check_hsts_preload(uri)
|
223
|
+
begin
|
224
|
+
info = JSON.parse(Net::HTTP.get(URI("https://hstspreload.com/api/v1/status/#{uri.host}")))
|
205
225
|
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
req.use_ssl = uri.scheme == 'https'
|
210
|
-
req.keep_alive_timeout = 600
|
211
|
-
headers = Yawast::Shared::Http.get_headers
|
226
|
+
chrome = info['chrome'] != nil
|
227
|
+
firefox = info['firefox'] != nil
|
228
|
+
tor = info['tor'] != nil
|
212
229
|
|
213
|
-
|
214
|
-
|
230
|
+
Yawast::Utilities.puts_info "HSTS Preload: Chrome - #{chrome}; Firefox - #{firefox}; Tor - #{tor}"
|
231
|
+
rescue => e
|
232
|
+
Yawast::Utilities.puts_error "Error getting HSTS preload information: #{e.message}"
|
233
|
+
end
|
234
|
+
end
|
215
235
|
|
216
|
-
|
217
|
-
|
218
|
-
|
236
|
+
def self.get_tdes_session_msg_count(uri)
|
237
|
+
# this method will send a number of HEAD requests to see
|
238
|
+
# if the connection is eventually killed.
|
239
|
+
puts 'TLS Session Request Limit: Checking number of requests accepted using 3DES suites...'
|
219
240
|
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
241
|
+
count = 0
|
242
|
+
begin
|
243
|
+
req = Yawast::Shared::Http.get_http(uri)
|
244
|
+
req.use_ssl = uri.scheme == 'https'
|
245
|
+
req.keep_alive_timeout = 600
|
246
|
+
headers = Yawast::Shared::Http.get_headers
|
247
|
+
|
248
|
+
#force 3DES - this is to ensure that 3DES specific limits are caught
|
249
|
+
req.ciphers = ['3DES']
|
224
250
|
|
225
|
-
|
251
|
+
req.start do |http|
|
252
|
+
10000.times do |i|
|
253
|
+
http.head(uri.path, headers)
|
226
254
|
|
227
|
-
|
228
|
-
|
229
|
-
|
255
|
+
# hack to detect transparent disconnects
|
256
|
+
if http.instance_variable_get(:@ssl_context).session_cache_stats[:cache_hits] != 0
|
257
|
+
raise 'TLS Reconnected'
|
230
258
|
end
|
231
|
-
end
|
232
|
-
rescue => e
|
233
|
-
puts
|
234
259
|
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
260
|
+
count += 1
|
261
|
+
|
262
|
+
if i % 20 == 0
|
263
|
+
print '.'
|
264
|
+
end
|
239
265
|
end
|
266
|
+
end
|
267
|
+
rescue => e
|
268
|
+
puts
|
240
269
|
|
241
|
-
|
270
|
+
if e.message.include? 'alert handshake failure'
|
271
|
+
Yawast::Utilities.puts_info 'TLS Session Request Limit: Server does not support 3DES cipher suites'
|
272
|
+
else
|
273
|
+
Yawast::Utilities.puts_info "TLS Session Request Limit: Connection terminated after #{count} requests (#{e.message})"
|
242
274
|
end
|
243
275
|
|
244
|
-
|
245
|
-
Yawast::Utilities.puts_vuln 'TLS Session Request Limit: Connection not terminated after 10,000 requests; possibly vulnerable to SWEET32'
|
276
|
+
return
|
246
277
|
end
|
247
278
|
|
279
|
+
puts
|
280
|
+
Yawast::Utilities.puts_vuln 'TLS Session Request Limit: Connection not terminated after 10,000 requests; possibly vulnerable to SWEET32'
|
281
|
+
end
|
282
|
+
|
248
283
|
#private methods
|
249
284
|
class << self
|
250
285
|
private
|
data/lib/shared/http.rb
CHANGED
@@ -21,13 +21,13 @@ module Yawast
|
|
21
21
|
req.head(uri.path, get_headers)
|
22
22
|
end
|
23
23
|
|
24
|
-
def self.get(uri)
|
24
|
+
def self.get(uri, headers = nil)
|
25
25
|
body = ''
|
26
26
|
|
27
27
|
begin
|
28
28
|
req = get_http(uri)
|
29
29
|
req.use_ssl = uri.scheme == 'https'
|
30
|
-
res = req.request_get(uri.path, get_headers)
|
30
|
+
res = req.request_get(uri.path, get_headers(headers))
|
31
31
|
body = res.read_body
|
32
32
|
rescue
|
33
33
|
#do nothing for now
|
@@ -54,13 +54,17 @@ module Yawast
|
|
54
54
|
end
|
55
55
|
|
56
56
|
# noinspection RubyStringKeysInHashInspection
|
57
|
-
def self.get_headers
|
57
|
+
def self.get_headers(extra_headers = nil)
|
58
58
|
if @cookie == nil
|
59
59
|
headers = { 'User-Agent' => HTTP_UA }
|
60
60
|
else
|
61
61
|
headers = { 'User-Agent' => HTTP_UA, 'Cookie' => @cookie }
|
62
62
|
end
|
63
63
|
|
64
|
+
if extra_headers != nil
|
65
|
+
headers.merge! extra_headers
|
66
|
+
end
|
67
|
+
|
64
68
|
headers
|
65
69
|
end
|
66
70
|
end
|
data/lib/version.rb
CHANGED
data/lib/yawast.rb
CHANGED
@@ -24,7 +24,7 @@ require_all '/shared'
|
|
24
24
|
|
25
25
|
module Yawast
|
26
26
|
DESCRIPTION = 'The YAWAST Antecedent Web Application Security Toolkit'
|
27
|
-
HTTP_UA = "Mozilla/5.0 (Macintosh; Intel Mac OS X
|
27
|
+
HTTP_UA = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Yawast/#{VERSION} Chrome/56.0.2924.28 Safari/537.36"
|
28
28
|
|
29
29
|
def self.header
|
30
30
|
puts '__ _____ _ _ ___ _____ _____ '
|
@@ -35,7 +35,7 @@ module Yawast
|
|
35
35
|
puts ' \_/\_| |_/\/ \/\_| |_/\____/ \_/ '
|
36
36
|
puts ''
|
37
37
|
puts "YAWAST v#{VERSION} - #{DESCRIPTION}"
|
38
|
-
puts ' Copyright (c) 2013-
|
38
|
+
puts ' Copyright (c) 2013-2017 Adam Caudill <adam@adamcaudill.com>'
|
39
39
|
puts ' Support & Documentation: https://github.com/adamcaudill/yawast'
|
40
40
|
puts " Ruby #{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}; #{OpenSSL::OPENSSL_VERSION} (#{RUBY_PLATFORM})"
|
41
41
|
puts ''
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../lib/yawast'
|
2
|
+
require File.dirname(__FILE__) + '/base'
|
3
|
+
|
4
|
+
class TestInternalSSL < Minitest::Test
|
5
|
+
include TestBase
|
6
|
+
|
7
|
+
def test_internalssl_ss_cert
|
8
|
+
override_stdout
|
9
|
+
|
10
|
+
uri = URI.parse 'https://self-signed.badssl.com/'
|
11
|
+
Yawast::Scanner::Ssl.info uri, false, false
|
12
|
+
|
13
|
+
assert stdout_value.include?('Certificate Is Self-Singed'), 'self-signed certificate warning not found'
|
14
|
+
|
15
|
+
restore_stdout
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_internalssl_known_suite
|
19
|
+
override_stdout
|
20
|
+
|
21
|
+
uri = URI.parse 'https://self-signed.badssl.com/'
|
22
|
+
Yawast::Scanner::Ssl.info uri, true, false
|
23
|
+
|
24
|
+
#HACK: This is an awful test, as it depends on the configuration of the server above, so could
|
25
|
+
# easily break if they make any changes, and only tests for a single value, but it's better than nothing.
|
26
|
+
# The other awful thing is that this is slow, and may take 60 seconds or more to complete.
|
27
|
+
assert stdout_value.include?('Cipher: AES256-SHA'), 'known cipher suite not found in output'
|
28
|
+
|
29
|
+
restore_stdout
|
30
|
+
end
|
31
|
+
end
|
@@ -29,7 +29,7 @@ class TestScannerApacheServerStatus < Minitest::Test
|
|
29
29
|
uri = Yawast::Commands::Utils.extract_uri(["http://localhost:#{port}"])
|
30
30
|
|
31
31
|
Yawast::Shared::Http.setup nil, nil
|
32
|
-
Yawast::Scanner::Plugins::Http::FilePresence.check_all uri
|
32
|
+
Yawast::Scanner::Plugins::Http::FilePresence.check_all uri, false
|
33
33
|
|
34
34
|
assert stdout_value.include?('\'/readme.html\' found:'), 'readme.html page warning not found'
|
35
35
|
|
@@ -15,7 +15,7 @@ class TestScannerApacheServerInfo < Minitest::Test
|
|
15
15
|
Yawast::Shared::Http.setup nil, nil
|
16
16
|
Yawast::Scanner::Apache.check_server_info uri
|
17
17
|
|
18
|
-
assert stdout_value.include?('Apache Server
|
18
|
+
assert stdout_value.include?('Apache Server Information page found'), 'Apache Server Info page warning not found'
|
19
19
|
|
20
20
|
server.exit
|
21
21
|
restore_stdout
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yawast
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.0.
|
4
|
+
version: 0.5.0.beta2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Caudill
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ssllabs
|
@@ -123,6 +123,7 @@ files:
|
|
123
123
|
- ".travis.yml"
|
124
124
|
- CHANGELOG.md
|
125
125
|
- Gemfile
|
126
|
+
- LICENSE
|
126
127
|
- README.md
|
127
128
|
- Rakefile
|
128
129
|
- bin/yawast
|
@@ -132,7 +133,8 @@ files:
|
|
132
133
|
- lib/commands/scan.rb
|
133
134
|
- lib/commands/ssl.rb
|
134
135
|
- lib/commands/utils.rb
|
135
|
-
- lib/resources/
|
136
|
+
- lib/resources/common_dir.txt
|
137
|
+
- lib/resources/common_file.txt
|
136
138
|
- lib/scanner/apache.rb
|
137
139
|
- lib/scanner/cert.rb
|
138
140
|
- lib/scanner/cms.rb
|
@@ -163,6 +165,7 @@ files:
|
|
163
165
|
- test/test_cmd_util.rb
|
164
166
|
- test/test_directory_search.rb
|
165
167
|
- test/test_helper.rb
|
168
|
+
- test/test_internalssl.rb
|
166
169
|
- test/test_object_presence.rb
|
167
170
|
- test/test_scan_apache_banner.rb
|
168
171
|
- test/test_scan_apache_server_info.rb
|
@@ -195,7 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
195
198
|
version: 1.3.1
|
196
199
|
requirements: []
|
197
200
|
rubyforge_project: yawast
|
198
|
-
rubygems_version: 2.
|
201
|
+
rubygems_version: 2.4.8
|
199
202
|
signing_key:
|
200
203
|
specification_version: 4
|
201
204
|
summary: The YAWAST Antecedent Web Application Security Toolkit
|
@@ -211,6 +214,7 @@ test_files:
|
|
211
214
|
- test/test_cmd_util.rb
|
212
215
|
- test/test_directory_search.rb
|
213
216
|
- test/test_helper.rb
|
217
|
+
- test/test_internalssl.rb
|
214
218
|
- test/test_object_presence.rb
|
215
219
|
- test/test_scan_apache_banner.rb
|
216
220
|
- test/test_scan_apache_server_info.rb
|