Sha256: e9b251f80bacacdbf4aca371707866178d3aa1e4f78140fce20e5fa8f70696f6

Contents?: true

Size: 1.94 KB

Versions: 9

Compression:

Stored size: 1.94 KB

Contents

require 'spec_helper'

describe Arachni::Platform::Fingerprinters::PHP do
    include_examples 'fingerprinter'

    context 'when the page has a .php extension' do
        it 'identifies it as PHP' do
            page = Arachni::Page.new( url: 'http://stuff.com/blah.php' )
            platforms_for( page ).should include :php
        end
    end

    context 'when the page has a .php/ rewrite' do
        it 'identifies it as PHP' do
            page = Arachni::Page.new( url: 'http://stuff.com/blah.php/Stuff/1' )
            platforms_for( page ).should include :php
        end
    end

    context 'when the page has a .php5 (or similarly numbered) extension' do
        it 'identifies it as PHP' do
            page = Arachni::Page.new( url: 'http://stuff.com/blah.php5' )
            platforms_for( page ).should include :php
        end
    end

    context 'when there is a PHPSESSID query parameter' do
        it 'identifies it as PHP' do
            page = Arachni::Page.new(
                url:        'http://stuff.com/blah?PHPSESSID=stuff',
                query_vars: {
                    'PHPSESSID' => 'stuff'
                }
            )
            platforms_for( page ).should include :php
        end
    end

    context 'when there is a PHPSESSID cookie' do
        it 'identifies it as PHP' do
            page = Arachni::Page.new(
                url:     'http://stuff.com/blah',
                cookies: [Arachni::Cookie.new( 'http://stuff.com/blah',
                                               'PHPSESSID' => 'stuff' )]

            )
            platforms_for( page ).should include :php
        end
    end

    context 'when there is an X-Powered-By header' do
        it 'identifies it as PHP' do
            page = Arachni::Page.new(
                url: 'http://stuff.com/blah',
                response_headers: { 'X-Powered-By' => 'PHP/5.1.2' }
            )
            platforms_for( page ).should include :php
        end
    end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
arachni-0.4.7 spec/fingerprinters/languages/php_spec.rb
arachni-0.4.6 spec/fingerprinters/languages/php_spec.rb
arachni-0.4.5.2 spec/fingerprinters/languages/php_spec.rb
arachni-0.4.5.1 spec/fingerprinters/languages/php_spec.rb
arachni-0.4.5 spec/fingerprinters/languages/php_spec.rb
arachni-0.4.4 spec/fingerprinters/languages/php_spec.rb
arachni-0.4.3.2 spec/fingerprinters/languages/php_spec.rb
arachni-0.4.3.1 spec/fingerprinters/languages/php_spec.rb
arachni-0.4.3 spec/fingerprinters/languages/php_spec.rb