Testing pcapng fileformat

This commit is contained in:
Jeroen Oudshoorn
2024-01-28 22:02:57 +01:00
parent 7530709d0c
commit 7040be2d30
10 changed files with 45 additions and 54 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