# This module provides methods for acting as an HTTP client when
# exploiting an HTTP server.
#
###
moduleExploit::Remote::HttpClient
includeMsf::Auxiliary::Report
#
# Initializes an exploit module that exploits a vulnerability in an HTTP
# server.
#
definitialize(info={})
super
register_options(
[
Opt::RHOST,
Opt::RPORT(80),
OptString.new('VHOST',[false,"HTTP server virtual host"]),
Opt::Proxies
],self.class
)
register_advanced_options(
[
OptString.new('UserAgent',[false,'The User-Agent header to use for all requests']),
OptString.new('BasicAuthUser',[false,'The HTTP username to specify for basic authentication']),
OptString.new('BasicAuthPass',[false,'The HTTP password to specify for basic authentication']),
OptBool.new('SSL',[false,'Negotiate SSL for outgoing connections',false]),
OptEnum.new('SSLVersion',[false,'Specify the version of SSL that should be used','SSL3',['SSL2','SSL3','TLS1']]),
OptBool.new('FingerprintCheck',[false,'Conduct a pre-exploit fingerprint verification',true])
],self.class
)
register_evasion_options(
[
OptEnum.new('HTTP::uri_encode_mode',[false,'Enable URI encoding','hex-normal',['none','hex-normal','hex-all','hex-random','u-normal','u-all','u-random']]),
OptBool.new('HTTP::uri_full_url',[false,'Use the full URL for all HTTP requests',false]),
OptInt.new('HTTP::pad_method_uri_count',[false,'How many whitespace characters to use between the method and uri',1]),
OptInt.new('HTTP::pad_uri_version_count',[false,'How many whitespace characters to use between the uri and version',1]),
OptEnum.new('HTTP::pad_method_uri_type',[false,'What type of whitespace to use between the method and uri','space',['space','tab','apache']]),
OptEnum.new('HTTP::pad_uri_version_type',[false,'What type of whitespace to use between the uri and version','space',['space','tab','apache']]),
OptBool.new('HTTP::method_random_valid',[false,'Use a random, but valid, HTTP method for request',false]),
OptBool.new('HTTP::method_random_invalid',[false,'Use a random invalid, HTTP method for request',false]),
OptBool.new('HTTP::method_random_case',[false,'Use random casing for the HTTP method',false]),
OptBool.new('HTTP::uri_dir_self_reference',[false,'Insert self-referential directories into the uri',false]),
OptBool.new('HTTP::uri_dir_fake_relative',[false,'Insert fake relative directories into the uri',false]),
OptBool.new('HTTP::uri_use_backslashes',[false,'Use back slashes instead of forward slashes in the uri ',false]),
OptBool.new('HTTP::pad_fake_headers',[false,'Insert random, fake headers into the HTTP request',false]),
OptInt.new('HTTP::pad_fake_headers_count',[false,'How many fake headers to insert into the HTTP request',0]),
OptBool.new('HTTP::pad_get_params',[false,'Insert random, fake query string variables into the request',false]),
OptInt.new('HTTP::pad_get_params_count',[false,'How many fake query string variables to insert into the request',16]),
OptBool.new('HTTP::pad_post_params',[false,'Insert random, fake post variables into the request',false]),
OptInt.new('HTTP::pad_post_params_count',[false,'How many fake post variables to insert into the request',16]),
OptBool.new('HTTP::uri_fake_end',[false,'Add a fake end of URI (eg: /%20HTTP/1.0/../../)',false]),
OptBool.new('HTTP::uri_fake_params_start',[false,'Add a fake start of params to the URI (eg: /%3fa=b/../)',false]),
OptBool.new('HTTP::header_folding',[false,'Enable folding of HTTP headers',false])
#
# Remaining evasions to implement
#
# OptBool.new('HTTP::chunked', [false, 'Enable chunking of HTTP request via "Transfer-Encoding: chunked"', 'false']),
# OptInt.new('HTTP::junk_pipeline', [true, 'Insert the specified number of junk pipeline requests', 0]),