Revert "Revert "Testing pcapng fileformat""

This reverts commit 0e274af5a0.
This commit is contained in:
Jeroen Oudshoorn
2024-02-08 22:51:57 +01:00
parent 0e274af5a0
commit ca4feb895e
9 changed files with 44 additions and 53 deletions

View File

@ -82,7 +82,7 @@ def remove_whitelisted(list_of_handshakes, list_of_whitelisted_strings, valid_on
for handshake in list_of_handshakes:
try:
normalized_handshake = normalize(os.path.basename(handshake).rstrip('.pcap'))
normalized_handshake = normalize(os.path.basename(handshake).rstrip('.pcapng'))
for whitelist in list_of_whitelisted_strings:
normalized_whitelist = normalize(whitelist)
if normalized_whitelist in normalized_handshake:
@ -440,7 +440,7 @@ def secs_to_hhmmss(secs):
def total_unique_handshakes(path):
expr = os.path.join(path, "*.pcap")
expr = os.path.join(path, "*.pcapng")
return len(glob.glob(expr))
@ -498,11 +498,11 @@ def md5(fname):
return hash_md5.hexdigest()
def extract_from_pcap(path, fields):
def extract_from_pcapng(path, fields):
"""
Search in pcap-file for specified information
Search in pcapng-file for specified information
path: Path to pcap file
path: Path to pcapng file
fields: Array of fields that should be extracted
If a field is not found, FieldNotFoundError is raised