Class: Yawast::Scanner::Plugins::Applications::CMS::Generic

Inherits:
Object
  • Object
show all
Defined in:
lib/scanner/plugins/applications/cms/generic.rb

Class Method Summary collapse

Class Method Details

.get_generator(body) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/scanner/plugins/applications/cms/generic.rb', line 9

def self.get_generator(body)
  regex = /<meta name="generator[^>]+content\s*=\s*['"]([^'"]+)['"][^>]*>/
  match = body.match regex

  if match
    Yawast::Utilities.puts_info "Meta Generator: #{match[1]}"

    Yawast::Shared::Output.log_hash 'vulnerabilities',
                                    'cms_meta_generator_exposed',
                                    {vulnerable: true, generator: match[1]}
  else
    Yawast::Shared::Output.log_hash 'vulnerabilities',
                                    'cms_meta_generator_exposed',
                                    {vulnerable: false, generator: nil}
  end
end