Skip to content

Commit 8c5ff85

Browse files
committed
Land rapid7#4812, hp_sys_mgmt_login configurable URIs
2 parents 1b7e819 + bcfbcb7 commit 8c5ff85

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
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: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ 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+
], self.class)
3541
end
3642

3743
def get_version(res)
@@ -77,7 +83,7 @@ def init_loginscanner(ip)
7783

7884
@scanner = Metasploit::Framework::LoginScanner::Smh.new(
7985
configure_http_login_scanner(
80-
uri: datastore['URI'],
86+
uri: datastore['LOGIN_URL'],
8187
cred_details: @cred_collection,
8288
stop_on_success: datastore['STOP_ON_SUCCESS'],
8389
bruteforce_speed: datastore['BRUTEFORCE_SPEED'],
@@ -157,10 +163,10 @@ def bruteforce(ip)
157163

158164
def run_host(ip)
159165
res = send_request_cgi({
160-
'uri' => '/cpqlogin.htm',
166+
'uri' => datastore['CPQLOGIN'],
161167
'method' => 'GET',
162168
'vars_get' => {
163-
'RedirectUrl' => '/cpqlogin',
169+
'RedirectUrl' => datastore['LOGIN_REDIRECT'],
164170
'RedirectQueryString' => ''
165171
}
166172
})

spec/lib/metasploit/framework/login_scanner/smh_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
before :each do
5656
allow_any_instance_of(Rex::Proto::Http::Client).to receive(:send_recv) do |cli, req|
5757

58-
if req.opts['uri'] && req.opts['uri'].include?('/proxy/ssllogin') &&
58+
if req.opts['uri'] &&
5959
req.opts['vars_post'] &&
6060
req.opts['vars_post']['user'] &&
6161
req.opts['vars_post']['user'] == username &&

0 commit comments

Comments
 (0)