Skip to content

Commit

Permalink
fixing kerberos targets
Browse files Browse the repository at this point in the history
  • Loading branch information
SkelSec committed Jan 22, 2024
1 parent a701a6a commit 5f14769
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pypykatz/kerberos/kerberos.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,22 @@ def generate_targets(targets, realm = None, to_spn = True):
"""
Takes a list of files or strings and generates a list of targets in <username>@<realm> format
"""
results = []
for target in targets:
target = target.strip()
try:
open(target, 'r')
except:
x = process_target_line(target, realm = realm, to_spn = to_spn)
if x:
yield x
results.append(x)
else:
with open(target, 'r') as f:
for line in f:
x = process_target_line(line, realm = realm, to_spn = to_spn)
if x:
yield x
results.append(x)
return results

def process_keytab(keytablfile):
with open(keytablfile, 'rb') as f:
Expand Down

0 comments on commit 5f14769

Please sign in to comment.