當前位置: 首頁>>代碼示例>>Python>>正文


Python drsuapi.hDRSCrackNames方法代碼示例

本文整理匯總了Python中impacket.dcerpc.v5.drsuapi.hDRSCrackNames方法的典型用法代碼示例。如果您正苦於以下問題:Python drsuapi.hDRSCrackNames方法的具體用法?Python drsuapi.hDRSCrackNames怎麽用?Python drsuapi.hDRSCrackNames使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在impacket.dcerpc.v5.drsuapi的用法示例。


在下文中一共展示了drsuapi.hDRSCrackNames方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_hDRSCrackNames

# 需要導入模塊: from impacket.dcerpc.v5 import drsuapi [as 別名]
# 或者: from impacket.dcerpc.v5.drsuapi import hDRSCrackNames [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() 
開發者ID:joxeankoret,項目名稱:CVE-2017-7494,代碼行數:24,代碼來源:test_drsuapi.py

示例2: convert_sidtont4

# 需要導入模塊: from impacket.dcerpc.v5 import drsuapi [as 別名]
# 或者: from impacket.dcerpc.v5.drsuapi import hDRSCrackNames [as 別名]
def convert_sidtont4(self, sid):

        # We get a DRS handle, shamelessly stolen from secretsdump.py
        request = drsuapi.DRSBind()
        request['puuidClientDsa'] = drsuapi.NTDSAPI_CLIENT_GUID
        drs = drsuapi.DRS_EXTENSIONS_INT()
        drs['cb'] = len(drs) #- 4
        drs['dwFlags'] = drsuapi.DRS_EXT_GETCHGREQ_V6 | drsuapi.DRS_EXT_GETCHGREPLY_V6 | drsuapi.DRS_EXT_GETCHGREQ_V8 | \
                         drsuapi.DRS_EXT_STRONG_ENCRYPTION
        drs['SiteObjGuid'] = drsuapi.NULLGUID
        drs['Pid'] = 0
        drs['dwReplEpoch'] = 0
        drs['dwFlagsExt'] = 0
        drs['ConfigObjGUID'] = drsuapi.NULLGUID
        drs['dwExtCaps'] = 0xffffffff
        request['pextClient']['cb'] = len(drs)
        request['pextClient']['rgb'] = list(str(drs))

        hdrs = self._rpc_connection.request(request)['phDrs']

        resp = drsuapi.hDRSCrackNames(self._rpc_connection, hdrs, 0x0, 11, 2, (sid,))

        return resp['pmsgOut']['V1']['pResult']['rItems'][0]['pName'] 
開發者ID:the-useless-one,項目名稱:pywerview,代碼行數:25,代碼來源:misc.py

示例3: test_hDRSCrackNames

# 需要導入模塊: from impacket.dcerpc.v5 import drsuapi [as 別名]
# 或者: from impacket.dcerpc.v5.drsuapi import hDRSCrackNames [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() 
開發者ID:Coalfire-Research,項目名稱:Slackor,代碼行數:24,代碼來源:test_drsuapi.py

示例4: DRSCrackNames

# 需要導入模塊: from impacket.dcerpc.v5 import drsuapi [as 別名]
# 或者: from impacket.dcerpc.v5.drsuapi import hDRSCrackNames [as 別名]
def DRSCrackNames(self, formatOffered=drsuapi.DS_NAME_FORMAT.DS_DISPLAY_NAME,
                      formatDesired=drsuapi.DS_NAME_FORMAT.DS_FQDN_1779_NAME, name=''):
        if self.__drsr is None:
            self.__connectDrds()

        LOG.debug('Calling DRSCrackNames for %s ' % name)
        resp = drsuapi.hDRSCrackNames(self.__drsr, self.__hDrs, 0, formatOffered, formatDesired, (name,))
        return resp 
開發者ID:joxeankoret,項目名稱:CVE-2017-7494,代碼行數:10,代碼來源:secretsdump.py

示例5: DRSCrackNames

# 需要導入模塊: from impacket.dcerpc.v5 import drsuapi [as 別名]
# 或者: from impacket.dcerpc.v5.drsuapi import hDRSCrackNames [as 別名]
def DRSCrackNames(self, formatOffered=drsuapi.DS_NAME_FORMAT.DS_DISPLAY_NAME,
                      formatDesired=drsuapi.DS_NAME_FORMAT.DS_FQDN_1779_NAME, name=''):
        if self.__drsr is None:
            self.__connectDrds()

        resp = drsuapi.hDRSCrackNames(self.__drsr, self.__hDrs, 0, formatOffered, formatDesired, (name,))
        return resp 
開發者ID:jrmdev,項目名稱:smbwrapper,代碼行數:9,代碼來源:secretsdump.py

示例6: DRSCrackNames

# 需要導入模塊: from impacket.dcerpc.v5 import drsuapi [as 別名]
# 或者: from impacket.dcerpc.v5.drsuapi import hDRSCrackNames [as 別名]
def DRSCrackNames(self, target, formatOffered=drsuapi.DS_NAME_FORMAT.DS_DISPLAY_NAME,
                      formatDesired=drsuapi.DS_NAME_FORMAT.DS_FQDN_1779_NAME, name='', creds=None):
        if self.__drsr is None:
            self.__connectDrds(target, creds)

        resp = drsuapi.hDRSCrackNames(self.__drsr, self.__hDrs, 0, formatOffered, formatDesired, (name,))
        return resp 
開發者ID:Coalfire-Research,項目名稱:Slackor,代碼行數:9,代碼來源:raiseChild.py


注:本文中的impacket.dcerpc.v5.drsuapi.hDRSCrackNames方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。