Class: Yawast::Scanner::Plugins::Applications::Framework::PHP

Inherits:
Object
  • Object
show all
Defined in:
lib/scanner/plugins/applications/framework/php.rb

Class Method Summary collapse

Class Method Details

.check_banner(banner) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# 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) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
43
# 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