Skip to content

Commit 40c237f

Browse files
committed
Fix rapid7#3982, allow URIs to be user configurable
Fix rapid7#3982
1 parent 4097222 commit 40c237f

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

lib/metasploit/framework/login_scanner/smh.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def attempt_login(credential)
2121

2222
req_opts = {
2323
'method' => 'POST',
24-
'uri' => '/proxy/ssllogin',
24+
'uri' => uri,
2525
'vars_post' => {
2626
'redirecturl' => '',
2727
'redirectquerystring' => '',

modules/auxiliary/scanner/http/hp_sys_mgmt_login.rb

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ def initialize(info={})
3232
'PASS_FILE' => File.join(Msf::Config.data_directory, "wordlists", "unix_passwords.txt")
3333
}
3434
))
35+
36+
register_advanced_options([
37+
OptString.new('LOGIN_URL', [true, 'The URL that handles the login process', '/proxy/ssllogin']),
38+
OptString.new('CPQLOGIN', [true, 'The homepage of the login', '/cpqlogin.htm']),
39+
OptString.new('LOGIN_REDIRECT', true, 'The URL to redirect to', '/cpqlogin')
40+
41+
], self.class)
3542
end
3643

3744
def get_version(res)
@@ -78,7 +85,7 @@ def init_loginscanner(ip)
7885
@scanner = Metasploit::Framework::LoginScanner::Smh.new(
7986
host: ip,
8087
port: rport,
81-
uri: datastore['URI'],
88+
uri: datastore['LOGIN_URL'],
8289
proxies: datastore["PROXIES"],
8390
cred_details: @cred_collection,
8491
stop_on_success: datastore['STOP_ON_SUCCESS'],
@@ -163,10 +170,10 @@ def bruteforce(ip)
163170

164171
def run_host(ip)
165172
res = send_request_cgi({
166-
'uri' => '/cpqlogin.htm',
173+
'uri' => datastore['CPQLOGIN'],
167174
'method' => 'GET',
168175
'vars_get' => {
169-
'RedirectUrl' => '/cpqlogin',
176+
'RedirectUrl' => datastore['LOGIN_REDIRECT'],
170177
'RedirectQueryString' => ''
171178
}
172179
})

0 commit comments

Comments
 (0)