cms_scanner 0.10.1 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ee896090149c3f5dfd501ce88374b708aba187927bdac0c593f3608c801ae0d3
4
- data.tar.gz: 24f17ebbab747417216229057783c1545ebbe06ff0a4c6c6e2ff969b67e69f97
3
+ metadata.gz: 16c22d4a89bddefca45e7f32b260f99c92469ad5f67ea66d1483bc27cb8b603c
4
+ data.tar.gz: 92fada2aa2d2c5109df300bffb72c2c44dec947fd2fb07d1dcc6ef106775042e
5
5
  SHA512:
6
- metadata.gz: 13f907d61456e051f39e2988755537e6ad6ccdbd473144a5e756cb9f91a680d23539ced35cb9e29925f7d1832e4d84fe8d975871c4d5aa230c863a9e92133eee
7
- data.tar.gz: 6fd87965f3fe9385583f5c8fef0ea82fc7b03c8a803e68b6117f410dac554b0c8677d975b894b37cf4c29e87260cb06f2d2e17c75c8e873912060d5707fe2804
6
+ metadata.gz: b0191381badb3aeece273fc5da0b7384efbb29cc041cb3b21d5562e98263775cae3d748b895086e3f8f7d277bf34906b74ac6fcec610ff662a85835c1616b5e1
7
+ data.tar.gz: 4e41d6e2909160e17025141c6921c3a2e020943a571dd652cca9803c5801a5a56bb3105da82ebdeb44f42043a22504b14dbe0a02819fc683e223dabec9e95359
@@ -19,7 +19,7 @@ module CMSScanner
19
19
  entries.each do |header, value|
20
20
  next if known_headers.include?(header.downcase)
21
21
 
22
- results << "#{header}: #{[*value].join(', ')}"
22
+ results << "#{header}: #{Array(value).join(', ')}"
23
23
  end
24
24
  results
25
25
  end
@@ -21,14 +21,14 @@ module CMSScanner
21
21
 
22
22
  return symbols if mode.nil? || mode == :mixed
23
23
 
24
- symbols.include?(mode) ? [*mode] : []
24
+ symbols.include?(mode) ? Array(mode) : []
25
25
  end
26
26
 
27
27
  # @param [ CMSScanner::Finders::Finder ] finder
28
28
  # @param [ Symbol ] symbol See return values of #symbols_from_mode
29
29
  # @param [ Hash ] opts
30
30
  def run_finder(finder, symbol, opts)
31
- [*finder.send(symbol, opts.merge(found: findings))].compact.each do |found|
31
+ Array(finder.send(symbol, opts.merge(found: findings))).compact.each do |found|
32
32
  findings << found
33
33
  end
34
34
  end
@@ -105,8 +105,10 @@ module CMSScanner
105
105
  "No response from remote server. WAF/IPS? (#{response.return_message})"
106
106
  elsif response.code.to_s.start_with?('50')
107
107
  'Server error, try reducing the number of threads.'
108
- else
108
+ elsif NS::ParsedCli.verbose?
109
109
  "Unknown response received Code: #{response.code}\nBody: #{response.body}"
110
+ else
111
+ "Unknown response received Code: #{response.code}"
110
112
  end
111
113
 
112
114
  progress_bar.log("Error: #{error}")
@@ -55,7 +55,7 @@ module CMSScanner
55
55
  # @return [ Typhoeus::Response, nil ]
56
56
  def maybe_get_full_response(head_res, opts)
57
57
  return head_res unless opts[:check_full_response] == true ||
58
- [*opts[:check_full_response]].include?(head_res.code)
58
+ Array(opts[:check_full_response]).include?(head_res.code)
59
59
 
60
60
  full_res = NS::Browser.get(head_res.effective_url, full_request_params)
61
61
 
@@ -17,7 +17,7 @@ module CMSScanner
17
17
  def log(string = nil)
18
18
  return logs if string.nil?
19
19
 
20
- logs << string
20
+ logs << string unless logs.include?(string)
21
21
  end
22
22
  end
23
23
  end
@@ -21,9 +21,9 @@ module CMSScanner
21
21
  next unless refs.key?(key)
22
22
 
23
23
  @references[key] = if key == :youtube
