Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shimcache parser #1

Merged
merged 4 commits into from
May 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions regrippy/plugins/shimcache.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from datetime import datetime

from regrippy import BasePlugin, PluginResult, mactime
from regrippy.thirdparty.ShimCacheParser import read_cache


class Plugin(BasePlugin):
"""Parse shim cache to show all executed binaries on machine"""
__REGHIVE__ = "SYSTEM"

def run(self):
key = self.open_key(self.get_currentcontrolset_path() + r"\Control\Session Manager\AppCompatCache") or \
self.open_key(self.get_currentcontrolset_path() + r"\Control\Session Manager\AppCompatibility")

if not key:
return

for entry in read_cache(key.value("AppCompatCache").value()):
res = PluginResult(key=key, value=None)
res.custom["date"] = entry[0]
if type(entry[2]) == bytes:
res.custom["path"] = entry[2].decode("utf8")
else:
res.custom["path"] = entry[2]
yield res

def display_human(self, result):
print(result.custom["date"] + "\t" + result.custom["path"])

def display_machine(self, result):
date = datetime.strptime(result.custom["date"], "%Y-%m-%d %H:%M:%S")
atime = int(date.timestamp())

print(mactime(name=result.custom["path"], mtime=result.mtime, atime=atime))
Loading