Sha256: 37f1912f6348f67aad7889eaa74400cb2f1ea52d7efe7141f7507b911a8b3f2e

Contents?: true

Size: 1.37 KB

Versions: 4

Compression:

Stored size: 1.37 KB

Contents

require_relative '../../../../spec_helper'

describe Arachni::Element::Capabilities::Auditable::RDiff do

    before :all do
        @url     = server_url_for( :rdiff )
        @auditor = Auditor.new
    end

    describe '#rdiff_analysis' do
        before do
            @opts = {
                faults: ['bad'],
                bools:  ['good']
            }
            @params = { 'rdiff' => 'blah' }
            issues.clear
        end

        context 'when response behavior suggests a vuln' do
            it 'should log issue' do
                auditable = Arachni::Element::Link.new( @url + '/true', @params )
                auditable.auditor = @auditor
                auditable.rdiff_analysis( @opts )
                @auditor.http.run
                @auditor.http.run

                results = Arachni::Module::Manager.results
                results.should be_any
                results.first.var.should == 'rdiff'
            end
        end

        context 'when responses are\'t consistent with vuln behavior' do
            it 'should not log issue' do
                auditable = Arachni::Element::Link.new( @url + '/false', @params )
                auditable.auditor = @auditor
                auditable.rdiff_analysis( @opts )
                @auditor.http.run
                @auditor.http.run
                issues.should be_empty
            end
        end

    end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
arachni-0.4.1.3 spec/arachni/element/capabilities/auditable/rdiff_spec.rb
arachni-0.4.1.2 spec/arachni/element/capabilities/auditable/rdiff_spec.rb
arachni-0.4.1.1 spec/arachni/element/capabilities/auditable/rdiff_spec.rb
arachni-0.4.1 spec/arachni/element/capabilities/auditable/rdiff_spec.rb