cms_scanner 0.0.34 → 0.0.35

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 452fa0c8c2290b87448608c952c7209f789b9ca2
4
- data.tar.gz: 5ea8b78419089ff26a041cd62787b785f816a5cb
3
+ metadata.gz: 49d944ff5035f864246c90eb6044bdb6064e96e2
4
+ data.tar.gz: cba3e1cb7d04fd52896abf993fa65566d326bbee
5
5
  SHA512:
6
- metadata.gz: 16e142c0b57688548e12b6b7e9df53204d40d46ac4dce1c3d27a5bdd7adf8a0af936bb9123dad7d33ca9cb667a3484874797ac339dd5a415a71d89e24721b498
7
- data.tar.gz: ca319bb0fcaf4c4f207f8aff69ea31a42119be99d68d473d102f224d2cd435d84808c9e00ffce0928d007b9de9341631a1e46919c292a09e6d39e7868d0de769
6
+ metadata.gz: be3c89a67f52b7311cfb50e3008244fc9a8d8c4a0edb95194cc5973380deae385d9d5cd6fca207724a8450eff39e2137dd663ba8e8ebf7328e0e3812a6860167
7
+ data.tar.gz: d87566916dd0aba9415eda327b1ade9fe4724c1b5e826450ad085c189e170846fd65b0ddd3a500ba814cadb18785c30d4720f0366f4ae5b5637aa724d98c967f
@@ -20,7 +20,7 @@ module CMSScanner
20
20
  end
21
21
 
22
22
  def references
