Class: Arachni::HTTP::Response::Scope

Inherits:
Message::Scope show all
Defined in:
lib/arachni/http/response/scope.rb

Overview

Determines the scope status of Arachni::HTTP::Responses.

Author:

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

Direct Known Subclasses

Page::Scope

Defined Under Namespace

Classes: Error

Instance Method Summary collapse

Methods inherited from URI::Scope

#auto_redundant?, #exclude?, #exclude_file_extension?, #follow_protocol?, #in?, #in_domain?, #include?, #redundant?, #too_deep?

Methods inherited from Scope

#options

Constructor Details

#initialize(response) ⇒ Scope

Returns a new instance of Scope.

Parameters:



27
28
29
30
31
# File 'lib/arachni/http/response/scope.rb', line 27

def initialize( response )
    super response

    @response = response
end

Instance Method Details

#exclude_as_binary?Bool

Returns `true` if OptionGroups::Scope#exclude_binaries? and not Arachni::HTTP::Response#text?, `false` otherwise.

Returns:

See Also:



50
51
52
# File 'lib/arachni/http/response/scope.rb', line 50

def exclude_as_binary?
    options.exclude_binaries? && !@response.text?
end

#exclude_content?Bool

Returns `true` if Message#body matches an OptionGroups::Scope#exclude_content_patterns pattern, `false` otherwise.

Returns:

See Also:



59
60
61
# File 'lib/arachni/http/response/scope.rb', line 59

def exclude_content?
    !!options.exclude_content_patterns.find { |i| @response.body =~ i }
end

#out?Bool

Note:

Also takes into account the URI::Scope of the Message#url.

Returns `true` if the Arachni::HTTP::Response is out of scope, `false` otherwise.

Returns:

See Also:



41
42
43
# File 'lib/arachni/http/response/scope.rb', line 41

def out?
    super || exclude_as_binary? || exclude_content?
end