Sha256: 6994a2dabfaab011be874dfa4de47672857f255cd126ed3f408ba5034a6550da

Contents?: true

Size: 1.76 KB

Versions: 1

Compression:

Stored size: 1.76 KB

Contents

# frozen_string_literal: true

module Yawast
  module Scanner
    module Plugins
      module Applications
        module Framework
          class PHP
            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

            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
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
yawast-0.7.2 lib/scanner/plugins/applications/framework/php.rb