23
- %w(https://interconnectit.com/products/search-and-replace-for-wordpress-databases/)
23
+ { url: 'https://interconnectit.com/products/search-and-replace-for-wordpress-databases/' }
24
24
  end
25
25
  end
26
26
  end
@@ -14,7 +14,7 @@ module CMSScanner
14
14
  end
15
15
 
16
16
  def references
17
- %w(http://www.acunetix.com/vulnerabilities/fantastico-fileslist/)
17
+ { url: 'http://www.acunetix.com/vulnerabilities/fantastico-fileslist/' }
18
18
  end
19
19
  end
20
20
  end
@@ -18,6 +18,6 @@ Interesting Finding(s):
18
18
  <% end -%>
19
19
  <% end -%>
20
20
  <% end -%>
21
- <%= render('_array', a: finding.references, s: 'Reference', p: 'References') -%>
21
+ <%= render('_array', a: finding.references_urls, s: 'Reference', p: 'References') -%>
22
22
  <% end -%>
23
23
  <% end %>
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
9
9
  s.version = CMSScanner::VERSION
10
10
  s.platform = Gem::Platform::RUBY
11
11
  s.required_ruby_version = '>= 2.1.0'
12
- s.authors = ['WPScanTeam ']
12
+ s.authors = ['WPScanTeam']
13
13
  s.email = ['team@wpscan.org']
14
14
  s.summary = 'CMS Scanner Framework (experimental)'
15
15
  s.description = 'Framework to provide an easy way to implement CMS Scanners'
@@ -1,16 +1,18 @@
1
+ require 'cms_scanner/references'
2
+
1
3
  module CMSScanner
2
4
  module Finders
3
5
  # Finding
4
6
  module Finding
7
+ # Fix for "Double/Dynamic Inclusion Problem"
8
+ def self.included(base)
9
+ base.send(:include, References)
10
+ end
11
+
5
12
  FINDING_OPTS = [:confidence, :confirmed_by, :references, :found_by, :interesting_entries]
6
13
 
7
14
  attr_accessor(*FINDING_OPTS)
8
15
 
9
- # @return [ Array ]
10
- def references
11
- @references ||= []
12
- end
13
-
14
16
  # @return [ Array ]
15
17
  def confirmed_by
16
18
  @confirmed_by ||= []
@@ -33,7 +35,6 @@ module CMSScanner
33
35
  end
34
36
 
35
37
  # @param [ Hash ] opts
36
- # TODO: Maybe use instance_variable_set ?
37
38
  def parse_finding_options(opts = {})
38
39
  FINDING_OPTS.each { |opt| send("#{opt}=", opts[opt]) if opts.key?(opt) }
39
40
  end
@@ -1,6 +1,25 @@
1
1
  module CMSScanner
2
- # References related to the vulnerability
3
- class Vulnerability
2
+ # References related to the issue
3
+ module References
4
+ # @return [ Array<Symbol> ]
5
+ def references_keys
6
+ [:cve, :secunia, :osvdb, :exploitdb, :url, :metasploit, :packetstorm, :securityfocus]
7
+ end
8
+
9
+ # @param [ Hash ] refs
10
+ def references=(refs)
11
+ @references = {}
12
+
13
+ references_keys.each do |key|
14
+ @references[key] = [*refs[key]].map(&:to_s) if refs.key?(key)
15
+ end
16
+ end
17
+
18
+ # @return [ Hash ]
19
+ def references
20
+ @references ||= {}
21
+ end
22
+
4
23
  # @return [ Array<String> ] All the references URLs
5
24
  def references_urls
6
25
  cve_urls + secunia_urls + osvdb_urls + exploitdb_urls + urls + msf_urls +
@@ -9,7 +28,7 @@ module CMSScanner
9
28
 
10
29
  # @return [ Array<String> ] The CVEs
11
30
  def cves
12
- @cve ||= [*references[:cve]].map(&:to_s)
31
+ @cve ||= references[:cve] || []
13
32
  end
14
33
 
15
34
  # @return [ Array<String> ]
@@ -24,7 +43,7 @@ module CMSScanner
24
43
 
25
44
  # @return [ Array<String> ] The Secunia IDs
26
45
  def secunia_ids
27
- @secunia_ids ||= [*references[:secunia]].map(&:to_s)
46
+ @secunia_ids ||= references[:secunia] || []
28
47
  end
29
48
 
30
49
  # @return [ Array<String> ]
@@ -39,7 +58,7 @@ module CMSScanner
39
58
 
40
59
  # @return [ Array<String> ] The OSVDB IDs
41
60
  def osvdb_ids
42
- @osvdb_ids ||= [*references[:osvdb]].map(&:to_s)
61
+ @osvdb_ids ||= references[:osvdb] || []
43
62
  end
44
63
 
45
64
  # @return [ Array<String> ]
@@ -54,7 +73,7 @@ module CMSScanner
54
73
 
55
74
  # @return [ Array<String> ] The ExploitDB ID
56
75
  def exploitdb_ids
57
- @exploitdb_ids ||= [*references[:exploitdb]].map(&:to_s)
76
+ @exploitdb_ids ||= references[:exploitdb] || []
58
77
  end
59
78
 
60
79
  # @return [ Array<String> ]
@@ -69,12 +88,12 @@ module CMSScanner
69
88
 
70
89
  # @return [ String<Array> ]
71
90
  def urls
72
- @urls ||= [*references[:url]].map(&:to_s)
91
+ @urls ||= references[:url] || []
73
92
  end
74
93
 
75
94
  # @return [ Array<String> ] The metasploit modules
76
95
  def msf_modules
77
- @msf_modules ||= [*references[:metasploit]].map(&:to_s)
96
+ @msf_modules ||= references[:metasploit] || []
78
97
  end
79
98
 
80
99
  # @return [ Array<String> ]
@@ -89,7 +108,7 @@ module CMSScanner
89
108
 
90
109
  # @return [ Array<String> ] The Packetstormsecurity IDs
91
110
  def packetstorm_ids
92
- @packetstorm_ids ||= [*references[:packetstorm]].map(&:to_s)
111
+ @packetstorm_ids ||= references[:packetstorm] || []
93
112
  end
94
113
 
95
114
  # @return [ Array<String> ]
@@ -104,7 +123,7 @@ module CMSScanner
104
123
 
105
124
  # @return [ Array<String> ] The Security Focus IDs
106
125
  def securityfocus_ids
107
- @securityfocus_ids ||= [*references[:securityfocus]].map(&:to_s)
126
+ @securityfocus_ids ||= references[:securityfocus] || []
108
127
  end
109
128
 
110
129
  # @return [ Array<String> ]
@@ -1,4 +1,4 @@
1
1
  # Version
2
2
  module CMSScanner
3
- VERSION = '0.0.34'
3
+ VERSION = '0.0.35'
4
4
  end
@@ -1,9 +1,11 @@
1
- require 'cms_scanner/vulnerability/references'
1
+ require 'cms_scanner/references'
2
2
 
3
3
  module CMSScanner
4
4
  # Generic Vulnerability
5
5
  class Vulnerability
6
- attr_reader :title, :references, :type, :fixed_in
6
+ include References
7
+
8
+ attr_reader :title, :type, :fixed_in
7
9
 
8
10
  # @param [ String ] title
9
11
  # @param [ Hash ] references
@@ -16,10 +18,11 @@ module CMSScanner
16
18
  # @param [ String ] type
17
19
  # @param [ String ] fixed_in
18
20
  def initialize(title, references = {}, type = nil, fixed_in = nil)
19
- @title = title
20
- @references = references
21
- @type = type
22
- @fixed_in = fixed_in
21
+ @title = title
22
+ @type = type
23
+ @fixed_in = fixed_in
24
+
25
+ self.references = references
23
26
  end
24
27
 
25
28
  # param [ Vulnerability ] other
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cms_scanner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.34
4
+ version: 0.0.35
5
5
  platform: ruby
6
6
  authors:
7
- - 'WPScanTeam '
7
+ - WPScanTeam
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-13 00:00:00.000000000 Z
11
+ date: 2015-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opt_parse_validator
@@ -280,6 +280,7 @@ files:
280
280
  - lib/cms_scanner/formatter/buffer.rb
281
281
  - lib/cms_scanner/helper.rb
282
282
  - lib/cms_scanner/public_suffix/domain.rb
283
+ - lib/cms_scanner/references.rb
283
284
  - lib/cms_scanner/target.rb
284
285
  - lib/cms_scanner/target/hashes.rb
285
286
  - lib/cms_scanner/target/platform.rb
@@ -294,7 +295,6 @@ files:
294
295
  - lib/cms_scanner/typhoeus/response.rb
295
296
  - lib/cms_scanner/version.rb
296
297
  - lib/cms_scanner/vulnerability.rb
297
- - lib/cms_scanner/vulnerability/references.rb
298
298
  - lib/cms_scanner/web_site.rb
299
299
  homepage: https://github.com/wpscanteam/CMSScanner
300
300
  licenses: