Skip to content

Commit 28427cc

Browse files
David MaloneyDavid Maloney
authored andcommitted
add VHOST and useragent support to loginscanner
1 parent 152ddb2 commit 28427cc

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

lib/metasploit/framework/login_scanner/axis2.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ def attempt_login(credential)
2020
host, port, {}, ssl, ssl_version
2121
)
2222

23+
http_client = config_client(http_client)
24+
2325
result_opts = {
2426
credential: credential,
2527
host: host,

lib/metasploit/framework/login_scanner/http.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ class HTTP
2929
# @return [String] HTTP method, e.g. "GET", "POST"
3030
attr_accessor :method
3131

32+
# @!attribute user_agent
33+
# @return [String] the User-Agent to use for the HTTP requests
34+
attr_accessor :user_agent
35+
36+
# @!attribute vhost
37+
# @return [String] the Virtual Host name for the target Web Server
38+
attr_accessor :vhost
39+
40+
3241
validates :uri, presence: true, length: { minimum: 1 }
3342

3443
validates :method,
@@ -62,6 +71,9 @@ def attempt_login(credential)
6271
host, port, {}, ssl, ssl_version,
6372
nil, credential.public, credential.private
6473
)
74+
75+
http_client = config_client(http_client)
76+
6577
if credential.realm
6678
http_client.set_config('domain' => credential.realm)
6779
end
@@ -99,6 +111,14 @@ def attempt_login(credential)
99111

100112
private
101113

114+
def config_client(client)
115+
client.set_config(
116+
'vhost' => vhost || host,
117+
'agent' => user_agent
118+
)
119+
client
120+
end
121+
102122
# This method sets the sane defaults for things
103123
# like timeouts and TCP evasion options
104124
def set_sane_defaults

lib/metasploit/framework/login_scanner/ipboard.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ def attempt_login(credential)
1313
host, port, {}, ssl, ssl_version
1414
)
1515

16+
http_client = config_client(http_client)
17+
1618
result_opts = {
1719
credential: credential,
1820
host: host,

0 commit comments

Comments
 (0)