Skip to content

Commit 132f604

Browse files
committed
Autodetect DC from realm for /changepw
Make /changepw use the user realm when autodetecting the DC.
1 parent bec0e35 commit 132f604

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Rubeus/lib/Reset.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ public static void UserPassword(KRB_CRED kirbi, string newPassword, string domai
2828
// KRB-PRIV structure containing ChangePasswdData, enc w/ the sub session key
2929
// reference: Microsoft Windows 2000 Kerberos Change Password and Set Password Protocols (RFC3244)
3030

31-
string dcIP = Networking.GetDCIP(domainController);
32-
if (String.IsNullOrEmpty(dcIP)) { return; }
33-
3431
// extract the user and domain from the existing .kirbi ticket
3532
string userName = kirbi.enc_part.ticket_info[0].pname.name_string[0];
3633
string userDomain = kirbi.enc_part.ticket_info[0].prealm;
3734

35+
string dcIP = Networking.GetDCIP(domainController, false, userDomain);
36+
if (String.IsNullOrEmpty(dcIP)) { return; }
37+
3838
if (targetUser == null) {
3939
Console.WriteLine("[*] Changing password for user: {0}@{1}", userName, userDomain);
4040
} else {

0 commit comments

Comments
 (0)