You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fail_with(Msf::Exploit::Failure::BadConfig,'The Smb::Rhostname option is required when using Kerberos authentication.')ifdatastore['Smb::Rhostname'].blank?
157
166
fail_with(Msf::Exploit::Failure::BadConfig,'The SMBDomain option is required when using Kerberos authentication.')ifdatastore['SMBDomain'].blank?
Copy file name to clipboardExpand all lines: modules/auxiliary/admin/smb/change_password.rb
+56-11Lines changed: 56 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,8 @@ def initialize(info = {})
34
34
'Actions'=>[
35
35
['RESET',{'Description'=>"Reset the target's password without knowing the existing one (requires appropriate permissions)"}],
36
36
['RESET_NTLM',{'Description'=>"Reset the target's NTLM hash, without knowing the existing password. This will not update kerberos keys."}],
37
-
['CHANGE',{'Description'=>'Change the password, knowing the existing one.'}]
37
+
['CHANGE',{'Description'=>'Change the password, knowing the existing one.'}],
38
+
['CHANGE_NTLM',{'Description'=>'Change the password to a NTLM hash value, knowing the existing password. Can be either an NT hash or a colon-delimited NTLM hash'}]
38
39
],
39
40
'DefaultAction'=>'RESET'
40
41
)
@@ -43,8 +44,8 @@ def initialize(info = {})
43
44
register_options(
44
45
[
45
46
OptString.new('NEW_PASSWORD',[false,'The new password to change to','']),
46
-
OptString.new('TARGET_USER',[false,'The user to change the password of. If not provided, will change for the account provided in SMBUser',''],conditions: ['ACTION','in',%w[RESETRESET_NTLM]]),
47
-
OptString.new('NEW_NTLM',[false,'The new NTLM hash to change to',''])
47
+
OptString.new('NEW_NTLM',[false,'The new NTLM hash to change to','']),
48
+
OptString.new('TARGET_USER',[false,'The user to change the password of. If not provided, will change for the account provided in SMBUser'],conditions: ['ACTION','in',%w[RESETRESET_NTLM]])
48
49
]
49
50
)
50
51
end
@@ -68,13 +69,17 @@ def connect_samr
68
69
end
69
70
70
71
defrun
72
+
fail_with('Must set NEW_PASSWORD on NEW_NTLM')ifdatastore['NEW_PASSWORD'].blank? && datastore['NEW_NTLM'].blank?
73
+
71
74
caseaction.name
72
75
when'CHANGE'
73
76
run_change
74
77
when'RESET'
75
78
run_reset
76
79
when'RESET_NTLM'
77
80
run_reset_ntlm
81
+
when'CHANGE_NTLM'
82
+
run_change_ntlm
78
83
end
79
84
80
85
# Don't disconnect the client if it's coming from the session so it can be reused
0 commit comments