ruby_acunetix 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ruby_acunetix.rb +5 -3
- data/lib/ruby_acunetix/ra_cve.rb +22 -0
- data/lib/ruby_acunetix/ra_cvss3.rb +15 -15
- data/lib/ruby_acunetix/ra_cwe.rb +20 -0
- data/lib/ruby_acunetix/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6691b4fdb13df031e625733708284a6fcc4434bc
|
4
|
+
data.tar.gz: 35e125415dbee798c49c305c63874cebf55b1391
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7558bce847137ce39f5f07aa6da55b8d374b0a9bc1ebab5d74b9bb35e2b9e512a439890dc10f7939b10feb2cada1663c999f77d989db7edf0779d9065afe0ac
|
7
|
+
data.tar.gz: 633cef8c577048aaf02af68e05f7df507ce92ae6762536a10cb4471b671db0ff15fdbae885e4d20a0e1bed807962566ff5797ec564253520ead3d908983e2b23
|
data/lib/ruby_acunetix.rb
CHANGED
@@ -3,6 +3,8 @@ require 'nokogiri'
|
|
3
3
|
require File.join(File.dirname(__FILE__), 'ruby_acunetix', 'version')
|
4
4
|
require File.join(File.dirname(__FILE__), 'ruby_acunetix', 'ra_cvss')
|
5
5
|
require File.join(File.dirname(__FILE__), 'ruby_acunetix', 'ra_cvss3')
|
6
|
+
require File.join(File.dirname(__FILE__), 'ruby_acunetix', 'ra_cve')
|
7
|
+
require File.join(File.dirname(__FILE__), 'ruby_acunetix', 'ra_cwe')
|
6
8
|
require File.join(File.dirname(__FILE__), 'ruby_acunetix', 'ra_reference')
|
7
9
|
require File.join(File.dirname(__FILE__), 'ruby_acunetix', 'ra_report_item')
|
8
10
|
|
@@ -19,10 +21,10 @@ module RubyAcunetix
|
|
19
21
|
end
|
20
22
|
|
21
23
|
cwe = xml_report_item.css('CWEList')
|
22
|
-
report_item.
|
24
|
+
report_item.cwe = RaCwe.parse(cwe.css('CWE')) if !cwe.nil?
|
23
25
|
|
24
26
|
cve = xml_report_item.css('CVEList')
|
25
|
-
report_item.
|
27
|
+
report_item.cve = RaCve.parse(cve.css('CVE')) if !cve.nil?
|
26
28
|
|
27
29
|
cvss = xml_report_item.css('CVSS')
|
28
30
|
report_item.cvss = RaCvss.parse(cvss) if !cvss.nil?
|
@@ -42,7 +44,7 @@ module RubyAcunetix
|
|
42
44
|
report_items.push report_item
|
43
45
|
end
|
44
46
|
|
45
|
-
|
47
|
+
report_items
|
46
48
|
end
|
47
49
|
|
48
50
|
def self.ra_underscore(value)
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class RaCve
|
2
|
+
attr_accessor :id, :year, :text
|
3
|
+
|
4
|
+
def initialize(id, year, text)
|
5
|
+
self.id = id
|
6
|
+
self.year = year
|
7
|
+
self.text = text
|
8
|
+
end
|
9
|
+
|
10
|
+
class << self
|
11
|
+
def parse(cve)
|
12
|
+
return nil if cve.css('CVE').nil? || cve.css('CVE').text.strip == ''
|
13
|
+
|
14
|
+
id = cve.css('CVE').attribute('id').value
|
15
|
+
year = cve.css('CVE').attribute('year').value
|
16
|
+
text = cve.css('CVE').text
|
17
|
+
|
18
|
+
RaCve.new(id, year, text)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
@@ -23,21 +23,21 @@ class RaCvss3
|
|
23
23
|
def parse(cvss3)
|
24
24
|
fields = {}
|
25
25
|
|
26
|
-
fields[:descriptor] = cvss3.css(
|
27
|
-
fields[:score] = cvss3.css(
|
28
|
-
fields[:temp_score] = cvss3.css(
|
29
|
-
fields[:env_score] = cvss3.css(
|
30
|
-
fields[:av] = cvss3.css(
|
31
|
-
fields[:ac] = cvss3.css(
|
32
|
-
fields[:pr] = cvss3.css(
|
33
|
-
fields[:ui] = cvss3.css(
|
34
|
-
fields[:s] = cvss3.css(
|
35
|
-
fields[:c] = cvss3.css(
|
36
|
-
fields[:i] = cvss3.css(
|
37
|
-
fields[:a] = cvss3.css(
|
38
|
-
fields[:e] = cvss3.css(
|
39
|
-
fields[:rl] = cvss3.css(
|
40
|
-
fields[:rc] = cvss3.css(
|
26
|
+
fields[:descriptor] = cvss3.css('Descriptor').text
|
27
|
+
fields[:score] = cvss3.css('Score').text
|
28
|
+
fields[:temp_score] = cvss3.css('TempScore').text
|
29
|
+
fields[:env_score] = cvss3.css('EnvScore').text
|
30
|
+
fields[:av] = cvss3.css('AV').text
|
31
|
+
fields[:ac] = cvss3.css('AC').text
|
32
|
+
fields[:pr] = cvss3.css('PR').text
|
33
|
+
fields[:ui] = cvss3.css('UI').text
|
34
|
+
fields[:s] = cvss3.css('S').text
|
35
|
+
fields[:c] = cvss3.css('C').text
|
36
|
+
fields[:i] = cvss3.css('I').text
|
37
|
+
fields[:a] = cvss3.css('A').text
|
38
|
+
fields[:e] = cvss3.css('E').text
|
39
|
+
fields[:rl] = cvss3.css('RL').text
|
40
|
+
fields[:rc] = cvss3.css('RC').text
|
41
41
|
|
42
42
|
RaCvss3.new(fields)
|
43
43
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class RaCwe
|
2
|
+
attr_accessor :id, :year, :text
|
3
|
+
|
4
|
+
def initialize(id, text)
|
5
|
+
self.id = id
|
6
|
+
self.text = text
|
7
|
+
end
|
8
|
+
|
9
|
+
class << self
|
10
|
+
def parse(cwe)
|
11
|
+
return nil if cwe.css('CWE').nil? || cwe.css('CWE').text.strip == ''
|
12
|
+
|
13
|
+
id = cwe.css('CWE').attribute('id').value
|
14
|
+
text = cwe.css('CWE').text
|
15
|
+
|
16
|
+
RaCwe.new(id, text)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_acunetix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adilson Chacon
|
@@ -18,8 +18,10 @@ extensions: []
|
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
20
|
- lib/ruby_acunetix.rb
|
21
|
+
- lib/ruby_acunetix/ra_cve.rb
|
21
22
|
- lib/ruby_acunetix/ra_cvss.rb
|
22
23
|
- lib/ruby_acunetix/ra_cvss3.rb
|
24
|
+
- lib/ruby_acunetix/ra_cwe.rb
|
23
25
|
- lib/ruby_acunetix/ra_reference.rb
|
24
26
|
- lib/ruby_acunetix/ra_report_item.rb
|
25
27
|
- lib/ruby_acunetix/version.rb
|