cms_scanner 0.6.2 → 0.7.0

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
  SHA256:
3
- metadata.gz: ce0744a34bbd0c132deb23343fd656128e441e2fa8b504d412960764aa817c8b
4
- data.tar.gz: 3bab63808a71daf4a727b9d45a701383e911e429ecbd090a57b8d168439ef632
3
+ metadata.gz: a43eae35565741225f655162102b41bd67ce00d0d1ba7203ed418d7c3497b37c
4
+ data.tar.gz: e382dea43f37c75f72db92b725c122f278d9b298440172e23a559c0abd1af686
5
5
  SHA512:
6
- metadata.gz: db9dc4a06106ec0f7d8f752ff8f07852a8b31fa20a9ae68371fcdce7ed6f97bdcdb5dc537a871bc73d32da728ad259f5786d2088db976aae6034f2a9ea18e4b9
7
- data.tar.gz: e69091688e69db3cac7e596c34954e3675e89dd16942e30459e5f59d27d547d4199182d8ce01e9fbf9c48c7d3b901a9d068b792a46c355471a57a1826c004e21
6
+ metadata.gz: bb135c2e5cab45ee6ff4f149e837e6d651e56d29cc627ad6f19375e4a934b47960940f0d7a1ab1753f16f27947dc31ec44b9bbba837170aff891ec09e0b622fc
7
+ data.tar.gz: f5ed818207f80837ea873b7510d59cf0d9b1d52a5a315a2622cd02ce4c00cf0bc9771134fa9869739ccab619ca949c2d96ac61d3d4e77dda98245abbdaa9eb9f
@@ -20,7 +20,11 @@ module CMSScanner
20
20
 
21
21
  # @return [ String ] The titleized name of the finder
22
22
  def titleize
23
- self.class.to_s.demodulize.underscore.titleize
23
+ # Put a _ char before any digits except those at the end, which will be replaced by a space
24
+ # Otherwise, class such as Error404Page are returned as Error404 Page instead of Error 404 page
25
+ # The keep_id_suffix is to concevert classes such as CssId to Css Id instead of Css
26
+
27
+ @titleize ||= self.class.to_s.demodulize.gsub(/(\d+)[a-z]+/i, '_\0').titleize(keep_id_suffix: true)
24
28
  end
25
29
 
26
30
  # @param [ Hash ] _opts
@@ -50,15 +54,17 @@ module CMSScanner
50
54
  @hydra ||= browser.hydra
51
55
  end
52
56
 
53
- # @param [ String, Symbol ] klass
57
+ # @param [String, Class ] klass
54
58
  # @return [ String ]
55
- def found_by(klass = self)
59
+ def found_by(klass = self.class)
56
60
  caller_locations.each do |call|
57
61
  label = call.label
58
62
 
59
63
  next unless %w[aggressive passive].include? label
60
64
 
61
- return "#{klass.titleize} (#{label.capitalize} Detection)"
65
+ title = klass.to_s.demodulize.gsub(/(\d+)[a-z]+/i, '_\0').titleize(keep_id_suffix: true)
66
+
67
+ return "#{title} (#{label.capitalize} Detection)"
62
68
  end
63
69
  nil
64
70
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Version
4
4
  module CMSScanner
5
- VERSION = '0.6.2'
5
+ VERSION = '0.7.0'
6
6
  end
@@ -62,13 +62,13 @@ module CMSScanner
62
62
 
63
63
  # @return [ String ] The URL of an unlikely existant page
64
64
  def error_404_url
65
- non_existant_page_url
65
+ @error_404_url ||= non_existant_page_url
66
66
  end
67
67
 
68
68
  # @return [ String ] The URL of an unlikely existant page
69
69
  # TODO: This will be removed in the next major version (0.7)
70
70
  def non_existant_page_url
71
- uri.join(Digest::MD5.hexdigest(rand(999_999).to_s) + '.html').to_s
71
+ uri.join(Digest::MD5.hexdigest(rand(999_999).to_s)[0..6] + '.html').to_s
72
72
  end
73
73
 
74
74
  # Checks if the remote website is up.
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.6.2
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - WPScanTeam
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-30 00:00:00.000000000 Z
11
+ date: 2019-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: get_process_mem