本文整理汇总了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()