_id
stringlengths
2
7
title
stringlengths
1
88
partition
stringclasses
3 values
text
stringlengths
31
13.1k
language
stringclasses
1 value
meta_information
dict
q25700
ParsersManager.GetParserObjects
train
def GetParserObjects(cls, parser_filter_expression=None): """Retrieves the parser objects. Args: parser_filter_expression (Optional[str]): parser filter expression, where None represents all parsers and plugins. Returns: dict[str, BaseParser]: parsers per name. """ includes, ...
python
{ "resource": "" }
q25701
ParsersManager.GetParsers
train
def GetParsers(cls, parser_filter_expression=None): """Retrieves the registered parsers and plugins. Retrieves a dictionary of all registered parsers and associated plugins from a parser filter string. The filter string can contain direct names of parsers, presets or plugins. The filter string can also...
python
{ "resource": "" }
q25702
ParsersManager.GetParsersInformation
train
def GetParsersInformation(cls): """Retrieves the parsers information. Returns: list[tuple[str, str]]: parser names and descriptions. """ parsers_information = [] for _, parser_class in cls.GetParsers():
python
{ "resource": "" }
q25703
ParsersManager.GetPresetsInformation
train
def GetPresetsInformation(cls): """Retrieves the presets information. Returns: list[tuple]: containing: str: preset name str: comma separated parser names that are defined by the preset """ parser_presets_information = []
python
{ "resource": "" }
q25704
ParsersManager.GetPresetsForOperatingSystem
train
def GetPresetsForOperatingSystem( cls, operating_system, operating_system_product, operating_system_version): """Determines the presets for a specific operating system. Args: operating_system (str): operating system for example "Windows". This should be one of the values in definiti...
python
{ "resource": "" }
q25705
ParsersManager.RegisterParser
train
def RegisterParser(cls, parser_class): """Registers a parser class. The parser classes are identified based on their lower case name. Args: parser_class (type): parser class (subclass of BaseParser). Raises: KeyError: if parser class is already set for the corresponding name. """ ...
python
{ "resource": "" }
q25706
ImageExportTool._CalculateDigestHash
train
def _CalculateDigestHash(self, file_entry, data_stream_name): """Calculates a SHA-256 digest of the contents of the file entry. Args: file_entry (dfvfs.FileEntry): file entry whose content will be hashed. data_stream_name (str): name of the data stream whose content is to be hashed. ...
python
{ "resource": "" }
q25707
ImageExportTool._CreateSanitizedDestination
train
def _CreateSanitizedDestination( self, source_file_entry, source_path_spec, source_data_stream_name, destination_path): """Creates a sanitized path of both destination directory and filename. This function replaces non-printable and other characters defined in _DIRTY_CHARACTERS with an undersc...
python
{ "resource": "" }
q25708
ImageExportTool._Extract
train
def _Extract( self, source_path_specs, destination_path, output_writer, skip_duplicates=True): """Extracts files. Args: source_path_specs (list[dfvfs.PathSpec]): path specifications to extract. destination_path (str): path where the extracted files should be stored. output_writer ...
python
{ "resource": "" }
q25709
ImageExportTool._ExtractDataStream
train
def _ExtractDataStream( self, file_entry, data_stream_name, destination_path, output_writer, skip_duplicates=True): """Extracts a data stream. Args: file_entry (dfvfs.FileEntry): file entry containing the data stream. data_stream_name (str): name of the data stream. destination_pa...
python
{ "resource": "" }
q25710
ImageExportTool._ExtractFileEntry
train
def _ExtractFileEntry( self, path_spec, destination_path, output_writer, skip_duplicates=True): """Extracts a file entry. Args: path_spec (dfvfs.PathSpec): path specification of the source file. destination_path (str): path where the extracted files should be stored. output_writer (CLIO...
python
{ "resource": "" }
q25711
ImageExportTool._ExtractWithFilter
train
def _ExtractWithFilter( self, source_path_specs, destination_path, output_writer, artifact_filters, filter_file, artifact_definitions_path, custom_artifacts_path, skip_duplicates=True): """Extracts files using a filter expression. This method runs the file extraction process on the image and ...
python
{ "resource": "" }
q25712
ImageExportTool._GetSourceFileSystem
train
def _GetSourceFileSystem(self, source_path_spec, resolver_context=None): """Retrieves the file system of the source. Args: source_path_spec (dfvfs.PathSpec): source path specification of the file system. resolver_context (dfvfs.Context): resolver context. Returns: tuple: contai...
python
{ "resource": "" }
q25713
ImageExportTool._ParseExtensionsString
train
def _ParseExtensionsString(self, extensions_string): """Parses the extensions string. Args: extensions_string (str): comma separated extensions to filter. """ if not extensions_string:
python
{ "resource": "" }
q25714
ImageExportTool._ParseNamesString
train
def _ParseNamesString(self, names_string): """Parses the name string. Args: names_string (str): comma separated filenames to filter. """ if not names_string: return names_string = names_string.lower()
python
{ "resource": "" }
q25715
ImageExportTool._ParseSignatureIdentifiers
train
def _ParseSignatureIdentifiers(self, data_location, signature_identifiers): """Parses the signature identifiers. Args: data_location (str): location of the format specification file, for example, "signatures.conf". signature_identifiers (str): comma separated signature identifiers. R...
python
{ "resource": "" }
q25716
ImageExportTool._ReadSpecificationFile
train
def _ReadSpecificationFile(self, path): """Reads the format specification file. Args: path (str): path of the format specification file. Returns: FormatSpecificationStore: format specification store. """ specification_store = specification.FormatSpecificationStore() with io.open( ...
python
{ "resource": "" }
q25717
ImageExportTool._WriteFileEntry
train
def _WriteFileEntry(self, file_entry, data_stream_name, destination_file): """Writes the contents of the source file entry to a destination file. Note that this function will overwrite an existing file. Args: file_entry (dfvfs.FileEntry): file entry whose content is to be written. data_stream_...
python
{ "resource": "" }
q25718
ImageExportTool.AddFilterOptions
train
def AddFilterOptions(self, argument_group): """Adds the filter options to the argument group. Args: argument_group (argparse._ArgumentGroup): argparse argument group. """ names = ['artifact_filters', 'date_filters', 'filter_file'] helpers_manager.ArgumentHelperManager.AddCommandLineArguments(...
python
{ "resource": "" }
q25719
ImageExportTool.ListSignatureIdentifiers
train
def ListSignatureIdentifiers(self): """Lists the signature identifier. Raises: BadConfigOption: if the data location is invalid. """ if not self._data_location: raise errors.BadConfigOption('Missing data location.') path = os.path.join(self._data_location, 'signatures.conf') if not...
python
{ "resource": "" }
q25720
ImageExportTool.ParseOptions
train
def ParseOptions(self, options): """Parses the options and initializes the front-end. Args: options (argparse.Namespace): command line arguments. Raises: BadConfigOption: if the options are invalid. """ # The data location is required to list signatures. helpers_manager.ArgumentHel...
python
{ "resource": "" }
q25721
SystemResourceUsageMonitorESEDBPlugin._ConvertValueBinaryDataToFloatingPointValue
train
def _ConvertValueBinaryDataToFloatingPointValue(self, value): """Converts a binary data value into a floating-point value. Args: value (bytes): binary data value containing an ASCII string or None. Returns: float: floating-point representation of binary data value or None if value is...
python
{ "resource": "" }
q25722
SystemResourceUsageMonitorESEDBPlugin._GetIdentifierMappings
train
def _GetIdentifierMappings(self, parser_mediator, cache, database): """Retrieves the identifier mappings from SruDbIdMapTable table. In the SRUM database individual tables contain numeric identifiers for the application ("AppId") and user identifier ("UserId"). A more descriptive string of these values...
python
{ "resource": "" }
q25723
SystemResourceUsageMonitorESEDBPlugin._ParseGUIDTable
train
def _ParseGUIDTable( self, parser_mediator, cache, database, esedb_table, values_map, event_data_class): """Parses a table with a GUID as name. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. cache ...
python
{ "resource": "" }
q25724
SystemResourceUsageMonitorESEDBPlugin._ParseIdentifierMappingRecord
train
def _ParseIdentifierMappingRecord( self, parser_mediator, table_name, esedb_record): """Extracts an identifier mapping from a SruDbIdMapTable record. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. table_...
python
{ "resource": "" }
q25725
SystemResourceUsageMonitorESEDBPlugin._ParseIdentifierMappingsTable
train
def _ParseIdentifierMappingsTable(self, parser_mediator, esedb_table): """Extracts identifier mappings from the SruDbIdMapTable table. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. esedb_table (pyesedb.table)...
python
{ "resource": "" }
q25726
SystemResourceUsageMonitorESEDBPlugin.ParseApplicationResourceUsage
train
def ParseApplicationResourceUsage( self, parser_mediator, cache=None, database=None, table=None, **unused_kwargs): """Parses the application resource usage table. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and ...
python
{ "resource": "" }
q25727
SystemResourceUsageMonitorESEDBPlugin.ParseNetworkDataUsage
train
def ParseNetworkDataUsage( self, parser_mediator, cache=None, database=None, table=None, **unused_kwargs): """Parses the network data usage monitor table. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. ...
python
{ "resource": "" }
q25728
SystemResourceUsageMonitorESEDBPlugin.ParseNetworkConnectivityUsage
train
def ParseNetworkConnectivityUsage( self, parser_mediator, cache=None, database=None, table=None, **unused_kwargs): """Parses the network connectivity usage monitor table. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as stor...
python
{ "resource": "" }
q25729
DtFabricBaseParser._FormatPackedIPv6Address
train
def _FormatPackedIPv6Address(self, packed_ip_address): """Formats a packed IPv6 address as a human readable string. Args: packed_ip_address (list[int]): packed IPv6 address. Returns: str: human readable IPv6 address.
python
{ "resource": "" }
q25730
DtFabricBaseParser._ReadStructureFromFileObject
train
def _ReadStructureFromFileObject( self, file_object, file_offset, data_type_map): """Reads a structure from a file-like object. If the data type map has a fixed size this method will read the predefined number of bytes from the file-like object. If the data type map has a variable size, depending...
python
{ "resource": "" }
q25731
ElasticsearchOutputModule.WriteHeader
train
def WriteHeader(self): """Connects to the Elasticsearch server and creates the index.""" mappings = {} if self._raw_fields: if self._document_type not in mappings: mappings[self._document_type] = {} mappings[self._document_type]['dynamic_templates'] = [{ 'strings': {
python
{ "resource": "" }
q25732
PlistFileArtifactPreprocessorPlugin._FindKeys
train
def _FindKeys(self, key, names, matches): """Searches the plist key hierarchy for keys with matching names. If a match is found a tuple of the key name and value is added to the matches list. Args: key (dict[str, object]): plist key. names (list[str]): names of the keys to match. mat...
python
{ "resource": "" }
q25733
MacOSUserAccountsPlugin._GetKeysDefaultEmpty
train
def _GetKeysDefaultEmpty(self, top_level, keys, depth=1): """Retrieves plist keys, defaulting to empty values. Args: top_level (plistlib._InternalDict): top level plist object. keys (set[str]): names of keys that should be returned. depth (int): depth within the plist, where 1 is top level. ...
python
{ "resource": "" }
q25734
MacOSUserAccountsPlugin._GetPlistRootKey
train
def _GetPlistRootKey(self, file_entry): """Retrieves the root key of a plist file. Args: file_entry (dfvfs.FileEntry): file entry of the plist. Returns: dict[str, object]: plist root key. Raises: errors.PreProcessFail: if the preprocessing fails. """ file_object = file_entry...
python
{ "resource": "" }
q25735
RecurseKey
train
def RecurseKey(recur_item, depth=15, key_path=''): """Flattens nested dictionaries and lists by yielding it's values. The hierarchy of a plist file is a series of nested dictionaries and lists. This is a helper function helps plugins navigate the structure without having to reimplement their own recursive meth...
python
{ "resource": "" }
q25736
PlistPlugin._GetKeys
train
def _GetKeys(self, top_level, keys, depth=1): """Helper function to return keys nested in a plist dict. By default this function will return the values for the named keys requested by a plugin in match dictionary object. The default setting is to look a single layer down from the root (same as the chec...
python
{ "resource": "" }
q25737
BluetoothPlugin.GetEntries
train
def GetEntries(self, parser_mediator, match=None, **unused_kwargs): """Extracts relevant BT entries. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. match (Optional[dict[str: object]]): keys extracted from PLIS...
python
{ "resource": "" }
q25738
MacKeeperCachePlugin._DictToListOfStrings
train
def _DictToListOfStrings(self, data_dict): """Converts a dictionary into a list of strings. Args: data_dict (dict[str, object]): dictionary to convert. Returns: list[str]: list of strings. """ ret_list = [] for key, value in iter(data_dict.items()):
python
{ "resource": "" }
q25739
MacKeeperCachePlugin._ExtractJQuery
train
def _ExtractJQuery(self, jquery_raw): """Extracts values from a JQuery string. Args: jquery_raw (str): JQuery string. Returns: dict[str, str]: extracted values. """ data_part = '' if not jquery_raw: return {} if '[' in jquery_raw: _, _, first_part = jquery_raw.part...
python
{ "resource": "" }
q25740
MacKeeperCachePlugin._ParseChatData
train
def _ParseChatData(self, data): """Parses chat comment data. Args: data (dict[str, object]): chat comment data as returned by SQLite. Returns: dict[str, object]: parsed chat comment data. """ data_store = {} if 'body' in data: body = data.get('body', '').replace('\n', ' ') ...
python
{ "resource": "" }
q25741
FormattersManager.DeregisterFormatter
train
def DeregisterFormatter(cls, formatter_class): """Deregisters a formatter class. The formatter classes are identified based on their lower case data type. Args: formatter_class (type): class of the formatter. Raises: KeyError: if formatter
python
{ "resource": "" }
q25742
FormattersManager.GetFormatterObject
train
def GetFormatterObject(cls, data_type): """Retrieves the formatter object for a specific data type. Args: data_type (str): data type. Returns: EventFormatter: corresponding formatter or the default formatter if not available. """ data_type = data_type.lower() if data_type...
python
{ "resource": "" }
q25743
FormattersManager.GetMessageStrings
train
def GetMessageStrings(cls, formatter_mediator, event): """Retrieves the formatted message strings for a specific event object. Args: formatter_mediator (FormatterMediator): mediates the interactions between formatters and other components, such as storage and Windows EventLog resource...
python
{ "resource": "" }
q25744
FormattersManager.GetSourceStrings
train
def GetSourceStrings(cls, event): """Retrieves the formatted source strings for a specific event object. Args: event (EventObject): event. Returns: list[str, str]: short and
python
{ "resource": "" }
q25745
PEParser._GetSectionNames
train
def _GetSectionNames(self, pefile_object): """Retrieves all PE section names. Args: pefile_object (pefile.PE): pefile object. Returns: list[str]: names of the sections. """ section_names = [] for section in pefile_object.sections: section_name = getattr(section, 'Name', b'') ...
python
{ "resource": "" }
q25746
PEParser._GetImportTimestamps
train
def _GetImportTimestamps(self, pefile_object): """Retrieves timestamps from the import directory, if available. Args: pefile_object (pefile.PE): pefile object. Returns: list[int]: import timestamps. """ import_timestamps = [] if not hasattr(pefile_object, 'DIRECTORY_ENTRY_IMPORT'):...
python
{ "resource": "" }
q25747
PEParser._GetResourceTimestamps
train
def _GetResourceTimestamps(self, pefile_object): """Retrieves timestamps from resource directory entries, if available. Args: pefile_object (pefile.PE): pefile object. Returns: list[int]: resource timestamps.
python
{ "resource": "" }
q25748
PEParser._GetLoadConfigTimestamp
train
def _GetLoadConfigTimestamp(self, pefile_object): """Retrieves the timestamp from the Load Configuration directory. Args: pefile_object (pefile.PE): pefile object. Returns: int: load configuration timestamps or None if there are none present.
python
{ "resource": "" }
q25749
PEParser._GetDelayImportTimestamps
train
def _GetDelayImportTimestamps(self, pefile_object): """Retrieves timestamps from delay import entries, if available. Args: pefile_object (pefile.PE): pefile object. Returns: tuple[str, int]: name of the DLL being imported and the second is the timestamp of the entry. """ dela...
python
{ "resource": "" }
q25750
TrendMicroBaseParser._CreateDictReader
train
def _CreateDictReader(self, line_reader): """Iterates over the log lines and provide a reader for the values. Args: line_reader (iter): yields each line in the log file. Yields: dict[str, str]: column values keyed by column header. """ for line in line_reader: if isinstance(line,...
python
{ "resource": "" }
q25751
TrendMicroBaseParser._ParseTimestamp
train
def _ParseTimestamp(self, parser_mediator, row): """Provides a timestamp for the given row. If the Trend Micro log comes from a version that provides a POSIX timestamp, use that directly; it provides the advantages of UTC and of second precision. Otherwise fall back onto the local-timezone date and tim...
python
{ "resource": "" }
q25752
TrendMicroBaseParser._ConvertToTimestamp
train
def _ConvertToTimestamp(self, date, time): """Converts date and time strings into a timestamp. Recent versions of Office Scan write a log field with a Unix timestamp. Older versions may not write this field; their logs only provide a date and a time expressed in the local time zone. This functions hand...
python
{ "resource": "" }
q25753
VirusTotalAnalyzer._QueryHashes
train
def _QueryHashes(self, digests): """Queries VirusTotal for a specfic hashes. Args: digests (list[str]): hashes to look up. Returns: dict[str, object]: JSON response or None on error. """ url_parameters = {'apikey': self._api_key, 'resource': ',
python
{ "resource": "" }
q25754
VirusTotalAnalyzer.Analyze
train
def Analyze(self, hashes): """Looks up hashes in VirusTotal using the VirusTotal HTTP API. The API is documented here: https://www.virustotal.com/en/documentation/public-api/ Args: hashes (list[str]): hashes to look up. Returns: list[HashAnalysis]: analysis results. Raises: ...
python
{ "resource": "" }
q25755
VirusTotalAnalysisPlugin.EnableFreeAPIKeyRateLimit
train
def EnableFreeAPIKeyRateLimit(self): """Configures Rate limiting for queries to VirusTotal. The default rate limit for free VirusTotal API keys is 4 requests per minute. """
python
{ "resource": "" }
q25756
WindowsTimelinePlugin.ParseGenericRow
train
def ParseGenericRow( self, parser_mediator, query, row, **unused_kwargs): """Parses a generic windows timeline row. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. query (str): query that created the ro...
python
{ "resource": "" }
q25757
WindowsTimelinePlugin.ParseUserEngagedRow
train
def ParseUserEngagedRow( self, parser_mediator, query, row, **unused_kwargs): """Parses a timeline row that describes a user interacting with an app. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. query ...
python
{ "resource": "" }
q25758
AndroidCallPlugin.ParseCallsRow
train
def ParseCallsRow(self, parser_mediator, query, row, **unused_kwargs): """Parses a Call record row. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. query (str): query that created the row. row (sqlite3.Ro...
python
{ "resource": "" }
q25759
MacUserPlugin.Process
train
def Process(self, parser_mediator, plist_name, top_level, **kwargs): """Check if it is a valid MacOS system account plist file name. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. plist_name (str): name of th...
python
{ "resource": "" }
q25760
BaseMRUListWindowsRegistryPlugin._ParseMRUListValue
train
def _ParseMRUListValue(self, registry_key): """Parses the MRUList value in a given Registry key. Args: registry_key (dfwinreg.WinRegistryKey): Windows Registry key that contains the MRUList value. Returns: mrulist_entries: MRUList entries or None if not available. """ mrulis...
python
{ "resource": "" }
q25761
BaseMRUListWindowsRegistryPlugin._ParseMRUListKey
train
def _ParseMRUListKey(self, parser_mediator, registry_key, codepage='cp1252'): """Extract event objects from a MRUList Registry key. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. registry_key (dfwinreg.WinRegi...
python
{ "resource": "" }
q25762
DSVParser._ConvertRowToUnicode
train
def _ConvertRowToUnicode(self, parser_mediator, row): """Converts all strings in a DSV row dict to Unicode. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. row (dict[str, bytes]): a row from a DSV file, where t...
python
{ "resource": "" }
q25763
DSVParser._CreateDictReader
train
def _CreateDictReader(self, line_reader): """Returns a reader that processes each row and yields dictionaries. csv.DictReader does this job well for single-character delimiters; parsers that need multi-character delimiters need to override this method. Args: line_reader (iter): yields lines from...
python
{ "resource": "" }
q25764
DSVParser._CreateLineReader
train
def _CreateLineReader(self, file_object): """Creates an object that reads lines from a text file. The line reader is advanced to the beginning of the DSV content, skipping any header lines. Args: file_object (dfvfs.FileIO): file-like object. Returns: TextFile|BinaryLineReader: an obje...
python
{ "resource": "" }
q25765
DSVParser._HasExpectedLineLength
train
def _HasExpectedLineLength(self, file_object): """Determines if a file begins with lines of the expected length. As we know the maximum length of valid lines in the DSV file, the presence of lines longer than this indicates that the file will not be parsed successfully, without reading excessive data f...
python
{ "resource": "" }
q25766
DSVParser.ParseFileObject
train
def ParseFileObject(self, parser_mediator, file_object): """Parses a DSV text file-like object. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. file_object (dfvfs.FileIO): file-like object. Raises: U...
python
{ "resource": "" }
q25767
AmcacheParser.ParseFileObject
train
def ParseFileObject(self, parser_mediator, file_object): """Parses an Amcache.hve file for events. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. file_object (dfvfs.FileIO): file-like object. """ regf_...
python
{ "resource": "" }
q25768
NsrlsvrAnalyzer._GetSocket
train
def _GetSocket(self): """Establishes a connection to an nsrlsvr instance. Returns: socket._socketobject: socket connected to an nsrlsvr instance or None if a connection cannot be
python
{ "resource": "" }
q25769
NsrlsvrAnalyzer._QueryHash
train
def _QueryHash(self, nsrl_socket, digest): """Queries nsrlsvr for a specific hash. Args: nsrl_socket (socket._socketobject): socket of connection to nsrlsvr. digest (str): hash to look up. Returns: bool: True if the hash was found, False if not or None on error. """ try: qu...
python
{ "resource": "" }
q25770
NsrlsvrAnalyzer.Analyze
train
def Analyze(self, hashes): """Looks up hashes in nsrlsvr. Args: hashes (list[str]): hash values to look up. Returns: list[HashAnalysis]: analysis results, or an empty list on error. """ logger.debug( 'Opening connection to {0:s}:{1:d}'.format(self._host, self._port)) nsrl_...
python
{ "resource": "" }
q25771
TimeMachinePlugin.GetEntries
train
def GetEntries(self, parser_mediator, match=None, **unused_kwargs): """Extracts relevant TimeMachine entries. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. match (Optional[dict[str: object]]): keys extracted ...
python
{ "resource": "" }
q25772
TaskCacheWindowsRegistryPlugin._GetIdValue
train
def _GetIdValue(self, registry_key): """Retrieves the Id value from Task Cache Tree key. Args: registry_key (dfwinreg.WinRegistryKey): Windows Registry key. Yields: tuple: containing: dfwinreg.WinRegistryKey: Windows Registry key. dfwinreg.WinRegistryValue: Windows Registry va...
python
{ "resource": "" }
q25773
PlsRecallParser._VerifyRecord
train
def _VerifyRecord(self, pls_record): """Verifies a PLS Recall record. Args: pls_record (pls_recall_record): a PLS Recall record to verify. Returns: bool: True if this is a valid PLS Recall record, False otherwise. """ # Verify that the timestamp is no more than six years into the futur...
python
{ "resource": "" }
q25774
PlsRecallParser.ParseFileObject
train
def ParseFileObject(self, parser_mediator, file_object): """Parses a PLSRecall.dat file-like object. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. file_object (dfvfs.FileIO): a file-like object. Raises: ...
python
{ "resource": "" }
q25775
UniqueDomainsVisitedPlugin.ExamineEvent
train
def ExamineEvent(self, mediator, event): """Analyzes an event and extracts domains from it. We only evaluate straightforward web history events, not visits which can be inferred by TypedURLs, cookies or other means. Args: mediator (AnalysisMediator): mediates interactions between analy...
python
{ "resource": "" }
q25776
WinIISParser._ParseComment
train
def _ParseComment(self, structure): """Parses a comment. Args: structure (pyparsing.ParseResults): structure parsed from the log file. """ if structure[1] == 'Date:':
python
{ "resource": "" }
q25777
WinIISParser._ParseFieldsMetadata
train
def _ParseFieldsMetadata(self, structure): """Parses the fields metadata and updates the log line definition to match. Args: structure (pyparsing.ParseResults): structure parsed from the log file. """ fields = structure.fields.split(' ') log_line_structure = pyparsing.Empty() if fields[0...
python
{ "resource": "" }
q25778
WinIISParser.VerifyStructure
train
def VerifyStructure(self, parser_mediator, line): """Verify that this file is an IIS log file. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. line (str): line from a text file. Returns: bool: True i...
python
{ "resource": "" }
q25779
DockerJSONParser._GetIdentifierFromPath
train
def _GetIdentifierFromPath(self, parser_mediator): """Extracts a container or a graph ID from a JSON file's path. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. Returns: str: container or graph identifier...
python
{ "resource": "" }
q25780
DockerJSONParser._ParseLayerConfigJSON
train
def _ParseLayerConfigJSON(self, parser_mediator, file_object): """Extracts events from a Docker filesystem layer configuration file. The path of each filesystem layer config file is: DOCKER_DIR/graph/<layer_id>/json Args: parser_mediator (ParserMediator): mediates interactions between parsers ...
python
{ "resource": "" }
q25781
DockerJSONParser._ParseContainerConfigJSON
train
def _ParseContainerConfigJSON(self, parser_mediator, file_object): """Extracts events from a Docker container configuration file. The path of each container config file is: DOCKER_DIR/containers/<container_id>/config.json Args: parser_mediator (ParserMediator): mediates interactions between pars...
python
{ "resource": "" }
q25782
DockerJSONParser._ParseContainerLogJSON
train
def _ParseContainerLogJSON(self, parser_mediator, file_object): """Extract events from a Docker container log files. The format is one JSON formatted log message per line. The path of each container log file (which logs the container stdout and stderr) is: DOCKER_DIR/containers/<container_id>/<con...
python
{ "resource": "" }
q25783
DockerJSONParser.ParseFileObject
train
def ParseFileObject(self, parser_mediator, file_object): """Parses various Docker configuration and log files in JSON format. This methods checks whether the file_object points to a docker JSON config or log file, and calls the corresponding _Parse* function to generate Events. Args: parser_...
python
{ "resource": "" }
q25784
ESEDBPlugin._ConvertValueBinaryDataToUBInt64
train
def _ConvertValueBinaryDataToUBInt64(self, value): """Converts a binary data value into an integer. Args: value (bytes): binary data value containing an unsigned 64-bit big-endian integer. Returns: int: integer representation of binary data value or None if value is not set...
python
{ "resource": "" }
q25785
ESEDBPlugin._GetRecordValue
train
def _GetRecordValue(self, record, value_entry): """Retrieves a specific value from the record. Args: record (pyesedb.record): ESE record. value_entry (int): value entry. Returns: object: value. Raises: ValueError: if the value is not supported. """ column_type = record...
python
{ "resource": "" }
q25786
ESEDBPlugin._GetRecordValues
train
def _GetRecordValues( self, parser_mediator, table_name, record, value_mappings=None): """Retrieves the values from the record. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. table_name (str): name of th...
python
{ "resource": "" }
q25787
ESEDBPlugin.GetEntries
train
def GetEntries(self, parser_mediator, cache=None, database=None, **kwargs): """Extracts event objects from the database. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. cache (Optional[ESEDBCache]): cache. ...
python
{ "resource": "" }
q25788
ESEDBPlugin.Process
train
def Process(self, parser_mediator, cache=None, database=None, **kwargs): """Determines if this is the appropriate plugin for the database. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. cache (Optional[ESEDBCa...
python
{ "resource": "" }
q25789
DefaultPlugin.GetEntries
train
def GetEntries(self, parser_mediator, top_level=None, **unused_kwargs): """Simple method to exact date values from a Plist. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. top_level (dict[str, object]): plist t...
python
{ "resource": "" }
q25790
DefaultPlugin.Process
train
def Process(self, parser_mediator, plist_name, top_level, **kwargs): """Overwrite the default Process function so it always triggers. Process() checks if the current plist being processed is a match for a plugin by comparing the PATH and KEY requirements defined by a plugin. If both match processing c...
python
{ "resource": "" }
q25791
BashHistoryParser.ParseRecord
train
def ParseRecord(self, parser_mediator, key, structure): """Parses a record and produces a Bash history event. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. key (str): name of the parsed structure. struc...
python
{ "resource": "" }
q25792
BashHistoryParser.VerifyStructure
train
def VerifyStructure(self, parser_mediator, lines): """Verifies that this is a bash history file. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. lines (str): one or more lines from the text file. Returns: ...
python
{ "resource": "" }
q25793
NetworksWindowsRegistryPlugin._GetNetworkInfo
train
def _GetNetworkInfo(self, signatures_key): """Retrieves the network info within the signatures subkey. Args: signatures_key (dfwinreg.WinRegistryKey): a Windows Registry key. Returns: dict[str, tuple]: a tuple of default_gateway_mac and dns_suffix per profile identifier (GUID). "...
python
{ "resource": "" }
q25794
NetworksWindowsRegistryPlugin._ParseSystemTime
train
def _ParseSystemTime(self, byte_stream): """Parses a SYSTEMTIME date and time value from a byte stream. Args: byte_stream (bytes): byte stream. Returns: dfdatetime.Systemtime: SYSTEMTIME date and time value or None if no value is set. Raises: ParseError: if the SYSTEMTIME ...
python
{ "resource": "" }
q25795
Task.CreateRetryTask
train
def CreateRetryTask(self): """Creates a new task to retry a previously abandoned task. The retry task will have a new identifier but most of the attributes will be a copy of the previously abandoned task. Returns: Task: a task to retry a previously abandoned task. """ retry_task = Task(s...
python
{ "resource": "" }
q25796
Task.CreateTaskCompletion
train
def CreateTaskCompletion(self): """Creates a task completion. Returns: TaskCompletion: task completion attribute container. """ self.completion_time = int( time.time() * definitions.MICROSECONDS_PER_SECOND) task_completion = TaskCompletion() task_completion.aborted = self.aborted...
python
{ "resource": "" }
q25797
Task.CreateTaskStart
train
def CreateTaskStart(self): """Creates a task start. Returns: TaskStart: task start attribute container. """
python
{ "resource": "" }
q25798
ServicesPlugin.GetServiceDll
train
def GetServiceDll(self, key): """Get the Service DLL for a service, if it exists. Checks for a ServiceDLL for in the Parameters subkey of a service key in the Registry. Args: key (dfwinreg.WinRegistryKey): a Windows Registry key. Returns: str: path of the service DLL or None. """ ...
python
{ "resource": "" }
q25799
FormatSpecification.AddNewSignature
train
def AddNewSignature(self, pattern, offset=None): """Adds a signature. Args: pattern (bytes): pattern of the signature. offset (int): offset of the signature. None is used to indicate the signature has no offset. A positive offset is relative from
python
{ "resource": "" }