kbandla / dpkt

fast, simple packet creation / parsing, with definitions for the basic TCP/IP protocols
Other
1.09k stars 270 forks source link

ERROR: Failed to process packet: invalid header length #457

Closed hackdefendr closed 1 year ago

hackdefendr commented 5 years ago

I am using dpkt in an application and cannot get past the below error. I know that the implementation is correct, and just cannot figure out why dpkt is complaining about invalid header length.

2019-09-10 11:13:37,729 [Processing.Pcap] ERROR: Failed to process packet: invalid header length
Traceback (most recent call last):                                                                                                                          ll
  File "/opt/CAPE/modules/processing/network.py", line 741, in run
    tcp = dpkt.tcp.TCP(tcp)                                                                                                                                 (133kB)
  File "/usr/local/lib/python2.7/dist-packages/dpkt/dpkt.py", line 84, in __init__
    self.unpack(args[0])
  File "/usr/local/lib/python2.7/dist-packages/dpkt/tcp.py", line 61, in unpack
    raise dpkt.UnpackError, 'invalid header length'
UnpackError: invalid header length

Is this something that someone can help with here? Just let me know what is needed and I will try to provide.

Notes: OS - Debian 10 DPKT versions tried: - 1.8.6.2, 1.8.7, and 1.9.2 Pcap is created with tcpdump 4.9.2

kbandla commented 5 years ago

any chance you can share the pcap?

hackdefendr commented 5 years ago

This could have something to do with other dependencies under Debian 10. When I run the application under Ubuntu 18.04, I do not get this error. Not sure if that helps.

Unfortunately, I do not have the original pcap. However I remember checking the header of the pcap in question to compare and it looked correct.

kbandla commented 5 years ago

ill run some tests on Deb 10 and see if anything is wrong.