Class: WPScan::Finders::ThemeVersion::Style
- Inherits:
-
Finder
- Object
- Finder
- WPScan::Finders::ThemeVersion::Style
show all
- Defined in:
- app/finders/theme_version/style.rb
Overview
Theme Version Finder from the style.css file
Constant Summary
Constants inherited
from Finder
Finder::DIRECT_ACCESS
Instance Attribute Summary
Attributes inherited from Finder
#progress_bar, #target
Instance Method Summary
collapse
Methods inherited from Finder
#browser, #create_progress_bar, #found_by, #hydra, #initialize, #titleize
Instance Method Details
#aggressive(_opts = {}) ⇒ Version
20
21
22
23
24
|
# File 'app/finders/theme_version/style.rb', line 20
def aggressive(_opts = {})
return if cached_style?
style_version
end
|
#cached_style? ⇒ Boolean
27
28
29
|
# File 'app/finders/theme_version/style.rb', line 27
def cached_style?
Typhoeus::Config.cache.get(browser.forge_request(target.style_url)) ? true : false
end
|
#passive(_opts = {}) ⇒ Version
11
12
13
14
15
|
# File 'app/finders/theme_version/style.rb', line 11
def passive(_opts = {})
return unless cached_style?
style_version
end
|
#style_version ⇒ Version
32
33
34
35
36
37
38
39
40
41
|
# File 'app/finders/theme_version/style.rb', line 32
def style_version
return unless Browser.get(target.style_url).body =~ /Version:[\t ]*(?!trunk)([0-9a-z.-]+)/i
Model::Version.new(
Regexp.last_match[1],
found_by: found_by,
confidence: 80,
interesting_entries: ["#{target.style_url}, Match: '#{Regexp.last_match}'"]
)
end
|