rapid7 / smbj-rpc

Created by Paul Miseiko via the GitHub Connector

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

com.rapid7.client.dcerpc.transport.exceptions.RPCFaultException: Fault: nca_op_rng_error (0x1C010002

rahulgangarde opened this issue · comments

In below code snippet i am getting the exception

final RPCTransport transport = SMBTransportFactories.SRVSVC.getTransport(session);
SecurityAccountManagerService service = new SecurityAccountManagerService(transport);
com.rapid7.client.dcerpc.dto.SID sid = //
ServerHandle openServer = service.openServer();//here it throwing an excpetion
DomainHandle openDomain = service.openDomain(openServer,sid);
GroupHandle groupHandle = new GroupHandle(openDomain.getBytes());
GroupGeneralInformation groupGeneralInformation = service.getGroupGeneralInformation(groupHandle);
System.out.println(groupGeneralInformation.getName());

com.rapid7.client.dcerpc.transport.exceptions.RPCFaultException: Fault: nca_op_rng_error (0x1C010002)
at com.rapid7.client.dcerpc.transport.exceptions.RPCFaultException.read(RPCFaultException.java:42)
at com.rapid7.client.dcerpc.transport.RPCTransport.call(RPCTransport.java:111)
at com.rapid7.client.dcerpc.service.Service.call(Service.java:46)
at com.rapid7.client.dcerpc.service.Service.callExpect(Service.java:55)
at com.rapid7.client.dcerpc.service.Service.callExpectSuccess(Service.java:50)
at com.rapid7.client.dcerpc.mssamr.SecurityAccountManagerService.openServer(SecurityAccountManagerService.java:151)
at com.rapid7.client.dcerpc.mssamr.SecurityAccountManagerService.openServer(SecurityAccountManagerService.java:137)
at com.rapid7.client.dcerpc.mssamr.SecurityAccountManagerService.openServer(SecurityAccountManagerService.java:125)
at test.Test.main(Test.java:85)

IS there any way or code get the group name and user name by using sid in java?

Also getting the below exception when i use above code


Exception in thread "main" com.rapid7.client.dcerpc.transport.exceptions.RPCFaultException: Fault: nca_op_rng_error (0x1C010002)
at com.rapid7.client.dcerpc.transport.exceptions.RPCFaultException.read(RPCFaultException.java:42)
at com.rapid7.client.dcerpc.transport.RPCTransport.call(RPCTransport.java:111)
at com.rapid7.client.dcerpc.service.Service.call(Service.java:46)
at com.rapid7.client.dcerpc.service.Service.callExpect(Service.java:55)
at com.rapid7.client.dcerpc.service.Service.callExpectSuccess(Service.java:50)
at com.rapid7.client.dcerpc.mssamr.SecurityAccountManagerService.openServer(SecurityAccountManagerService.java:151)
at com.rapid7.client.dcerpc.mssamr.SecurityAccountManagerService.openServer(SecurityAccountManagerService.java:137)
at com.rapid7.client.dcerpc.mssamr.SecurityAccountManagerService.openServer(SecurityAccountManagerService.java:125)

Maybe a little late, but I also had the same error today.
My mistake was that I had used the WINREG SMBTransportFactory. After using the LSASVC SMBTransportFactory, my lookupNamesForSIDs request works without errors.