def test_dceAuth(self): rpctransport = transport.DCERPCTransportFactory(self.stringBinding) rpctransport.set_dport(self.dport) if hasattr(rpctransport, 'set_credentials'): # This method exists only for selected protocol sequences. rpctransport.set_credentials(self.username, self.password, self.domain) dce = rpctransport.get_dce_rpc() dce.set_credentials(*(rpctransport.get_credentials())) dce.connect() dce.bind(epm.MSRPC_UUID_PORTMAP) rpcepm = epm.DCERPCEpm(dce) dce.disconnect()
def test_dceFragmentation(self): rpctransport = transport.DCERPCTransportFactory(self.stringBinding) rpctransport.set_dport(self.dport) if hasattr(rpctransport, 'set_credentials'): lmhash, nthash = self.hashes.split(':') # This method exists only for selected protocol sequences. rpctransport.set_credentials(self.username, '', self.domain, lmhash, nthash) dce = rpctransport.get_dce_rpc() dce.set_max_fragment_size(1) dce.set_credentials(*(rpctransport.get_credentials())) dce.connect() dce.bind(epm.MSRPC_UUID_PORTMAP) rpcepm = epm.DCERPCEpm(dce) resp = rpcepm.lookup('', inquireType=epm.RPC_C_EP_ALL_ELTS) dce.disconnect()
def test_packetAnonWINNTPacketPrivacy(self): rpctransport = transport.DCERPCTransportFactory(self.stringBinding) rpctransport.set_dport(self.dport) if hasattr(rpctransport, 'set_credentials'): lmhash, nthash = self.hashes.split(':') # This method exists only for selected protocol sequences. rpctransport.set_credentials(self.username, self.password, self.domain, lmhash, nthash) dce = rpctransport.get_dce_rpc() #dce.set_max_fragment_size(1) dce.connect() dce.set_auth_type(dcerpc.RPC_C_AUTHN_WINNT) dce.set_auth_level(dcerpc.RPC_C_AUTHN_LEVEL_PKT_PRIVACY) dce.bind(epm.MSRPC_UUID_PORTMAP) rpcepm = epm.DCERPCEpm(dce) resp = rpcepm.lookup('', inquireType=epm.RPC_C_EP_ALL_ELTS) dce.disconnect()