traffic_packets: add trailing $ to fix packet_rpc_netlogon_30
authorJoe Guo <joeg@catalyst.net.nz>
Tue, 1 May 2018 05:15:09 +0000 (17:15 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 12 May 2018 00:09:29 +0000 (02:09 +0200)
For `NetrServerPasswordSet2`, the 2nd arg `account_name` must end with a
$, otherwise windows will return an `Access Denied` error.

Use `creds.get_username()` instead of `creds.get_workstation()` to
include the trailing $.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
python/samba/emulate/traffic_packets.py

index d39151fcdaacfcfe150166fa7e8e95b40ecca38a..d23a7669ad9e9cc683acfea60ebcbf572a2458ea 100644 (file)
@@ -564,7 +564,9 @@ def packet_rpc_netlogon_30(packet, conversation, context):
     pwd.data = filler + [ord(x) for x in newpass]
     context.machine_creds.encrypt_netr_crypt_password(pwd)
     c.netr_ServerPasswordSet2(context.server,
-                              context.machine_creds.get_workstation(),
+                              # must ends with $, so use get_username instead
+                              # of get_workstation here
+                              context.machine_creds.get_username(),
                               SEC_CHAN_WKSTA,
                               context.netbios_name,
                               auth,