本文整理汇总了Python中impacket.dcerpc.v5.samr.hSamrQueryInformationDomain方法的典型用法代码示例。如果您正苦于以下问题:Python samr.hSamrQueryInformationDomain方法的具体用法?Python samr.hSamrQueryInformationDomain怎么用?Python samr.hSamrQueryInformationDomain使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类impacket.dcerpc.v5.samr
的用法示例。
在下文中一共展示了samr.hSamrQueryInformationDomain方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_hSamrQueryInformationDomain_hSamrSetInformationDomain
# 需要导入模块: from impacket.dcerpc.v5 import samr [as 别名]
# 或者: from impacket.dcerpc.v5.samr import hSamrQueryInformationDomain [as 别名]
def test_hSamrQueryInformationDomain_hSamrSetInformationDomain(self):
dce, rpctransport, domainHandle = self.connect()
resp = samr.hSamrQueryInformationDomain(dce, domainHandle, samr.DOMAIN_INFORMATION_CLASS.DomainPasswordInformation)
resp.dump()
resp['Buffer']['Password']['MaxPasswordAge']['LowPart'] = 11
resp = samr.hSamrSetInformationDomain(dce, domainHandle, resp['Buffer'])
resp.dump()
resp2 = samr.hSamrQueryInformationDomain(dce, domainHandle, samr.DOMAIN_INFORMATION_CLASS.DomainPasswordInformation)
resp2.dump()
self.assertTrue( 11 == resp2['Buffer']['Password']['MaxPasswordAge']['LowPart'] )
resp2['Buffer']['Password']['MaxPasswordAge']['LowPart'] = 0
resp = samr.hSamrSetInformationDomain(dce, domainHandle, resp2['Buffer'])
resp.dump()
################################################################################
resp = samr.hSamrQueryInformationDomain(dce, domainHandle, samr.DOMAIN_INFORMATION_CLASS.DomainGeneralInformation)
resp.dump()
resp['Buffer']['General']['ReplicaSourceNodeName'] = 'BETUS'
try:
resp = samr.hSamrSetInformationDomain(dce, domainHandle, resp['Buffer'])
except Exception, e:
if str(e).find('STATUS_INVALID_INFO_CLASS') < 0:
raise
################################################################################