Sha256: 8fbd64a6f96f62803c0917e44a850c776122a548fbf447bf28a980e3de2c79f0

Contents?: true

Size: 1.15 KB

Versions: 8

Compression:

Stored size: 1.15 KB

Contents

require 'spec_helper'

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

    context 'when there is an Server header' do
        described_class::IDs.each do |id|
            context "and it contains #{id}" do
                it 'identifies it as Windows' do
                    page = Arachni::Page.from_data(
                        url:     'http://stuff.com/blah',
                        response: { headers: { 'Server' => "Apache/2.2.21 (#{id})" } }
                    )
                    platforms_for( page ).should include :windows
                end
            end
        end
    end

    context 'when there is a X-Powered-By header' do
        described_class::IDs.each do |id|
            context "and it contains #{id}" do
                it 'identifies it as Windows' do
                    page = Arachni::Page.from_data(
                        url:     'http://stuff.com/blah',
                        response: { headers: { 'X-Powered-By' => "PHP/5.0 (#{id})" } }
                    )
                    platforms_for( page ).should include :windows
                end
            end
        end
    end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
arachni-1.1 spec/components/fingerprinters/os/windows_spec.rb
arachni-1.0.6 spec/components/fingerprinters/os/windows_spec.rb
arachni-1.0.5 spec/components/fingerprinters/os/windows_spec.rb
arachni-1.0.4 spec/components/fingerprinters/os/windows_spec.rb
arachni-1.0.3 spec/components/fingerprinters/os/windows_spec.rb
arachni-1.0.2 spec/components/fingerprinters/os/windows_spec.rb
arachni-1.0.1 spec/components/fingerprinters/os/windows_spec.rb
arachni-1.0 spec/components/fingerprinters/os/windows_spec.rb