add VHOST and useragent support to loginscanner

bug/bundler_fix
David Maloney 2014-09-04 10:59:07 -05:00
parent 152ddb2f32
commit 28427ccee3
No known key found for this signature in database
GPG Key ID: DEDBA9DC3A913DB2
3 changed files with 24 additions and 0 deletions

View File

@ -20,6 +20,8 @@ module Metasploit
host, port, {}, ssl, ssl_version
)
http_client = config_client(http_client)
result_opts = {
credential: credential,
host: host,

View File

@ -29,6 +29,15 @@ module Metasploit
# @return [String] HTTP method, e.g. "GET", "POST"
attr_accessor :method
# @!attribute user_agent
# @return [String] the User-Agent to use for the HTTP requests
attr_accessor :user_agent
# @!attribute vhost
# @return [String] the Virtual Host name for the target Web Server
attr_accessor :vhost
validates :uri, presence: true, length: { minimum: 1 }
validates :method,
@ -62,6 +71,9 @@ module Metasploit
host, port, {}, ssl, ssl_version,
nil, credential.public, credential.private
)
http_client = config_client(http_client)
if credential.realm
http_client.set_config('domain' => credential.realm)
end
@ -99,6 +111,14 @@ module Metasploit
private
def config_client(client)
client.set_config(
'vhost' => vhost || host,
'agent' => user_agent
)
client
end
# This method sets the sane defaults for things
# like timeouts and TCP evasion options
def set_sane_defaults

View File

@ -13,6 +13,8 @@ module Metasploit
host, port, {}, ssl, ssl_version
)
http_client = config_client(http_client)
result_opts = {
credential: credential,
host: host,