Class: Arachni::OptionGroups::HTTP

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

Overview

Holds HTTP related options.

Author:

Defined Under Namespace

Classes: Error

Constant Summary collapse

PROXY_TYPES =

Returns Supported proxy types.

Returns:

%w(http http_1_0 socks4 socks5 socks4a)
SSL_CERTIFICATE_TYPES =

Returns Supported SSL certificate types.

Returns:

%w(pem der)
SSL_KEY_TYPES =

Returns Supported SSL private key types.

Returns:

SSL_CERTIFICATE_TYPES
SSL_VERSIONS =

Returns Supported SSL versions.

Returns:

%w(TLSv1 TLSv1_0 TLSv1_1 TLSv1_2 SSLv2 SSLv3)

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:



104
105
106
# File 'lib/arachni/option_groups/http.rb', line 104

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:



98
99
100
# File 'lib/arachni/option_groups/http.rb', line 98

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:



164
165
166
# File 'lib/arachni/option_groups/http.rb', line 164

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`
      


172
173
174
# File 'lib/arachni/option_groups/http.rb', line 172

def cookie_string
  @cookie_string
end

#cookiesHash

Returns Cookies as ‘name=>value` pairs.

Returns:

  • (Hash)

    Cookies as ‘name=>value` pairs.

See Also:



157
158
159
# File 'lib/arachni/option_groups/http.rb', line 157

def cookies
  @cookies
end

#proxyString

Returns Proxy URL (‘host:port`).

Returns:

  • (String)

    Proxy URL (‘host:port`).

See Also:



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

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:



117
118
119
# File 'lib/arachni/option_groups/http.rb', line 117

def proxy_host
  @proxy_host
end

#proxy_passwordString

Returns Proxy password to use.

Returns:

  • (String)

    Proxy password to use.

See Also:



135
136
137
# File 'lib/arachni/option_groups/http.rb', line 135

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:



123
124
125
# File 'lib/arachni/option_groups/http.rb', line 123

def proxy_port
  @proxy_port
end

#proxy_typeString

Note:

Default is ‘auto`.

Returns HTTP proxy type.

Returns:

  • (String)

    HTTP proxy type.

See Also:



144
145
146
# File 'lib/arachni/option_groups/http.rb', line 144

def proxy_type
  @proxy_type
end

#proxy_usernameString

Returns Proxy username to use.

Returns:

  • (String)

    Proxy username to use.

See Also:



129
130
131
# File 'lib/arachni/option_groups/http.rb', line 129

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


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

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


186
187
188
# File 'lib/arachni/option_groups/http.rb', line 186

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:



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

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:



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

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:



92
93
94
# File 'lib/arachni/option_groups/http.rb', line 92

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:



111
112
113
# File 'lib/arachni/option_groups/http.rb', line 111

def response_max_size
  @response_max_size
end

#ssl_ca_directoryString

Returns Directory holding multiple certificate files with which to verify the peer.

Returns:



232
233
234
# File 'lib/arachni/option_groups/http.rb', line 232

def ssl_ca_directory
  @ssl_ca_directory
end

#ssl_ca_filepathString

Returns File holding one or more certificates with which to verify the peer.

Returns:



227
228
229
# File 'lib/arachni/option_groups/http.rb', line 227

def ssl_ca_filepath
  @ssl_ca_filepath
end

#ssl_certificate_filepathString

Returns Path to an SSL certificate.

Returns:

  • (String)

    Path to an SSL certificate.



202
203
204
# File 'lib/arachni/option_groups/http.rb', line 202

def ssl_certificate_filepath
  @ssl_certificate_filepath
end

#ssl_certificate_typeString

Returns Type of the certificate at #ssl_certificate_filepath.

Returns:

See Also:



208
209
210
# File 'lib/arachni/option_groups/http.rb', line 208

def ssl_certificate_type
  @ssl_certificate_type
end

#ssl_key_filepathString

Returns Path to an SSL private key.

Returns:

  • (String)

    Path to an SSL private key.



212
213
214
# File 'lib/arachni/option_groups/http.rb', line 212

def ssl_key_filepath
  @ssl_key_filepath
end

#ssl_key_passwordString

Returns Password for the key at #ssl_key_filepath.

Returns:



222
223
224
# File 'lib/arachni/option_groups/http.rb', line 222

def ssl_key_password
  @ssl_key_password
end

#ssl_key_typeString

Returns Type of the key at #ssl_key_filepath.

Returns:

See Also:



218
219
220
# File 'lib/arachni/option_groups/http.rb', line 218

def ssl_key_type
  @ssl_key_type
end

#ssl_verify_hostBool

Note:

Default is ‘false’.

Returns SSL host verification.

Returns:

  • (Bool)

    SSL host verification.



198
199
200
# File 'lib/arachni/option_groups/http.rb', line 198

def ssl_verify_host
  @ssl_verify_host
end

#ssl_verify_peerBool

Note:

Default is ‘false’.

Returns SSL peer verification.

Returns:

  • (Bool)

    SSL peer verification.



192
193
194
# File 'lib/arachni/option_groups/http.rb', line 192

def ssl_verify_peer
  @ssl_verify_peer
end

#ssl_versionString

Returns SSL version to use.

Returns:

  • (String)

    SSL version to use.

See Also:



238
239
240
# File 'lib/arachni/option_groups/http.rb', line 238

def ssl_version
  @ssl_version
end

#user_agentString

Note:

Default is “Arachni/v#VERSION”.

Returns HTTP User-Agent to use.

Returns:

  • (String)

    HTTP User-Agent to use.

See Also:



180
181
182
# File 'lib/arachni/option_groups/http.rb', line 180

def user_agent
  @user_agent
end

Instance Method Details

#to_rpc_dataObject



303
304
305
306
307
# File 'lib/arachni/option_groups/http.rb', line 303

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