Class: Arachni::OptionGroups::Session

Inherits:
Arachni::OptionGroup show all
Defined in:
lib/arachni/option_groups/session.rb

Overview

Holds login options for the Framework's Session manager.

Author:

  • Tasos “Zapotek” Laskos <tasos.laskos@arachni-scanner.com>

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Arachni::OptionGroup

#==, attr_accessor, attributes, #attributes, defaults, #defaults, #hash, inherited, #initialize, #merge, set_defaults, #to_h, #to_hash, #update

Constructor Details

This class inherits a constructor from Arachni::OptionGroup

Instance Attribute Details

#check_patternRegexp

Returns Pattern which should match the #check_url response HTTP::Response#body when a valid webapp session has been established.

Returns:

  • (Regexp)

    Pattern which should match the #check_url response HTTP::Response#body when a valid webapp session has been established.

See Also:



30
31
32
# File 'lib/arachni/option_groups/session.rb', line 30

def check_pattern
  @check_pattern
end

#check_urlString

Returns URL whose response HTTP::Response#body should match #check_pattern when a valid webapp session has been established.

Returns:

See Also:



22
23
24
# File 'lib/arachni/option_groups/session.rb', line 22

def check_url
  @check_url
end

Instance Method Details

#to_rpc_dataObject



47
48
49
50
51
# File 'lib/arachni/option_groups/session.rb', line 47

def to_rpc_data
    d = super
    d['check_pattern'] = d['check_pattern'].to_s if d['check_pattern']
    d
end

#validateObject



38
39
40
41
42
43
44
45
# File 'lib/arachni/option_groups/session.rb', line 38

def validate
    return {} if (check_url && check_pattern) || (!check_url && !check_pattern)

    {
        (check_url ? :check_pattern : :check_url) =>
            'Option is missing.'
    }
end