Sha256: 165b5769afeb3644eb4dcc6e7e4958574582dce6124207617916eabb008893fc

Contents?: true

Size: 1.8 KB

Versions: 9

Compression:

Stored size: 1.8 KB

Contents

require 'spec_helper'

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

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

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

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

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

    context 'when there is an X-Powered-By header with Servlet' do
        it 'identifies it as JSP' do
            page = Arachni::Page.new(
                url:     'http://stuff.com/blah',
                response_headers:  { 'X-Powered-By' => 'Servlet/2.4' }

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

    context 'when there is an X-Powered-By header with JSP' do
        it 'identifies it as JSP' do
            page = Arachni::Page.new(
                url:     'http://stuff.com/blah',
                response_headers:  { 'X-Powered-By' => 'JSP/2.1' }

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

Version data entries

9 entries across 9 versions & 1 rubygems

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