Sha256: 96cdcca4d9a1c2b30d27f93a53f4f4304dbc01dff86a09ab3d38c477f5b99da0

Contents?: true

Size: 1.1 KB

Versions: 2

Compression:

Stored size: 1.1 KB

Contents

require 'spec_helper'

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

    def platforms
        [:apache]
    end

    context 'when there is an Server header' do
        it 'identifies it as Apache' do
            check_platforms Arachni::Page.from_data(
                url:     'http://stuff.com/blah',
                response: { headers: { 'Server' => 'Apache/2.2.21' } }
            )
        end
    end

    context 'when there is a X-Powered-By header' do
        it 'identifies it as Apache' do
            check_platforms Arachni::Page.from_data(
                url:     'http://stuff.com/blah',
                response: { headers: { 'X-Powered-By' => 'Stuf/0.4 (Apache)' } }
            )
        end
    end

    context 'when there is an Server header that includes Coyote' do
        it 'does not identify it as Apache' do
            platforms_for( Arachni::Page.from_data(
                url:     'http://stuff.com/blah',
                response: { headers:  { 'Server' => 'Apache-Coyote/1.1' } }
            )).to_a.should be_empty
        end
    end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
arachni-1.2.1 spec/components/fingerprinters/servers/apache_spec.rb
arachni-1.2 spec/components/fingerprinters/servers/apache_spec.rb