diff options
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r-- | source4/torture/rpc/netlogon.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c index 6ea51a9253..0f22b1a44b 100644 --- a/source4/torture/rpc/netlogon.c +++ b/source4/torture/rpc/netlogon.c @@ -32,6 +32,8 @@ static BOOL test_LogonUasLogon(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) r.in.username = lp_parm_string(-1, "torture", "username"); r.in.workstation = lp_netbios_name(); + printf("Testing LogonUasLogon"); + status = dcerpc_netr_LogonUasLogon(p, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { printf("LogonUasLogon - %s\n", nt_errstr(status)); @@ -42,6 +44,54 @@ static BOOL test_LogonUasLogon(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) } +static BOOL test_LogonUasLogoff(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) +{ + NTSTATUS status; + struct netr_LogonUasLogoff r; + + r.in.server_name = NULL; + r.in.username = lp_parm_string(-1, "torture", "username"); + r.in.workstation = lp_netbios_name(); + + printf("Testing LogonUasLogoff"); + + status = dcerpc_netr_LogonUasLogoff(p, mem_ctx, &r); + if (!NT_STATUS_IS_OK(status)) { + printf("LogonUasLogoff - %s\n", nt_errstr(status)); + return False; + } + + return True; + +} + +static BOOL test_Challenge(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) +{ + NTSTATUS status; + struct netr_ServerReqChallenge r; + struct netr_Credential creds; + + printf("Testing ServerReqChallenge"); + + ZERO_STRUCT(creds); + + generate_random_buffer(creds.cred, sizeof(creds.cred), False); + + r.in.server_name = NULL; + r.in.computer_name = lp_netbios_name(); + r.in.credential = &creds; + r.out.credential = &creds; + + status = dcerpc_netr_ServerReqChallenge(p, mem_ctx, &r); + if (!NT_STATUS_IS_OK(status)) { + printf("ServerReqChallenge - %s\n", nt_errstr(status)); + return False; + } + + return True; + +} + BOOL torture_rpc_netlogon(int dummy) { @@ -66,6 +116,14 @@ BOOL torture_rpc_netlogon(int dummy) ret = False; } + if (!test_LogonUasLogoff(p, mem_ctx)) { + ret = False; + } + + if (!test_Challenge(p, mem_ctx)) { + ret = False; + } + torture_rpc_close(p); return ret; |