Example #1
0
 def __init__(self,
              ntdsFile,
              bootKey,
              logger,
              isRemote=False,
              history=False,
              noLMHash=True,
              remoteOps=None,
              useVSSMethod=False,
              justNTLM=False,
              pwdLastSet=False,
              resumeSession=None,
              outputFileName=None):
     self.__bootKey = bootKey
     self.__logger = logger
     self.__NTDS = ntdsFile
     self.__history = history
     self.__noLMHash = noLMHash
     self.__useVSSMethod = useVSSMethod
     self.__remoteOps = remoteOps
     self.__pwdLastSet = pwdLastSet
     if self.__NTDS is not None:
         self.__ESEDB = ESENT_DB(ntdsFile, isRemote=isRemote)
         self.__cursor = self.__ESEDB.openTable('datatable')
     self.__tmpUsers = list()
     self.__PEK = list()
     self.__cryptoCommon = CryptoCommon()
     self.__kerberosKeys = OrderedDict()
     self.__clearTextPwds = OrderedDict()
     self.__justNTLM = justNTLM
     self.__savedSessionFile = resumeSession
     self.__resumeSessionFile = None
     self.__outputFileName = outputFileName
Example #2
0
 def __init__(self, ntdsFile, isRemote=False):
     self.__NTDS = ntdsFile
     try:
         if self.__NTDS is not None:
             self.__ESEDB = ESENT_DB(ntdsFile, isRemote=isRemote)
             self.__cursor = self.__ESEDB.openTable('datatable')
     except Exception as e:
         raise e
Example #3
0
def main():
    print version.BANNER
    parser = argparse.ArgumentParser()
    parser.add_argument('databaseFile', action='store', help='ESE to open')
    parser.add_argument('-debug',
                        action='store_true',
                        help='Turn DEBUG output ON')
    parser.add_argument('-page', action='store', help='page to open')

    subparsers = parser.add_subparsers(help='actions', dest='action')

    # dump page
    dump_parser = subparsers.add_parser('dump', help='dumps an specific page')
    dump_parser.add_argument('-page',
                             action='store',
                             required=True,
                             help='page to dump')

    # info page
    info_parser = subparsers.add_parser(
        'info', help='dumps the catalog info for the DB')

    # export page
    export_parser = subparsers.add_parser(
        'export', help='dumps the catalog info for the DB')
    export_parser.add_argument('-table',
                               action='store',
                               required=True,
                               help='table to dump')

    if len(sys.argv) == 1:
        parser.print_help()
        sys.exit(1)

    options = parser.parse_args()

    if options.debug is True:
        logging.getLogger().setLevel(logging.DEBUG)
    else:
        logging.getLogger().setLevel(logging.INFO)

    ese = ESENT_DB(options.databaseFile)

    try:
        if options.action.upper() == 'INFO':
            ese.printCatalog()
        elif options.action.upper() == 'DUMP':
            dumpPage(ese, int(options.page))
        elif options.action.upper() == 'EXPORT':
            exportTable(ese, options.table)
        else:
            logging.error('Unknown action %s ' % options.action)
            raise
    except Exception, e:
        #import traceback
        #print traceback.print_exc()
        print e
def main():
    print(version.BANNER)
    # Init the example's logger theme
    logger.init()

    parser = argparse.ArgumentParser(add_help = True, description = "Extensive Storage Engine utility. Allows dumping "
                                                                    "catalog, pages and tables.")
    parser.add_argument('databaseFile', action='store', help='ESE to open')
    parser.add_argument('-debug', action='store_true', help='Turn DEBUG output ON')
    parser.add_argument('-page', action='store', help='page to open')

    subparsers = parser.add_subparsers(help='actions', dest='action')

    # dump page
    dump_parser = subparsers.add_parser('dump', help='dumps an specific page')
    dump_parser.add_argument('-page', action='store', required=True, help='page to dump')

    # info page
    subparsers.add_parser('info', help='dumps the catalog info for the DB')

    # export page
    export_parser = subparsers.add_parser('export', help='dumps the catalog info for the DB')
    export_parser.add_argument('-table', action='store', required=True, help='table to dump')

    if len(sys.argv)==1:
        parser.print_help()
        sys.exit(1)

    options = parser.parse_args()

    if options.debug is True:
        logging.getLogger().setLevel(logging.DEBUG)
        # Print the Library's installation path
        logging.debug(version.getInstallationPath())
    else:
        logging.getLogger().setLevel(logging.INFO)

    ese = ESENT_DB(options.databaseFile)

    try:
        if options.action.upper() == 'INFO':
            ese.printCatalog()
        elif options.action.upper() == 'DUMP':
            dumpPage(ese, int(options.page))
        elif options.action.upper() == 'EXPORT':
            exportTable(ese, options.table)
        else:
            raise Exception('Unknown action %s ' % options.action)
    except Exception as e:
        if logging.getLogger().level == logging.DEBUG:
            import traceback
            traceback.print_exc()
        print(e)
    ese.close()
Example #5
0
	def __init__(self, ntdsFile, bootKey, isRemote = False, history = False, noLMHash = True):
		self.__bootKey = bootKey
		self.__NTDS = ntdsFile
		self.__history = history
		self.__noLMHash = noLMHash
		if self.__NTDS is not None:
			self.__ESEDB = ESENT_DB(ntdsFile, isRemote = isRemote)
			self.__cursor = self.__ESEDB.openTable('datatable')
		self.__tmpUsers = list()
		self.__PEK = None
		self.__cryptoCommon = CryptoCommon()
		self.__hashesFound = {}
		self.__kerberosKeys = OrderedDict()
Example #6
0
    def __init__(self, ntds_file, bootKey, history=False, noLMHash=True):
        self.__bootKey = bootKey
        self.__ntds_file = ntds_file
        self.__history = history
        self.__no_LMhash = noLMHash
        self.__tmpUsers = list()
        self.__PEK = None
        self.__cryptoCommon = CryptoCommon()
        self.__itemsFound = {}

        if not self.__ntds_file:
            return

        self.__ESEDB = ESENT_DB(self.__ntds_file, isRemote=True)
        self.__cursor = self.__ESEDB.openTable('datatable')