offrep 0.1.2 → 0.1.3
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/exe/offrep +5 -0
- data/lib/offrep/commonxml.rb +6 -6
- data/lib/offrep/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 40b319807abbd647386c0e3c685472350c7e11c9
|
|
4
|
+
data.tar.gz: d3b7909d360a4e8c47a8d945cacfd6a4adff2dce
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ea12e5bc7fd6d93e26a1193bb64c01c7e88d1bc39d3398179a8b2f64767abc2b5027d43d29a6d0e05c9acae9cae9716887ec2613153466109914b5a4f9991ae1
|
|
7
|
+
data.tar.gz: 2ab9cc5b5293ccec3946b66f3b3fff2218888e887571a43669f64170b8a0e11c0df715dbb171dfeaec6babb757af390081aff808e79321e7ec97c2452a17868b
|
data/exe/offrep
CHANGED
|
@@ -61,6 +61,11 @@ OptionParser.new do |opts|
|
|
|
61
61
|
exit
|
|
62
62
|
end
|
|
63
63
|
|
|
64
|
+
opts.on("-V", "--version", "Prints the version") do
|
|
65
|
+
puts "#{$PRGNAME} #{Offrep::VERSION}"
|
|
66
|
+
exit
|
|
67
|
+
end
|
|
68
|
+
|
|
64
69
|
opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
|
|
65
70
|
$options['verbose'] = v
|
|
66
71
|
@log.level = Logger::INFO
|
data/lib/offrep/commonxml.rb
CHANGED
|
@@ -79,14 +79,14 @@ module Offrep
|
|
|
79
79
|
@xmldoc
|
|
80
80
|
end
|
|
81
81
|
|
|
82
|
-
def anonymize(xmln)
|
|
82
|
+
def anonymize(xmln)
|
|
83
83
|
xmln.xpath('/vulnerabilities/vulnerability/target').each do |target|
|
|
84
84
|
target.remove
|
|
85
85
|
end
|
|
86
86
|
xmln.xpath('/vulnerabilities/vulnerability/data/common/output').each do |output|
|
|
87
87
|
output.remove
|
|
88
|
-
end
|
|
89
|
-
return xmln
|
|
88
|
+
end
|
|
89
|
+
return xmln
|
|
90
90
|
end
|
|
91
91
|
|
|
92
92
|
def emptyxml
|
|
@@ -206,19 +206,19 @@ module Offrep
|
|
|
206
206
|
|
|
207
207
|
def translate(trxml)
|
|
208
208
|
misxml = emptyxml()
|
|
209
|
-
@xmldoc.xpath('/vulnerabilities/vulnerability').each do |vuln|
|
|
209
|
+
@xmldoc.xpath('/vulnerabilities/vulnerability').each do |vuln|
|
|
210
210
|
foundit=false
|
|
211
211
|
# binding.pry
|
|
212
212
|
vuln.at_xpath('./id').element_children.each do |ids|
|
|
213
213
|
if ids.name=='cve' then
|
|
214
|
-
next
|
|
214
|
+
next
|
|
215
215
|
end
|
|
216
216
|
# binding.pry
|
|
217
217
|
trid=trxml.at_xpath("/vulnerabilities/vulnerability[./id/#{ids.name}='#{ids.content}']")
|
|
218
218
|
if not trid.nil? then
|
|
219
219
|
foundit=true
|
|
220
220
|
# replace all XML elements inside /data/common to translated ones
|
|
221
|
-
trid.at_xpath('./data/common').element_children.each do |ele|
|
|
221
|
+
trid.at_xpath('./data/common').element_children.each do |ele|
|
|
222
222
|
# puts ele.name
|
|
223
223
|
foundele=vuln.at_xpath("./data/common/#{ele.name}")
|
|
224
224
|
# if element not found, add as a child in common
|
data/lib/offrep/version.rb
CHANGED