当前位置: 首页>>代码示例>>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;未经允许,请勿转载。