Class: Arachni::OptionGroups::HTTP

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

Overview

Holds HTTP related options.

Author:

Constant Summary collapse

PROXY_TYPES =

Returns Supported proxy types.

Returns:

%w(http http_1_0 socks4 socks5 socks4a)

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, #validate

Constructor Details

This class inherits a constructor from Arachni::OptionGroup

Instance Attribute Details

#authentication_passwordString

Returns Password to use for HTTP authentication.

Returns:

  • (String)

    Password to use for HTTP authentication.

See Also:



71
72
73
# File 'lib/arachni/option_groups/http.rb', line 71

def authentication_password
  @authentication_password
end

#authentication_usernameString

Returns Username to use for HTTP authentication.

Returns:

  • (String)

    Username to use for HTTP authentication.

See Also:



65
66
67
# File 'lib/arachni/option_groups/http.rb', line 65

def authentication_username
  @authentication_username
end

Returns Location of the Netscape-style cookie-jar file.

Returns:

  • (String)

    Location of the Netscape-style cookie-jar file.

See Also:



133
134
135
# File 'lib/arachni/option_groups/http.rb', line 133

def cookie_jar_filepath
  @cookie_jar_filepath
end

Returns Cookies in the form of a:

  • Request ‘Cookie` header: `name=value; name2=value2`

  • Response ‘Set-Cookie` header:

    `name2=value2; Expires=Wed, 09 Jun 2021 10:18:14 GMT`.
    

Returns:

  • (String)

    Cookies in the form of a:

    • Request ‘Cookie` header: `name=value; name2=value2`

    • Response ‘Set-Cookie` header:

      `name2=value2; Expires=Wed, 09 Jun 2021 10:18:14 GMT`
      


141
142
143
# File 'lib/arachni/option_groups/http.rb', line 141

def cookie_string
  @cookie_string
end

#cookiesHash

Returns Cookies as ‘name=>value` pairs.

Returns:

  • (Hash)

    Cookies as ‘name=>value` pairs.

See Also:



126
127
128
# File 'lib/arachni/option_groups/http.rb', line 126

def cookies
  @cookies
end

#proxyString

Returns Proxy URL (‘host:port`).

Returns:

  • (String)

    Proxy URL (‘host:port`).

See Also:



119
120
121
# File 'lib/arachni/option_groups/http.rb', line 119

def proxy
  @proxy
end

#proxy_hostString

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

Returns:

  • (String)

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

See Also:



84
85
86
# File 'lib/arachni/option_groups/http.rb', line 84

def proxy_host
  @proxy_host
end

#proxy_passwordString

Returns Proxy password to use.

Returns:

  • (String)

    Proxy password to use.

See Also:



102
103
104
# File 'lib/arachni/option_groups/http.rb', line 102

def proxy_password
  @proxy_password
end

#proxy_portInteger

Returns Port of the HTTP proxy server.

Returns:

  • (Integer)

    Port of the HTTP proxy server.

See Also:



90
91
92
# File 'lib/arachni/option_groups/http.rb', line 90

def proxy_port
  @proxy_port
end

#proxy_typeString

Note:

Default is ‘auto`.

Returns HTTP proxy type, available options are:

  • ‘http`

  • ‘socks`.

Returns:

  • (String)

    HTTP proxy type, available options are:

    • ‘http`

    • ‘socks`

See Also:



113
114
115
# File 'lib/arachni/option_groups/http.rb', line 113

def proxy_type
  @proxy_type
end

#proxy_usernameString

Returns Proxy username to use.

Returns:

  • (String)

    Proxy username to use.

See Also:



96
97
98
# File 'lib/arachni/option_groups/http.rb', line 96

def proxy_username
  @proxy_username
end

#request_concurrencyInteger

Note:

Default is ‘20`.

Returns Maximum HTTP request concurrency. Be careful not to set this too high or you may kill the server.

Returns:

  • (Integer)

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

See Also:

  • HTTP::Request
  • HTTP::Client#max_concurrency=
  • HTTP::Client#max_concurrency


37
38
39
# File 'lib/arachni/option_groups/http.rb', line 37

def request_concurrency
  @request_concurrency
end

#request_headersHash<String, String>

Returns Extra HTTP headers to be included in every HTTP Request.

Returns:

  • (Hash<String, String>)

    Extra HTTP headers to be included in every HTTP Request

See Also:

  • HTTP::Client#headers


155
156
157
# File 'lib/arachni/option_groups/http.rb', line 155

def request_headers
  @request_headers
end

#request_queue_sizeInteger

Note:

Default is ‘500`.

Returns Maximum amount of requests to keep in the client queue.

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

Returns:

  • (Integer)

    Maximum amount of requests to keep in the client queue.

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

See Also:



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

def request_queue_size
  @request_queue_size
end

#request_redirect_limitInteger

Note:

Default is ‘5’.

Returns Amount of redirects to follow when performing HTTP requests.

Returns:

  • (Integer)

    Amount of redirects to follow when performing HTTP requests.

See Also:



26
27
28
# File 'lib/arachni/option_groups/http.rb', line 26

def request_redirect_limit
  @request_redirect_limit
end

#request_timeoutInteger

Note:

Default is ‘50_000’.

Returns HTTP request timeout in milliseconds.

Returns:

  • (Integer)

    HTTP request timeout in milliseconds.

See Also:



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

def request_timeout
  @request_timeout
end

#response_max_sizeInteger

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

Returns:

  • (Integer)

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

See Also:



78
79
80
# File 'lib/arachni/option_groups/http.rb', line 78

def response_max_size
  @response_max_size
end

#user_agentString

Note:

Default is “Arachni/v#VERSION”.

Returns HTTP User-Agent to use.

Returns:

  • (String)

    HTTP User-Agent to use.

See Also:



149
150
151
# File 'lib/arachni/option_groups/http.rb', line 149

def user_agent
  @user_agent
end

Instance Method Details

#to_rpc_dataObject



167
168
169
170
171
# File 'lib/arachni/option_groups/http.rb', line 167

def to_rpc_data
    d = super
    d.delete 'cookie_jar_filepath'
    d
end