Class: Yawast::Scanner::Plugins::Servers::Generic

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

Class Method Summary collapse

Class Method Details

.check_banner_php(banner) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/scanner/plugins/servers/generic.rb', line 8

def self.check_banner_php(banner)
  Yawast::Shared::Output.log_hash 'vulnerabilities',
                                  'php_version_exposed',
                                  {vulnerable: false, version: nil}

  # don't bother if this doesn't include PHP
  return unless banner.include? 'PHP/'

  modules = banner.split(' ')

  modules.each do |mod|
    if mod.include? 'PHP/'
      Yawast::Utilities.puts_warn "PHP Version: #{mod}"
      puts ''

      Yawast::Shared::Output.log_hash 'vulnerabilities',
                                      'php_version_exposed',
                                      {vulnerable: true, version: mod}
    end
  end
end