예제 #1
0
 public static extern int DsBindWithCred(
     string DomainControllerName,
     string DnsDomainName,
     SafeDsCredentialsHandle AuthIdentity,
     out SafeDsHandle phDS
 );
예제 #2
0
 public static extern int DsMakePasswordCredentials(
     string User,
     string Domain,
     string Password,
     out SafeDsCredentialsHandle pAuthIdentity
 );
예제 #3
0
 private SafeDsHandle Bind(SafeDsCredentialsHandle credential)
 {
     return Bind(_serverName, _domainName, credential);
 }
예제 #4
0
        private static int TryBind(string server, string domain, SafeDsCredentialsHandle credentials, out SafeDsHandle handle)
        {
            if (credentials != null)
            {
                return NativeMethods.DsBindWithCred(server, domain, credentials, out handle);
            }

            return NativeMethods.DsBind(server, domain, out handle);
        }
예제 #5
0
        private static SafeDsHandle Bind(string server, string domain, SafeDsCredentialsHandle credentials)
        {
            SafeDsHandle handle;
            int retval = TryBind(server, domain, credentials, out handle);

            if (retval == NativeMethods.ERROR_INVALID_PARAMETER)
            {
                // HACK: you must specify port number for AD LDS instances, but you MUST NOT
                // specify it when connecting to AD DS domain

                int colon = server.LastIndexOf(':');
                if (colon > -1)
                {
                    server = server.Substring(0, colon);
                }

                retval = TryBind(server, domain, credentials, out handle);
            }

            NativeMethods.EnforceSuccess(retval);

            return handle;
        }
예제 #6
0
파일: DsCrackNames.cs 프로젝트: zyonet/Pscx
 public static extern int DsMakePasswordCredentials(
     string User,
     string Domain,
     string Password,
     out SafeDsCredentialsHandle pAuthIdentity
     );
예제 #7
0
파일: DsCrackNames.cs 프로젝트: zyonet/Pscx
 public static extern int DsBindWithCred(
     string DomainControllerName,
     string DnsDomainName,
     SafeDsCredentialsHandle AuthIdentity,
     out SafeDsHandle phDS
     );