Skip to content

Option Reference

These are the main options accepted by send_request_cgi / request_cgi. The sources are Rex::Proto::Http::Client#request_raw / #request_cgi and HttpClient itself.

KeyTypeMeaningTypical default
methodStringHTTP methodGET
uriStringPathEffectively required
versionStringHTTP version1.1
protoStringProtocol nameHTTP
vhostStringHost headerdatastore VHOST / rhost
rhostStringOverride connection hostdatastore
rportIntegerOverride connection portdatastore
SSLBoolOverride TLS settingdatastore
agentStringUser-Agentdatastore UserAgent
connectionStringConnection header
encodeBoolEncode the URI itselffalse
partialBoolReturn incomplete responses toofalse
KeyTypeMeaning
vars_getHashQuery parameters
vars_postHashForm POST parameters
vars_form_dataArray<Hash>Multipart field array
vars_form_data_boundaryStringMultipart boundary (normally automatic)
queryStringRaw query string (alternative to vars_get)
dataStringRaw body
ctypeStringContent-Type
encode_paramsBoolURI-encode GET / POST parameters (defaults to true)
KeyTypeMeaning
headersHashAdditional headers
raw_headersStringRaw header string
authorizationStringAuthorization header value
cookieString / HttpCookieJarCookie header
keep_cookiesBoolAdd Set-Cookie values to the cookie jar
expire_cookiesBoolRemove expired entries from the cookie jar before use (enabled by default; disable with false)
username / passwordStringClient authentication credentials (on connection)
preferred_authStringBasic / Digest / NTLM / Kerberos / Negotiate / None

These take effect as module options rather than entries in the request Hash.

OptionEffect
HttpUsername / HttpPasswordUser credentials for the connection
HttpClientTimeoutTimeout in seconds
HttpTrace / HttpTraceHeadersOnlyDebug output
HttpRawHeadersExtra headers file using an ERB template
UserAgentDefault User-Agent
DOMAINNTLM / Kerberos
HTTP::AuthAuthentication method
HTTP::uri_encode_mode and othersEvasion settings
send_request_cgi(
'method' => 'GET',
'uri' => '/',
'vars_get' => { 'a' => '1' },
'headers' => { 'Accept' => 'text/plain' },
'vhost' => 'app.htb'
)