本文整理匯總了Python中impacket.dcerpc.v5.drsuapi.DS_NT4_ACCOUNT_NAME_SANS_DOMAIN屬性的典型用法代碼示例。如果您正苦於以下問題:Python drsuapi.DS_NT4_ACCOUNT_NAME_SANS_DOMAIN屬性的具體用法?Python drsuapi.DS_NT4_ACCOUNT_NAME_SANS_DOMAIN怎麽用?Python drsuapi.DS_NT4_ACCOUNT_NAME_SANS_DOMAIN使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類impacket.dcerpc.v5.drsuapi
的用法示例。
在下文中一共展示了drsuapi.DS_NT4_ACCOUNT_NAME_SANS_DOMAIN屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_DRSCrackNames
# 需要導入模塊: from impacket.dcerpc.v5 import drsuapi [as 別名]
# 或者: from impacket.dcerpc.v5.drsuapi import DS_NT4_ACCOUNT_NAME_SANS_DOMAIN [as 別名]
def test_DRSCrackNames(self):
dce, rpctransport, hDrs, DsaObjDest = self.connect()
request = drsuapi.DRSCrackNames()
request['hDrs'] = hDrs
request['dwInVersion'] = 1
request['pmsgIn']['tag'] = 1
request['pmsgIn']['V1']['CodePage'] = 0
request['pmsgIn']['V1']['LocaleId'] = 0
request['pmsgIn']['V1']['dwFlags'] = 0
request['pmsgIn']['V1']['formatOffered'] = drsuapi.DS_NT4_ACCOUNT_NAME_SANS_DOMAIN
request['pmsgIn']['V1']['formatDesired'] = drsuapi.DS_USER_PRINCIPAL_NAME_FOR_LOGON
request['pmsgIn']['V1']['cNames'] = 1
name = LPWSTR()
#name['Data'] = 'FREEFLY-DC\x00'
#name['Data'] = 'CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=FREEFLY,DC=NET\x00'
#name['Data'] = 'CN=FREEFLY-DC,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=FREEFLY,DC=NET\x00'
name['Data'] = 'Administrator\x00'
request['pmsgIn']['V1']['rpNames'].append(name)
resp = dce.request(request)
resp.dump()
示例2: test_hDRSCrackNames
# 需要導入模塊: from impacket.dcerpc.v5 import drsuapi [as 別名]
# 或者: from impacket.dcerpc.v5.drsuapi import DS_NT4_ACCOUNT_NAME_SANS_DOMAIN [as 別名]
def test_hDRSCrackNames(self):
dce, rpctransport, hDrs, DsaObjDest = self.connect()
name = 'Administrator'
formatOffered = drsuapi.DS_NT4_ACCOUNT_NAME_SANS_DOMAIN
formatDesired = drsuapi.DS_STRING_SID_NAME
resp = drsuapi.hDRSCrackNames(dce, hDrs, 0, formatOffered, formatDesired, (name,))
resp.dump()
name = 'CN=NTDS Settings,CN=FREEFLY-DC,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=FREEFLY,DC=NET'
resp = drsuapi.hDRSCrackNames(dce, hDrs, 0, drsuapi.DS_NAME_FORMAT.DS_FQDN_1779_NAME, drsuapi.DS_NAME_FORMAT.DS_UNIQUE_ID_NAME, (name,))
resp.dump()
name = 'CN=NTDS Settings,CN=FREEFLY-DC,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=FREEFLY,DC=NET'
resp = drsuapi.hDRSCrackNames(dce, hDrs, 0, drsuapi.DS_NAME_FORMAT.DS_FQDN_1779_NAME, drsuapi.DS_STRING_SID_NAME, (name,))
resp.dump()
name = 'FREEFLY.NET'
#name = ''
resp = drsuapi.hDRSCrackNames(dce, hDrs, 0, drsuapi.DS_LIST_ROLES, drsuapi.DS_NAME_FORMAT.DS_FQDN_1779_NAME, (name,))
resp.dump()
示例3: test_hDRSCrackNames
# 需要導入模塊: from impacket.dcerpc.v5 import drsuapi [as 別名]
# 或者: from impacket.dcerpc.v5.drsuapi import DS_NT4_ACCOUNT_NAME_SANS_DOMAIN [as 別名]
def test_hDRSCrackNames(self):
dce, rpctransport, hDrs, DsaObjDest = self.connect()
name = 'Administrator'
formatOffered = drsuapi.DS_NT4_ACCOUNT_NAME_SANS_DOMAIN
formatDesired = drsuapi.DS_STRING_SID_NAME
resp = drsuapi.hDRSCrackNames(dce, hDrs, 0, formatOffered, formatDesired, (name,))
resp.dump()
name = 'CN=NTDS Settings,CN=DC1-WIN2012,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=%s,DC=%s' % (self.domain.split('.')[0],self.domain.split('.')[1])
resp = drsuapi.hDRSCrackNames(dce, hDrs, 0, drsuapi.DS_NAME_FORMAT.DS_FQDN_1779_NAME, drsuapi.DS_NAME_FORMAT.DS_UNIQUE_ID_NAME, (name,))
resp.dump()
name = 'CN=NTDS Settings,CN=DC1-WIN2012,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=%s,DC=%s' % (self.domain.split('.')[0],self.domain.split('.')[1])
resp = drsuapi.hDRSCrackNames(dce, hDrs, 0, drsuapi.DS_NAME_FORMAT.DS_FQDN_1779_NAME, drsuapi.DS_STRING_SID_NAME, (name,))
resp.dump()
name = self.domain.upper()
#name = ''
resp = drsuapi.hDRSCrackNames(dce, hDrs, 0, drsuapi.DS_LIST_ROLES, drsuapi.DS_NAME_FORMAT.DS_FQDN_1779_NAME, (name,))
resp.dump()