This repository has been archived by the owner on Oct 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Review URL: https://codereview.appspot.com/297430043 .
- Loading branch information
Showing
3 changed files
with
52 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,14 +18,14 @@ | |
"""Miscelaneous information gathering plugins.""" | ||
|
||
__author__ = "Michael Cohen <[email protected]>" | ||
|
||
import hashlib | ||
import re | ||
|
||
# pylint: disable=protected-access | ||
from rekall import obj | ||
from rekall import utils | ||
from rekall.plugins import core | ||
from rekall.plugins.overlays import basic | ||
from rekall.plugins.windows import common | ||
|
||
|
||
|
@@ -337,7 +337,6 @@ def FileNameWithDrive(self, path): | |
# First normalize the path. | ||
try: | ||
path = self.ResolveSymlinks(path) | ||
|
||
for prefix, drive_letter in self.session.GetParameter( | ||
"drive_letter_device_map").iteritems(): | ||
prefix = self.ResolveSymlinks(prefix) | ||
|
@@ -431,3 +430,28 @@ def render(self, renderer): | |
|
||
seen = set() | ||
self._render_directory(root, renderer, seen) | ||
|
||
|
||
class WindowsTimes(common.WindowsCommandPlugin): | ||
"""Return current time, as known to the kernel.""" | ||
|
||
name = "times" | ||
|
||
table_header = [ | ||
dict(name="Times"), | ||
] | ||
|
||
def collect(self): | ||
kuser_shared = self.session.address_resolver.get_constant_object( | ||
"nt!KI_USER_SHARED_DATA", "_KUSER_SHARED_DATA") | ||
|
||
seconds_since_boot = self.session.plugins.imageinfo().GetBootTime( | ||
kuser_shared) | ||
|
||
kernel_time = kuser_shared.SystemTime | ||
boot_timestamp = basic.UnixTimeStamp( | ||
value=kernel_time - seconds_since_boot, | ||
session=self.session) | ||
|
||
yield [utils.AttributeDict(now=kernel_time, boot=boot_timestamp, | ||
uptime=seconds_since_boot)] |