yawast 0.6.0.beta3 → 0.6.0.beta4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,34 @@
1
+ require 'json'
2
+
3
+ module Yawast
4
+ module Scanner
5
+ module Plugins
6
+ module SSL
7
+ module SSLLabs
8
+ class Analyze
9
+ def self.scan(endpoint, target, startNew)
10
+ uri = endpoint.copy
11
+ uri.path = '/api/v3/analyze'
12
+
13
+ if startNew
14
+ uri.query = "host=#{target}&publish=off&startNew=on&all=done&ignoreMismatch=on"
15
+ else
16
+ uri.query = "host=#{target}&publish=off&all=done&ignoreMismatch=on"
17
+ end
18
+
19
+ body = Yawast::Shared::Http.get uri
20
+
21
+ return body
22
+ end
23
+
24
+ def self.extract_status(body)
25
+ json = JSON.parse body
26
+
27
+ return json['status']
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,33 @@
1
+ require 'json'
2
+
3
+ module Yawast
4
+ module Scanner
5
+ module Plugins
6
+ module SSL
7
+ module SSLLabs
8
+ class Info
9
+ def self.call_info(endpoint)
10
+ uri = endpoint.copy
11
+ uri.path = '/api/v3/info'
12
+
13
+ body = Yawast::Shared::Http.get uri
14
+
15
+ return body
16
+ end
17
+
18
+ def self.extract_msg(body)
19
+ ret = Array.new
20
+ json = JSON.parse body
21
+
22
+ json['messages'].each do |msg|
23
+ ret.push msg
24
+ end
25
+
26
+ return ret
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end