You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Raw IP packet: b'o\x05\x05\x05\x05\x05\x05\x05\x05\x01\x05s\x05\x05\x05\x05q\x03\x05\x05\x05\x05p\x01\x05\x05'
Traceback (most recent call last):
File "/home/youwei/XDiff/Impacket/IP.py", line 22, in
ip_packet = decoder.decode(Ip_packet)
File "/home/youwei/.local/share/pipx/venvs/impacket/lib/python3.10/site-packages/impacket/ImpactDecoder.py", line 191, in decode
ip6_packet = IP6.IP6(buffer)
File "/home/youwei/.local/share/pipx/venvs/impacket/lib/python3.10/site-packages/impacket/IP6.py", line 32, in init
self.load_header(buffer)
File "/home/youwei/.local/share/pipx/venvs/impacket/lib/python3.10/site-packages/impacket/ImpactPacket.py", line 435, in load_header
aBuffer += '\x00'
TypeError: can't concat str to bytes
### PCAP
Raw IP packet: b'o\x05\x05\x05\x05\x05\x05\x05\x05\x01\x05s\x05\x05\x05\x05q\x03\x05\x05\x05\x05p\x01\x05\x05'
The text was updated successfully, but these errors were encountered:
The code is designed to handle cases where the packet length (packetlen) does not match the expected fixed size (hdr_len). When the provided aBuffer is shorter than hdr_len, the code attempts to pad aBuffer with additional bytes by appending '\x00'. This padding is meant as an error handling step to ensure aBuffer reaches the required length. However, this approach is causing a crash because aBuffer is a byte string, and appending '\x00' (a regular string) results in a TypeError, as you can't concatenate a string to a byte object.
To fix this, we need to change '\x00' to b'\x00' so that aBuffer is padded with bytes instead of a regular string. Here's how the modified code would look:
if len(aBuffer) < hdr_len:
diff = hdr_len - len(aBuffer)
for _ in range(diff):
aBuffer += b'\x00'
Configuration
impacket version: Impacket v0.12.0
Python version: Python 3.10.12
Target OS: Linux ubuntu
Debug Output With Command String
Raw IP packet: b'o\x05\x05\x05\x05\x05\x05\x05\x05\x01\x05s\x05\x05\x05\x05q\x03\x05\x05\x05\x05p\x01\x05\x05'
Traceback (most recent call last):
File "/home/youwei/XDiff/Impacket/IP.py", line 22, in
ip_packet = decoder.decode(Ip_packet)
File "/home/youwei/.local/share/pipx/venvs/impacket/lib/python3.10/site-packages/impacket/ImpactDecoder.py", line 191, in decode
ip6_packet = IP6.IP6(buffer)
File "/home/youwei/.local/share/pipx/venvs/impacket/lib/python3.10/site-packages/impacket/IP6.py", line 32, in init
self.load_header(buffer)
File "/home/youwei/.local/share/pipx/venvs/impacket/lib/python3.10/site-packages/impacket/ImpactPacket.py", line 435, in load_header
aBuffer += '\x00'
TypeError: can't concat str to bytes
The text was updated successfully, but these errors were encountered: