class Yawast::Scanner::Plugins::Applications::Framework::PHP

Public Class Methods

check_banner(banner) click to toggle source
# File lib/scanner/plugins/applications/framework/php.rb, line 9
def self.check_banner(banner)
  Yawast::Shared::Output.log_hash 'vulnerabilities',
                                  'php_version_exposed_banner',
                                  {vulnerable: false, version: nil, banner: banner}

  # 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_banner',
                                      {vulnerable: true, version: mod, banner: banner}
    end
  end
end
check_powered_by(banner) click to toggle source
# File lib/scanner/plugins/applications/framework/php.rb, line 31
def self.check_powered_by(banner)
  Yawast::Shared::Output.log_hash 'vulnerabilities',
                                  'php_version_exposed_powered_by',
                                  {vulnerable: false, version: nil}

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

  Yawast::Utilities.puts_warn "PHP Version: #{banner}"
  Yawast::Shared::Output.log_hash 'vulnerabilities',
                                  'php_version_exposed_powered_by',
                                  {vulnerable: true, version: banner}
end