kamene icon indicating copy to clipboard operation
kamene copied to clipboard

RandNum & int

Open qutorial opened this issue 8 years ago • 1 comments

fuzz(IP()).show()

[ IP ]

version = 5 ihl = None tos = 218 len = None id = 57219 Traceback (most recent call last): File "", line 1, in File "/home/zaur/diode/smtests/env/lib/python3.5/site-packages/scapy/packet.py", line 863, in show reprval = f.i2repr(self,fvalue) File "/home/zaur/diode/smtests/env/lib/python3.5/site-packages/scapy/fields.py", line 893, in i2repr if x & 1: TypeError: unsupported operand type(s) for &: 'RandNum' and 'int'

qutorial avatar Aug 22 '16 16:08 qutorial

I was able to reproduce the bug fairly easily on Ubuntu 16.0.4 using Python 3.5.2 as shown below. reproducing the bug

I then ran a regular IP().show() just for a comparison. an interesting observation

It was here that I observed that the flags field was empty or not being set. flags not set

On a whim I tried fuzz(IP()).show() again, though this time I manually set the flags instead of letting them be randomly set by fuzz. The result was that this time the function succeeded in printing the packet as shown below.

works fine when flags are set works fine when flags are set second example

TheRealTaiLopez avatar Aug 25 '16 15:08 TheRealTaiLopez