class Arachni::OptionGroups::HTTP

Holds {Arachni::HTTP} related options.

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

Constants

AUTHENTICATION_TYPES

@return [Array<String>]

Supported HTTP authentication types.
PROXY_TYPES

@return [Array<String>]

Supported proxy types.
SSL_CERTIFICATE_TYPES

@return [Array<String>]

Supported SSL certificate types.
SSL_KEY_TYPES

@return [Array<String>]

Supported SSL private key types.
SSL_VERSIONS

@return [Array<String>]

Supported SSL versions.

Attributes

authentication_password[RW]

@return [String]

Password to use for HTTP authentication.

@see HTTP::Client

authentication_type[RW]

@note Default is ‘auto`.

@return [String]

Authentication type

@see AUTHENTICATION_TYPES

authentication_username[RW]

@return [String]

Username to use for HTTP authentication.

@see HTTP::Client

cookies[RW]

@return [Hash]

Cookies as `name=>value` pairs.

@see HTTP::Client @see HTTP::CookieJar

proxy[RW]

@return [String]

Proxy URL (`host:port`).

@see HTTP::Client

proxy_host[RW]

@return [String]

Hostname or IP address of the HTTP proxy server to use.

@see HTTP::Client

proxy_password[RW]

@return [String]

Proxy password to use.

@see HTTP::Client

proxy_port[RW]

@return [Integer]

Port of the HTTP proxy server.

@see HTTP::Client

proxy_type[RW]

@note Default is ‘auto`.

@return [String]

HTTP proxy type.

@see PROXY_TYPES @see HTTP::Client

proxy_username[RW]

@return [String]

Proxy username to use.

@see HTTP::Client

request_concurrency[RW]

@note Default is ‘20`.

@return [Integer]

Maximum HTTP {HTTP::Request request} concurrency. Be careful not to set
this too high or you may kill the server.

@see HTTP::Request @see HTTP::Client#max_concurrency= @see HTTP::Client#max_concurrency

request_headers[RW]

@return [Hash<String, String>]

Extra HTTP headers to be included in every HTTP Request

@see HTTP::Client#headers

request_queue_size[RW]

@note Default is ‘500`.

@return [Integer]

Maximum amount of {HTTP::Request requests} to keep in the
{HTTP::Client client} queue.

More means better scheduling and better performance, less means
less RAM consumption.

@see HTTP::Request @see HTTP::Client

request_redirect_limit[RW]

@note Default is ‘5’.

@return [Integer]

Amount of redirects to follow when performing HTTP
{HTTP::Request requests}.

@see HTTP::Request

request_timeout[RW]

@note Default is ‘50_000’.

@return [Integer]

HTTP {HTTP::Request request} timeout in milliseconds.

@see HTTP::Request @see HTTP::Client

response_max_size[RW]

@return [Integer]

Maximum HTTP {Arachni::HTTP::Response response} body size. If a
{Arachni::HTTP::Response#body} is larger than specified it will not be retrieved.

@see HTTP::Response

ssl_ca_directory[RW]

@return [String]

Directory holding multiple certificate files with which to
{#ssl_verify_peer verify the peer}.
ssl_ca_filepath[RW]

@return [String]

File holding one or more certificates with which to
{#ssl_verify_peer verify the peer}.
ssl_certificate_filepath[RW]

@return [String]

Path to an SSL certificate.
ssl_certificate_type[RW]

@return [String]

Type of the certificate at {#ssl_certificate_filepath}.

@see SSL_CERTIFICATE_TYPES

ssl_key_filepath[RW]

@return [String]

Path to an SSL private key.
ssl_key_password[RW]

@return [String]

Password for the key at {#ssl_key_filepath}.
ssl_key_type[RW]

@return [String]

Type of the key at {#ssl_key_filepath}.

@see SSL_KEY_TYPES

ssl_verify_host[RW]

@note Default is ‘false’.

@return [Bool]

SSL host verification.
ssl_verify_peer[RW]

@note Default is ‘false’.

@return [Bool]

SSL peer verification.
ssl_version[RW]

@return [String]

SSL version to use.

@see SSL_VERSIONS

user_agent[RW]

@note Default is “Arachni/v#{Arachni::VERSION}”.

@return [String]

HTTP User-Agent to use.

@see HTTP::Client

Public Instance Methods

authentication_type=( type ) click to toggle source

@param [String] type

One of {AUTHENTICATION_TYPES}.

@raise Error::InvalidAuthenticationType

# File lib/arachni/option_groups/http.rb, line 269
def authentication_type=( type )
    return @authentication_type = defaults[:authentication_type].dup if !type

    if !AUTHENTICATION_TYPES.include?( type.to_s )
        fail Error::InvalidAuthenticationType,
             "Invalid authentication type: #{type} (supported: #{AUTHENTICATION_TYPES.join(', ')})"
    end

    @authentication_type = type
end
proxy_type=( type ) click to toggle source

@param [String] type

One of {PROXY_TYPES}.

@raise Error::InvalidProxyType

# File lib/arachni/option_groups/http.rb, line 284
def proxy_type=( type )
    if !PROXY_TYPES.include?( type.to_s )
        fail Error::InvalidProxyType,
             "Invalid proxy type: #{type} (supported: #{PROXY_TYPES.join(', ')})"
    end

    @proxy_type = type
end
ssl_certificate_type=( type ) click to toggle source

@param [String] type

One of {SSL_CERTIFICATE_TYPES}.

@raise Error::InvalidSSLCertificateType

# File lib/arachni/option_groups/http.rb, line 297
def ssl_certificate_type=( type )
    if !SSL_CERTIFICATE_TYPES.include?( type.to_s )
        fail Error::InvalidSSLCertificateType,
             "Invalid SSL certificate type: #{type} (supported: #{SSL_CERTIFICATE_TYPES.join(', ')})"
    end

    @ssl_certificate_type = type
end
ssl_key_type=( type ) click to toggle source

@param [String] type

One of {SSL_KEY_TYPES}.

@raise Error::InvalidSSLKeyType

# File lib/arachni/option_groups/http.rb, line 310
def ssl_key_type=( type )
    if !SSL_KEY_TYPES.include?( type.to_s )
        fail Error::InvalidSSLKeyType,
             "Invalid SSL key type: #{type} (supported: #{SSL_KEY_TYPES.join(', ')})"
    end

    @ssl_key_type = type
end
ssl_version=( version ) click to toggle source

@param [String] version

One of {SSL_VERSIONS}.

@raise Error::InvalidSSLVersion

# File lib/arachni/option_groups/http.rb, line 323
def ssl_version=( version )
    if !SSL_VERSIONS.include?( version.to_s )
        fail Error::InvalidSSLVersion,
             "Invalid SSL version: #{version} (supported: #{SSL_VERSIONS.join(', ')})"
    end

    @ssl_version = version
end
to_rpc_data() click to toggle source
Calls superclass method Arachni::OptionGroup#to_rpc_data
# File lib/arachni/option_groups/http.rb, line 332
def to_rpc_data
    d = super
    d.delete 'cookie_jar_filepath'
    d
end