Created
January 7, 2020 04:35
-
-
Save cetaSYN/6dc35608567b30edd445a2becd0ed264 to your computer and use it in GitHub Desktop.
SANS Holiday Hack 2019 Objective 4 - Determine Technique
This file contains hidden or 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
#!/usr/bin/env python3 | |
# SANS Holiday Hack 2019 Objective 4 - Determine Technique | |
import json | |
from datetime import datetime, timedelta | |
def pprint(s): | |
return json.dumps(json.loads(str(s).replace('"', '\\"').replace("'", '"')), indent=2) | |
with open('sysmon-data.json') as f: | |
data = json.loads(f.read()) | |
data.sort(key=lambda x: x['timestamp'], reverse=True) | |
for i in data: | |
i['timestamp'] = (datetime(1601, 1, 1) + timedelta(microseconds=i['timestamp']//10)).isoformat() | |
for i in range(len(data)): | |
index = data[i] | |
at = index.get('parent_process_name') | |
if at is not None: | |
if 'lsass' in at.lower(): | |
print("{}\n{}\n{}".format( | |
pprint(data[i-2]), | |
pprint(data[i-1]), | |
pprint(index), | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output we're looking for:
Lucky that they're so close and we didn't have to actually match things up much