add VHOST and useragent support to loginscanner
parent
152ddb2f32
commit
28427ccee3
|
@ -20,6 +20,8 @@ module Metasploit
|
|||
host, port, {}, ssl, ssl_version
|
||||
)
|
||||
|
||||
http_client = config_client(http_client)
|
||||
|
||||
result_opts = {
|
||||
credential: credential,
|
||||
host: host,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -13,6 +13,8 @@ module Metasploit
|
|||
host, port, {}, ssl, ssl_version
|
||||
)
|
||||
|
||||
http_client = config_client(http_client)
|
||||
|
||||
result_opts = {
|
||||
credential: credential,
|
||||
host: host,
|
||||
|
|
Loading…
Reference in New Issue