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 socks4a socks5 socks5h)
AUTHENTICATION_TYPES =

Returns Supported HTTP authentication types.

Returns:

  • (Array<String>)

    Supported HTTP authentication types.

%w(auto basic digest digest_ie negotiate ntlm)
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, #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:


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

def authentication_password
  @authentication_password
end

#authentication_typeString

Note:

Default is auto.

Returns Authentication type.

Returns:

  • (String)

    Authentication type

See Also:


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

def authentication_type
  @authentication_type
end

#authentication_usernameString

Returns Username to use for HTTP authentication.

Returns:

  • (String)

    Username to use for HTTP authentication.

See Also:


106
107
108
# File 'lib/arachni/option_groups/http.rb', line 106

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:


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

def cookie_jar_filepath
  @cookie_jar_filepath
end

Returns Cookies in the form of a Set-Cookie response header: name2=value2; Expires=Wed, 09 Jun 2021 10:18:14 GMT.

Returns:

  • (String)

    Cookies in the form of a Set-Cookie response header: name2=value2; Expires=Wed, 09 Jun 2021 10:18:14 GMT


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

def cookie_string
  @cookie_string
end

#cookiesHash

Returns Cookies as name=>value pairs.

Returns:

  • (Hash)

    Cookies as name=>value pairs.

See Also:


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

def cookies
  @cookies
end

#proxyString

Returns Proxy URL (host:port).

Returns:

  • (String)

    Proxy URL (host:port).

See Also:


166
167
168
# File 'lib/arachni/option_groups/http.rb', line 166

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:


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

def proxy_host
  @proxy_host
end

#proxy_passwordString

Returns Proxy password to use.

Returns:

  • (String)

    Proxy password to use.

See Also:


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

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:


139
140
141
# File 'lib/arachni/option_groups/http.rb', line 139

def proxy_port
  @proxy_port
end

#proxy_typeString

Note:

Default is auto.

Returns HTTP proxy type.

Returns:

  • (String)

    HTTP proxy type.

See Also:


160
161
162
# File 'lib/arachni/option_groups/http.rb', line 160

def proxy_type
  @proxy_type
end

#proxy_usernameString

Returns Proxy username to use.

Returns:

  • (String)

    Proxy username to use.

See Also:


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

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

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

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

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

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:


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

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:


67
68
69
# File 'lib/arachni/option_groups/http.rb', line 67

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:


100
101
102
# File 'lib/arachni/option_groups/http.rb', line 100

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:


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

def response_max_size
  @response_max_size
end

#ssl_ca_directoryString

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

Returns:


245
246
247
# File 'lib/arachni/option_groups/http.rb', line 245

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:


240
241
242
# File 'lib/arachni/option_groups/http.rb', line 240

def ssl_ca_filepath
  @ssl_ca_filepath
end

#ssl_certificate_filepathString

Returns Path to an SSL certificate.

Returns:

  • (String)

    Path to an SSL certificate.


215
216
217
# File 'lib/arachni/option_groups/http.rb', line 215

def ssl_certificate_filepath
  @ssl_certificate_filepath
end

#ssl_certificate_typeString

Returns Type of the certificate at #ssl_certificate_filepath.

Returns:

See Also:


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

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.


225
226
227
# File 'lib/arachni/option_groups/http.rb', line 225

def ssl_key_filepath
  @ssl_key_filepath
end

#ssl_key_passwordString

Returns Password for the key at #ssl_key_filepath.

Returns:


235
236
237
# File 'lib/arachni/option_groups/http.rb', line 235

def ssl_key_password
  @ssl_key_password
end

#ssl_key_typeString

Returns Type of the key at #ssl_key_filepath.

Returns:

See Also:


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

def ssl_key_type
  @ssl_key_type
end

#ssl_verify_hostBool

Note:

Default is 'false'.

Returns SSL host verification.

Returns:

  • (Bool)

    SSL host verification.


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

def ssl_verify_host
  @ssl_verify_host
end

#ssl_verify_peerBool

Note:

Default is 'false'.

Returns SSL peer verification.

Returns:

  • (Bool)

    SSL peer verification.


205
206
207
# File 'lib/arachni/option_groups/http.rb', line 205

def ssl_verify_peer
  @ssl_verify_peer
end

#ssl_versionString

Returns SSL version to use.

Returns:

  • (String)

    SSL version to use.

See Also:


251
252
253
# File 'lib/arachni/option_groups/http.rb', line 251

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:


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

def user_agent
  @user_agent
end

Instance Method Details

#to_rpc_dataObject


332
333
334
335
336
# File 'lib/arachni/option_groups/http.rb', line 332

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