Package jcifs.dcerpc

Examples of jcifs.dcerpc.DcerpcHandle


      NetrLogonSamLogon netrLogonSamLogon = new NetrLogonSamLogon(
        _domainControllerName, _ntlmServiceAccount.getComputerName(),
        netlogonAuthenticator, new NetlogonAuthenticator(), 2,
        netlogonNetworkInfo, 2, new NetlogonValidationSamInfo(), 0);

      DcerpcHandle dcerpcHandle = netlogonConnection.getDcerpcHandle();

      dcerpcHandle.sendrecv(netrLogonSamLogon);

      if (netrLogonSamLogon.getStatus() == 0) {
        NetlogonValidationSamInfo netlogonValidationSamInfo =
          netrLogonSamLogon.getNetlogonValidationSamInfo();
View Full Code Here


        null, ntlmServiceAccount.getAccount(),
        ntlmServiceAccount.getPassword());

    String endpoint = "ncacn_np:" + domainController + "[\\PIPE\\NETLOGON]";

    DcerpcHandle dcerpcHandle = DcerpcHandle.getHandle(
      endpoint, ntlmPasswordAuthentication);

    setDcerpcHandle(dcerpcHandle);

    dcerpcHandle.bind();

    byte[] clientChallenge = new byte[8];

    secureRandom.nextBytes(clientChallenge);

    NetrServerReqChallenge netrServerReqChallenge =
      new NetrServerReqChallenge(
        domainControllerName, ntlmServiceAccount.getComputerName(),
        clientChallenge, new byte[8]);

    dcerpcHandle.sendrecv(netrServerReqChallenge);

    MD4 md4 = new MD4();

    md4.update(ntlmServiceAccount.getPassword().getBytes("UTF-16LE"));

    byte[] sessionKey = computeSessionKey(
      md4.digest(), clientChallenge,
      netrServerReqChallenge.getServerChallenge());

    byte[] clientCredential = computeNetlogonCredential(
      clientChallenge, sessionKey);

    NetrServerAuthenticate3 netrServerAuthenticate3 =
      new NetrServerAuthenticate3(
        domainControllerName, ntlmServiceAccount.getAccountName(), 2,
        ntlmServiceAccount.getComputerName(), clientCredential,
        new byte[8], _negotiateFlags);

    dcerpcHandle.sendrecv(netrServerAuthenticate3);

    byte[] serverCredential = computeNetlogonCredential(
      netrServerReqChallenge.getServerChallenge(), sessionKey);

    if (!Arrays.equals(
View Full Code Here

TOP

Related Classes of jcifs.dcerpc.DcerpcHandle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.