Skip to content

Commit

Permalink
Merge pull request #23 from stratosphereips/bugfix_parse-dhcp-log-header
Browse files Browse the repository at this point in the history
Bugfix parse dhcp log header
  • Loading branch information
verovaleros authored May 21, 2023
2 parents 395bbb4 + a4a33a1 commit c47d0e1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions zeek-files-labeler.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def define_columns(headerline, filetype):
column_idx['detailedlabel'] = False
column_idx['fingerprint'] = False
column_idx['id'] = False
column_idx['uids'] = False

try:
if 'csv' in filetype or 'tab' in filetype:
Expand Down Expand Up @@ -186,6 +187,8 @@ def define_columns(headerline, filetype):
column_idx['label'] = nline.index(field)
elif 'fingerprint' in field.lower():
column_idx['fingerprint'] = nline.index(field)
elif 'uids' in field.lower():
column_idx['uids'] = nline.index(field)
elif 'id' in field.lower():
column_idx['id'] = nline.index(field)
elif 'json' in filetype:
Expand Down Expand Up @@ -704,10 +707,12 @@ def process_zeekfolder():

# Read column values from the zeek line
try:
if zeekfile_name != 'files.log':
uid = line_values[column_idx['uid']]
elif zeekfile_name == 'files.log':
if zeekfile_name == 'files.log':
uid = line_values[column_idx['conn_uids']]
elif zeekfile_name == 'dhcp.log':
uid = line_values[column_idx['uids']]
else:
uid = line_values[column_idx['uid']]

lines_labeled += 1

Expand Down

0 comments on commit c47d0e1

Please sign in to comment.