*/
-
#ifdef SYSLOG
#undef SYSLOG
#endif
#define DEBUG_TESTING
-extern struct cli_state *smb_cli;
-extern int smb_tidx;
-
extern FILE* out_hnd;
+extern struct cli_state *smb_cli;
+extern int smb_tidx;
/****************************************************************************
nt lsa query
fstring sid;
DEBUG(5,("cmd_lsa_query_info: query succeeded\n"));
- fprintf(out_hnd, "LSA Query Info Policy\n");
+ report(out_hnd, "LSA Query Info Policy\n");
if (info->dom.level3_dom[0] != 0)
{
sid_to_string(sid, &info->dom.level3_sid);
- fprintf(out_hnd, "Domain Member - Domain: %s SID: %s\n",
+ report(out_hnd, "Domain Member - Domain: %s SID: %s\n",
info->dom.level3_dom, sid);
domain_something = True;
}
if (info->dom.level5_dom[0] != 0)
{
sid_to_string(sid, &info->dom.level5_sid);
- fprintf(out_hnd, "Domain Controller - Domain: %s SID: %s\n",
+ report(out_hnd, "Domain Controller - Domain: %s SID: %s\n",
info->dom.level5_dom, sid);
domain_something = True;
}
if (!domain_something)
{
- fprintf(out_hnd, "%s is not a Domain Member or Controller\n",
+ report(out_hnd, "%s is not a Domain Member or Controller\n",
info->dest_host);
}
}
if (num_names == 0)
{
- fprintf(out_hnd, "lookupnames <name> [<name> ...]\n");
+ report(out_hnd, "lookupnames <name> [<name> ...]\n");
return;
}
if (sids != NULL)
{
- fprintf(out_hnd,"Lookup Names:\n");
+ report(out_hnd, "Lookup Names:\n");
for (i = 0; i < num_sids; i++)
{
sid_to_string(temp, &sids[i]);
- fprintf(out_hnd, "SID: %s -> %s\n", names[i], temp);
+ report(out_hnd, "SID: %s -> %s\n", names[i], temp);
#if 0
if (sids[i] != NULL)
{
if (sid_name[0] == 0)
{
- fprintf(out_hnd, "please use lsaquery first or specify a complete SID\n");
+ report(out_hnd, "please use lsaquery first or specify a complete SID\n");
return;
}
if (num_sids == 0)
{
- fprintf(out_hnd, "lookupsid RID or SID\n");
+ report(out_hnd, "lookupsid RID or SID\n");
return;
}
}
if (names != NULL)
{
- fprintf(out_hnd,"Lookup SIDS:\n");
+ report(out_hnd, "Lookup SIDS:\n");
for (i = 0; i < num_names; i++)
{
sid_to_string(temp, sids[i]);
- fprintf(out_hnd, "SID: %s -> %s\n", temp, names[i]);
+ report(out_hnd, "SID: %s -> %s\n", temp, names[i]);
if (names[i] != NULL)
{
free(names[i]);
if (!next_token(NULL, secret_name, NULL, sizeof(secret_name)))
{
- fprintf(out_hnd, "querysecret <secret name>\n");
+ report(out_hnd, "querysecret <secret name>\n");
return;
}
/* lookup domain controller; receive a policy handle */
res1 = res ? lsa_open_secret(smb_cli, nt_pipe_fnum,
&info->dom.lsa_info_pol,
- secret_name, 0x20003, &hnd_secret) : False;
+ secret_name, 0xf003f, &hnd_secret) : False;
res2 = res1 ? lsa_query_secret(smb_cli, nt_pipe_fnum,
&hnd_secret, &enc_secret, &last_update) : False;
if (res2 && nt_decrypt_string2(&secret, &enc_secret, smb_cli->pwd.smb_nt_pwd))
{
- fprintf(out_hnd, "\tValue : ");
+ report(out_hnd, "\tValue : ");
for (i = 0; i < secret.str_str_len; i++)
{
- fprintf(out_hnd, "%02X", secret.buffer[i]);
+ report(out_hnd, "%02X", secret.buffer[i]);
}
- fprintf(out_hnd, "\n\tLast Updated: %s\n\n",
+ report(out_hnd, "\n\tLast Updated: %s\n\n",
http_timestring(nt_time_to_unix(&last_update)));
}
else
{
- fprintf(out_hnd, "LSA Query Secret: failed\n");
+ report(out_hnd, "LSA Query Secret: failed\n");
}
}