@@ -87,7 +87,6 @@ def on_login(self, context, connection):
8787 target_domain = connection .domain
8888
8989 # If OLDPASS or OLDHASH are not specified, default to the credentials used for authentication.
90-
9190 if not self .oldpass :
9291 self .oldpass = connection .password
9392 if not self .oldhash :
@@ -113,7 +112,7 @@ def on_login(self, context, connection):
113112 self .anonymous = True
114113 self .dce = self .authenticate (context , connection , protocol = "ncacn_ip_tcp" , anonymous = self .anonymous )
115114 elif "STATUS_LOGON_FAILURE" in str (e ):
116- context .log .critical ("Authentication failure: wrong credentials." )
115+ context .log .fail ("Authentication failure: wrong credentials." )
117116 return False
118117 else :
119118 raise
@@ -140,9 +139,7 @@ def _smb_samr_change(self, context, connection, target_username, target_domain,
140139 context .log .success (f"Successfully changed password for { target_username } " )
141140 else :
142141 # Change the password with new password
143- samr .hSamrUnicodeChangePasswordUser2 (
144- self .dce , "\x00 " , target_username , self .oldpass , newPassword , "" , ""
145- )
142+ samr .hSamrUnicodeChangePasswordUser2 (self .dce , "\x00 " , target_username , self .oldpass , newPassword , "" , "" )
146143 context .log .success (f"Successfully changed password for { target_username } " )
147144 else :
148145 # Handle anonymous/null session password change
0 commit comments