本文整理匯總了Python中impacket.dcerpc.v5.samr.hSamrQueryInformationAlias方法的典型用法代碼示例。如果您正苦於以下問題:Python samr.hSamrQueryInformationAlias方法的具體用法?Python samr.hSamrQueryInformationAlias怎麽用?Python samr.hSamrQueryInformationAlias使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類impacket.dcerpc.v5.samr
的用法示例。
在下文中一共展示了samr.hSamrQueryInformationAlias方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_hSamrQueryInformationAlias_hSamrSetInformationAlias
# 需要導入模塊: from impacket.dcerpc.v5 import samr [as 別名]
# 或者: from impacket.dcerpc.v5.samr import hSamrQueryInformationAlias [as 別名]
def test_hSamrQueryInformationAlias_hSamrSetInformationAlias(self):
dce, rpctransport, domainHandle = self.connect()
resp4 = samr.hSamrEnumerateAliasesInDomain(dce, domainHandle)
resp4.dump()
resp0 = samr.hSamrOpenAlias(dce, domainHandle, aliasId = resp4['Buffer']['Buffer'][0]['RelativeId'])
resp0.dump()
resp = samr.hSamrQueryInformationAlias(dce, resp0['AliasHandle'], samr.ALIAS_INFORMATION_CLASS.AliasGeneralInformation)
resp.dump()
################################################################################
resp = samr.hSamrQueryInformationAlias(dce, resp0['AliasHandle'], samr.ALIAS_INFORMATION_CLASS.AliasNameInformation)
resp.dump()
oldData = resp['Buffer']['Name']['Name']
req = samr.SAMPR_ALIAS_INFO_BUFFER()
req['tag'] = samr.ALIAS_INFORMATION_CLASS.AliasNameInformation
req['Name']['Name'] = 'BETUS'
resp = samr.hSamrSetInformationAlias(dce, resp0['AliasHandle'], req)
resp.dump()
resp = samr.hSamrQueryInformationAlias(dce, resp0['AliasHandle'], samr.ALIAS_INFORMATION_CLASS.AliasNameInformation)
resp.dump()
self.assertTrue( 'BETUS' == resp['Buffer']['Name']['Name'])
req['Name']['Name'] = oldData
resp = samr.hSamrSetInformationAlias(dce, resp0['AliasHandle'], req)
resp.dump()