solve (469B)
1#!/usr/bin/env python3 2 3from base64 import b64decode 4import subprocess 5import requests 6import re 7 8packet_filter = "ip.src_host == 192.168.178.21 && ip.dst_host == 45.142.177.160 && tcp.flags.syn == 1" 9cmd = f"tshark -nr intro-forensics-2.pcapng -Y '{packet_filter}' -T fields -e tcp.dstport" 10ports = subprocess.check_output(cmd, shell=True).decode().split("\n") 11ports = b"".join([int.to_bytes(int(p), 2, "big") for p in ports if p.strip() != ""]) 12print(ports.decode())