Skip to content

Commit 3c2a33a

Browse files
committed
Allow new password to be specified as an option
1 parent a013dbf commit 3c2a33a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

modules/auxiliary/gather/bmc_trackit_passwd_reset.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def initialize(info = {})
3535
[
3636
OptString.new('TARGETURI', [true, 'The path to BMC TrackIt!', '/']),
3737
OptString.new('LOCALUSER', [true, 'The local user to change password for', 'Administrator']),
38+
OptString.new('LOCALPASS', [false, 'The password to set for the local user (blank for random)', '']),
3839
OptString.new('DOMAIN', [false, 'The domain of the user. By default the local user\'s computer name will be autodetected', ''])
3940
], self.class)
4041
end
@@ -142,7 +143,13 @@ def run_host(ip)
142143
end
143144

144145
vprint_status("#{peer}: changing password for #{full_user}")
145-
password = Rex::Text.rand_text_alpha(10) + "!1"
146+
147+
if datastore['LOCALPASS'].blank?
148+
password = Rex::Text.rand_text_alpha(10) + "!1"
149+
else
150+
password = datastore['LOCALPASS']
151+
end
152+
146153
res = send_request_cgi(
147154
'uri' => normalize_uri(target_uri.path, 'PasswordReset', 'Application', 'ResetPassword'),
148155
'method' => 'POST',

0 commit comments

Comments
 (0)