Example #1
0
 def test_connection(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.connect()
     dce.bind(epm.MSRPC_UUID_PORTMAP)
     dce.disconnect()
Example #2
0
 def test_connectionHashes(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.connect()
     dce.bind(epm.MSRPC_UUID_PORTMAP)
     dce.disconnect()
Example #3
0
 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()
Example #4
0
 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()