Last active
February 4, 2020 17:38
-
-
Save cetaSYN/06ec294017c0013960aa5baf3b95fe13 to your computer and use it in GitHub Desktop.
SANS Holiday Hack 2019 Objective 3 - Password Spray
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
# SANS Holiday Hack 2019 Objective 3 - Password Spray | |
# Dependency: python-evtx | |
import Evtx.Evtx as evtx | |
import Evtx.Views as e_views | |
import re | |
target_fields = ['EventID','TimeCreated','Computer','LogonType','TargetUserName','IpAddress'] | |
output = [] | |
with evtx.Evtx('Security.evtx') as log: | |
for record in log.records(): | |
output.append(record.xml()) | |
for row in output: | |
if re.search('.*>(4624|4625|4648)</.*', row): | |
lines = row.split('\n') | |
for line in lines: | |
if any(fields in line for fields in target_fields): | |
print(line) | |
print('\n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Simply filters the log to relevant info, not the solution.
Produces a LOT of results.
Here's what we're looking for: