forked from log2timeline/plaso
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrated plaso timestamp to dfdatetime for SQLite plugins log2timelin…
- Loading branch information
1 parent
56eb178
commit 407dd33
Showing
39 changed files
with
1,566 additions
and
1,491 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
|
||
from plaso.formatters import interface | ||
from plaso.formatters import manager | ||
from plaso.lib import errors | ||
|
||
|
||
__author__ = 'David Nides ([email protected])' | ||
|
@@ -25,6 +26,53 @@ class GDriveCloudEntryFormatter(interface.ConditionalEventFormatter): | |
SOURCE_LONG = u'Google Drive (cloud entry)' | ||
SOURCE_SHORT = u'LOG' | ||
|
||
# The following definition for values can be found on Patrick Olson's blog: | ||
# http://www.sysforensics.org/2012/05/google-drive-forensics-notes.html | ||
_DOC_TYPES = { | ||
0: u'FOLDER', | ||
1: u'FILE', | ||
2: u'PRESENTATION', | ||
3: u'UNKNOWN', | ||
4: u'SPREADSHEET', | ||
5: u'DRAWING', | ||
6: u'DOCUMENT', | ||
7: u'TABLE', | ||
} | ||
|
||
def GetMessages(self, unused_formatter_mediator, event): | ||
"""Determines the formatted message strings for an event object. | ||
Args: | ||
formatter_mediator (FormatterMediator): mediates the interactions between | ||
formatters and other components, such as storage and Windows EventLog | ||
resources. | ||
event (EventObject): event. | ||
Returns: | ||
tuple(str, str): formatted message string and short message string. | ||
Raises: | ||
WrongFormatter: if the event object cannot be formatted by the formatter. | ||
""" | ||
if self.DATA_TYPE != event.data_type: | ||
raise errors.WrongFormatter(u'Unsupported data type: {0:s}.'.format( | ||
event.data_type)) | ||
|
||
event_values = event.CopyToDict() | ||
|
||
document_type = event_values.get(u'document_type', None) | ||
if document_type: | ||
event_values[u'document_type'] = self._DOC_TYPES.get( | ||
document_type, u'UNKNOWN') | ||
|
||
shared = event_values.get(u'shared', False) | ||
if shared: | ||
event_values[u'shared'] = u'Shared' | ||
else: | ||
event_values[u'shared'] = u'Private' | ||
|
||
return self._ConditionalFormatMessages(event_values) | ||
|
||
|
||
class GDriveLocalEntryFormatter(interface.ConditionalEventFormatter): | ||
"""Formatter for a Google Drive snapshot local event.""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.