Open Abbath opened 8 months ago
Thanks for your report. Can you share a single packet that reproduce the issue?
<Ether dst=00:00:00:00:00:00 src=00:00:00:00:00:00 type=IPv4 |<IP version=4 ihl=5 tos=0x0 len=540 id=1 flags= frag=0 ttl=64 proto=udp chksum=0x78d1 src=0.0.0.0 dst=0.0.0.0 |<UDP sport=0 dport=0 len=520 chksum=0x93d8 |<Raw load='\\xb0o߂\\x98\\xbc\n\\xd8y\x14Z\\x97\x02G+m_\\xa9\\xfb\\xed&\\x90S\\xf5c:\\x98\\xf2\\xa3c0/R\\x89\\xf8\\x98\\xfd\\xc2ɒ\\\\xd1X\\x89gqQ\\x87\\xe9\x04\\x8dcI\\x80[mf\\xf3m\x1cAS\\x82y\\xc9=#\\x91\\xc7*j\\xf2\\xba|\\xb4\x0b\\\\x82/\\xf4\x1c\\xd0X\\x97\\xccoT\\xfd\\xfd[\x03G\\xb8b\\xe9N\\xc8\\\\x9f\\x9f"oq{\\xed\\xeb\\xfe\x1d?7\\xf9\\xe4N\\xf5\\xc5>\\xe5q\\x9f\\x8c9\\xac\\xb5\\xe4B\\xcal\\xab\x08\\xf4P)\\xe7\x00\\xda`\\x84q\t\\xd0\x16t \\xe6\\xaf\\xc5\x0b\\xe9\\xf6\\xa8}#{/\\xac\\xc3}\x17[6\\x97E\\x8dB\\xc7T#9\x05R?\\x97\\x87\\xc0\\xe5Vg\\x87)\\x8ab\\x92\\xc8]f\x1a\\xed\\xc0\\x8f^\\xe7鏄^\\x86q\x0f\\x96\\x84\\xa14\x13l\\xea\\xfb\x0cd\\xa2\\xcc1L\\xfdT\\x93+\\xec!b@l|\\xb3\\xedw\\xed\\x82Q\\xe7\\xeb}x\\xfcl8\\xcd̹\u05eb\\x98\\xbb\t|\\xe4\\\xc9"\\xfcy-ɤVMw]\\xfc}\x01\x17\\xc7&\x03\\xe0A\x0f\\xfd3\x06o4\\x83\\xd1]\\xa3\\xd9\'`,\\xae\\x9c\\xd4\\xfa\\x97\\x9b\x0f\\xe6\'ܡ\\xb2\\xab\\xf1\\xe3o5p\\xcds(\x119\\xb6p\\xd2_>\\xddL\\xf6M\x18}\\x92\x16moE|\x14Du\\x97-\\xf0\\xfe\\xc7\\xf7\\xe1\\xf9\\xae\\xdc-_\x05Vi\\xab\\xaa>\\xf0\\xb0\x01\\x84\\x89<Bt\\xfb\\xa7\\x8c\x01tX8*\\x92\\x95YM\\xf1\\xfb\\xc7\x13\\xc1\\xe7\\xd1%5\\xa0\\x83\\xa8}!\\xa6\\xea3\\xa8\\xc7\\xd4[\x1c\\xbc\\x98_tw\\xee)\\x92JP\\xfe\\x8c\\xcdS\\xbc\\xbc\\xa3\r\\x88\\x91͙\x19\x06\\xc5\\xfd\\xbb\x1b\x7fη\\xa7/K\\xe8lWe.\x1d"\x11\x01\\xf7\\xd7U\\xfdF\x1c\\xcbkL\\\xa2\x14g\x17\\x8f\\xb4\\x8ecn\\xa1\\xc3\\xd3Ҩ\\x9fJ\\x91\x13C\\xb7\\xb9x\\xf1R\\xae=7S\x7f\\xdd\\xd1eY\\x92H+u\\xbb\\x9ba\\xa9\\xf5\x07\\xf8\x0e#\\xcd\\xccgਁ\\xa8ۣ\\xb6\\xb3\\xc3@\x03#\\xb7\\xd9\ \r\x7f\\x9c\x04\\x9c\\xd0`\\xa4^@V\\xbf\\x96\\xb5%' |>>>>
Sorry, I cannot use this. Please share a pcap or something that we can reproduce.
Pcap is inside the example.zip
Sorry, I haven't seen the zip file in the GitHub email. What's the fix that you propose?
I propose to add some additional escaping somewhere in Packet.canvas_dump
if isinstance(fval, str):
#HERE MAYBE?
if len(fval) > 18:
fval = fval[:18] + "[...]"
else:
fval = ""
Changing PyX to unicode breaks LaTeX. Changing Packet representation in general may break something else.
I can't replicate. Your example.zip works just fine for me.
Are you doing this on Windows?
Brief description
When dumping packets with random bytes the following happens:
It seems that texenc in pyx is set to default ASCII. If I change it to 'utf-8' everything works fine.
Scapy version
2.5.0
Python version
3.10
Operating system
Kubuntu 22.04
Additional environment information
No response
How to reproduce
This will eventually fail
Actual result
Exception
Expected result
A PDF
Related resources
No response