24
- [*refs[:youtube]].map { |id| youtube_url(id) }
24
+ Array(refs[:youtube]).map { |id| youtube_url(id) }
25
25
  else
26
- [*refs[key]].map(&:to_s)
26
+ Array(refs[key]).map(&:to_s)
27
27
  end
28
28
  end
29
29
  end
@@ -18,7 +18,7 @@ module CMSScanner
18
18
  super(url, opts)
19
19
 
20
20
  scope << uri.host
21
- [*opts[:scope]].each { |s| scope << s }
21
+ Array(opts[:scope]).each { |s| scope << s }
22
22
  end
23
23
 
24
24
  # @param [ Hash ] opts
@@ -5,7 +5,7 @@ module CMSScanner
5
5
  module Platform
6
6
  # Some PHP specific implementation
7
7
  module PHP
8
- DEBUG_LOG_PATTERN = /(?:\[\d{2}\-[a-zA-Z]{3}\-\d{4}\s\d{2}\:\d{2}:\d{2}\s[A-Z]{3}\]|
8
+ DEBUG_LOG_PATTERN = /(?:\[\d{2}-[a-zA-Z]{3}-\d{4}\s\d{2}:\d{2}:\d{2}\s[A-Z]{3}\]|
9
9
  PHP\s(?:Fatal|Warning|Strict|Error|Notice):)/x.freeze
10
10
  FPD_PATTERN = /Fatal error:.+? in (.+?) on/.freeze
11
11
  ERROR_LOG_PATTERN = /PHP Fatal error/i.freeze
@@ -53,9 +53,9 @@ module CMSScanner
53
53
  domains = [uri.host + uri.path]
54
54
 
55
55
  domains += if scope.domains.empty?
56
- [*scope.invalid_domains[1..-1]]
56
+ Array(scope.invalid_domains[1..-1])
57
57
  else
58
- [*scope.domains[1..-1]].map(&:to_s) + scope.invalid_domains
58
+ Array(scope.domains[1..-1]).map(&:to_s) + scope.invalid_domains
59
59
  end
60
60
 
61
61
  domains.map! { |d| Regexp.escape(d.delete_suffix('/')).gsub('\*', '.*').gsub('/', '\\\\\?/') }
@@ -41,7 +41,7 @@ module CMSScanner
41
41
  def directory_listing?(path = nil, params = {})
42
42
  res = NS::Browser.get(url(path), params)
43
43
 
44
- res.code == 200 && res.body =~ /<h1>Index of/ ? true : false
44
+ res.code == 200 && res.body.include?('<h1>Index of') ? true : false
45
45
  end
46
46
 
47
47
  # @param [ String ] path
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Version
4
4
  module CMSScanner
5
- VERSION = '0.10.1'
5
+ VERSION = '0.11.0'
6
6
  end
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.10.1
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - WPScanTeam
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-08 00:00:00.000000000 Z
11
+ date: 2020-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: get_process_mem
@@ -204,28 +204,28 @@ dependencies:
204
204
  requirements:
205
205
  - - "~>"
206
206
  - !ruby/object:Gem::Version
207
- version: 0.85.0
207
+ version: 0.88.0
208
208
  type: :development
209
209
  prerelease: false
210
210
  version_requirements: !ruby/object:Gem::Requirement
211
211
  requirements:
212
212
  - - "~>"
213
213
  - !ruby/object:Gem::Version
214
- version: 0.85.0
214
+ version: 0.88.0
215
215
  - !ruby/object:Gem::Dependency
216
216
  name: rubocop-performance
217
217
  requirement: !ruby/object:Gem::Requirement
218
218
  requirements:
219
219
  - - "~>"
220
220
  - !ruby/object:Gem::Version
221
- version: 1.6.0
221
+ version: 1.7.0
222
222
  type: :development
223
223
  prerelease: false
224
224
  version_requirements: !ruby/object:Gem::Requirement
225
225
  requirements:
226
226
  - - "~>"
227
227
  - !ruby/object:Gem::Version
228
- version: 1.6.0
228
+ version: 1.7.0
229
229
  - !ruby/object:Gem::Dependency
230
230
  name: simplecov
231
231
  requirement: !ruby/object:Gem::Requirement