/usr/lib/python2.7/dist-packages/rekall/plugins/response/renderers.py is in python-rekall-core 1.6.0+dfsg-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | # Rekall Memory Forensics
# Copyright 2016 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
__author__ = "Michael Cohen <scudette@google.com>"
from rekall import utils
from rekall.ui import text
from rekall.plugins.renderers import data_export
class FileSpec_Text(text.TextObjectRenderer):
renders_type = "FileSpec"
def render_row(self, target, width=None, **_):
if target.filesystem == "API":
return text.Cell(unicode(target.name), width=width)
else:
return text.Cell(u"%s (%s)" % (target.name, target.filesystem),
width=width)
class FileInformation_TextObjectRenderer(text.TextObjectRenderer):
renders_type = "FileInformation"
def render_row(self, target, **options):
return FileSpec_Text(
renderer=self.renderer, session=self.session).render_row(
target.filename, **options)
class UserTextObjectRenderer(text.TextObjectRenderer):
renders_type = "User"
def render_row(self, item, **_):
if item.username:
return text.Cell(u"%s (%s)" % (item.username, item.uid))
return text.Cell(unicode(item.uid))
class GroupTextObjectRenderer(text.TextObjectRenderer):
renders_type = "Group"
def render_row(self, item, **_):
if item.group_name:
return text.Cell(u"%s (%s)" % (item.group_name, item.gid))
return text.Cell(unicode(item.gid))
class DataExportFileSpecObjectRenderer(
data_export.DataExportBaseObjectRenderer):
renders_type = "FileSpec"
def Summary(self, item, **_):
return utils.SmartStr(item)
def GetState(self, item, **options):
return dict(filesystem=item.filesystem, name=item.name)
class PermissionsFileSpecObjectRenderer(
data_export.DataExportBaseObjectRenderer):
renders_type = "Permissions"
def Summary(self, item, **_):
return utils.SmartStr(item)
def GetState(self, item, **options):
return dict(perm=str(item), int_perm=int(item))
class LiveProcessTextRenderer(text.TextObjectRenderer):
renders_type = "LiveProcess"
def render_row(self, target, width=None, **_):
return text.Cell("%s (%s)" % (target.name, target.pid), width=width)
class LiveProcessDataExportRenderer(
data_export.DataExportBaseObjectRenderer):
renders_type = "LiveProcess"
def GetState(self, item, **_):
return item.as_dict()
|