Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 How to extract protocol from a pcap file ?
I developed this code to extract all protocols (transport and application) from a pcap file:


def find_proto(s):
def expand(x):
    while x.payload:
        x = x.payload
if s[0]:
    proto = list(expand(s[0]))
    sProto = ["HTTP", "DNS", "ModbusADU",  "TLS", "TCP", "UDP", "FTP-DATA", "Raw"]
    for p in sProto:
        if p in proto:
            return p
    return "Unknown"
Here I limited the extract to "HTTP", "DNS", "ModbusADU", "TLS", "TCP", "UDP", "FTP-DATA", "Raw" but if I want to extract all the protocol like in wireshark

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Is there in 2018 a python3 library that implements the Internet Printing Protocol? AFoeee 1 1,185 Jun-07-2019, 08:51 AM
Last Post: heiner55
  no protocol header version error mjudhandoyo 2 3,265 Feb-03-2017, 10:35 PM
Last Post: nilamo
  accessing SOAP protocol page secured with cetrificad lopow 3 2,728 Jan-11-2017, 03:14 PM
Last Post: buran

Forum Jump:

Users browsing this thread: 1 Guest(s)