本文整理汇总了Python中impacket.dcerpc.v5.nrpc.DsrEnumerateDomainTrusts方法的典型用法代码示例。如果您正苦于以下问题:Python nrpc.DsrEnumerateDomainTrusts方法的具体用法?Python nrpc.DsrEnumerateDomainTrusts怎么用?Python nrpc.DsrEnumerateDomainTrusts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类impacket.dcerpc.v5.nrpc
的用法示例。
在下文中一共展示了nrpc.DsrEnumerateDomainTrusts方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: rpc_get_domain_trusts
# 需要导入模块: from impacket.dcerpc.v5 import nrpc [as 别名]
# 或者: from impacket.dcerpc.v5.nrpc import DsrEnumerateDomainTrusts [as 别名]
def rpc_get_domain_trusts(self):
binding = r'ncacn_np:%s[\PIPE\netlogon]' % self.addr
dce = self.dce_rpc_connect(binding, nrpc.MSRPC_UUID_NRPC)
if dce is None:
return
try:
req = nrpc.DsrEnumerateDomainTrusts()
req['ServerName'] = NULL
req['Flags'] = 1
resp = dce.request(req)
except Exception as e:
raise e
for domain in resp['Domains']['Domains']:
logging.info('Found domain trust from %s to %s', self.hostname, domain['NetbiosDomainName'])
self.trusts.append({'domain': domain['DnsDomainName'],
'type': domain['TrustType'],
'flags': domain['Flags']})
dce.disconnect()
示例2: test_DsrEnumerateDomainTrusts
# 需要导入模块: from impacket.dcerpc.v5 import nrpc [as 别名]
# 或者: from impacket.dcerpc.v5.nrpc import DsrEnumerateDomainTrusts [as 别名]
def test_DsrEnumerateDomainTrusts(self):
dce, rpctransport = self.connect()
request = nrpc.DsrEnumerateDomainTrusts()
request['ServerName'] = NULL
request['Flags'] = 1
try:
resp = dce.request(request)
resp.dump()
except Exception, e:
if str(e).find('STATUS_NOT_SUPPORTED') < 0:
raise
示例3: test_DsrEnumerateDomainTrusts
# 需要导入模块: from impacket.dcerpc.v5 import nrpc [as 别名]
# 或者: from impacket.dcerpc.v5.nrpc import DsrEnumerateDomainTrusts [as 别名]
def test_DsrEnumerateDomainTrusts(self):
dce, rpctransport = self.connect()
request = nrpc.DsrEnumerateDomainTrusts()
request['ServerName'] = NULL
request['Flags'] = 1
try:
resp = dce.request(request)
resp.dump()
except Exception as e:
if str(e).find('STATUS_NOT_SUPPORTED') < 0:
raise