Sha256: 7eaa43d5a8738877b2734635adca796bd9b5cccf2d289274a060736860d8a71a

Contents?: true

Size: 1.87 KB

Versions: 4

Compression:

Stored size: 1.87 KB

Contents

require_relative '../spec_helper'

describe name_from_filename do
    include_examples 'plugin'

    before( :all ) do
        options.url = url
    end

    context "when given the right params" do
        it 'should locate the form and login successfully' do
            name = name_from_filename

            options.plugins[name] = {
                'username_field' => 'username',
                'password_field' => 'password',
                'username_list'  => spec_path + 'fixtures/usernames.txt',
                'password_list'  => spec_path + 'fixtures/passwords.txt',
                'login_verifier' => 'logged in user!'
            }

            run
            results_for( name ).should == { username: 'sys', password: 'admin' }
        end
    end

    context "when being unable to login" do
        it 'should not log any results' do
            name = name_from_filename

            options.plugins[name] = {
                'username_field' => 'username',
                'password_field' => 'password',
                'username_list'  => spec_path + 'fixtures/usernames.txt',
                'password_list'  => spec_path + 'fixtures/passwords.txt',
                'login_verifier' => '34342#R#@$#2'
            }

            run
            results_for( name ).should be_nil
        end
    end

    context "when given invalid params" do
        it 'should complain about not being able to find the form' do
            name = name_from_filename

            options.plugins[name] = {
                'username_field' => 'username2',
                'password_field' => 'password',
                'username_list'  => spec_path + 'fixtures/usernames.txt',
                'password_list'  => spec_path + 'fixtures/passwords.txt',
                'login_verifier' => 'logged in user!'
            }

            run
            results_for( name ).should be_nil
        end
    end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
arachni-0.4.1.3 spec/plugins/form_dicattack_spec.rb
arachni-0.4.1.2 spec/plugins/form_dicattack_spec.rb
arachni-0.4.1.1 spec/plugins/form_dicattack_spec.rb
arachni-0.4.1 spec/plugins/form_dicattack_spec.rb