本文整理匯總了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
################################################################################