kamene
kamene copied to clipboard
When try d[1] IndexError: list index out of range
In [4]: d = sniff(iface='wlan1mon') ^C In [5]: d Out[5]: <Sniffed: TCP:0 UDP:0 ICMP:0 Other:97>
In [6]: d[10] Out[6]: --------------------------------------------------------------------------- IndexError Traceback (most recent call last) /usr/lib/python3/dist-packages/IPython/core/formatters.py in call(self, obj) 670 type_pprinters=self.type_printers, 671 deferred_pprinters=self.deferred_printers) --> 672 printer.pretty(obj) 673 printer.flush() 674 return stream.getvalue()
/usr/lib/python3/dist-packages/IPython/lib/pretty.py in pretty(self, obj) 381 if callable(meth): 382 return meth(obj, self, cycle) --> 383 return _default_pprint(obj, self, cycle) 384 finally: 385 self.end_group()
/usr/lib/python3/dist-packages/IPython/lib/pretty.py in _default_pprint(obj, p, cycle) 501 if _safe_getattr(klass, 'repr', None) not in baseclass_reprs: 502 # A user-provided repr. Find newlines and replace them with p.break() --> 503 _repr_pprint(obj, p, cycle) 504 return 505 p.begin_group(1, '<')
/usr/lib/python3/dist-packages/IPython/lib/pretty.py in repr_pprint(obj, p, cycle) 699 """A pprint that just redirects to the normal repr function.""" 700 # Find newlines and replace them with p.break() --> 701 output = repr(obj) 702 for idx,output_line in enumerate(output.splitlines()): 703 if idx:
/usr/local/lib/python3.5/dist-packages/scapy/packet.py in repr(self) 259 continue 260 if f.name in self.fields: --> 261 val = f.i2repr(self, self.fields[f.name]) 262 elif f.name in self.overloaded_fields: 263 val = f.i2repr(self, self.overloaded_fields[f.name])
/usr/local/lib/python3.5/dist-packages/scapy/fields.py in i2repr(self, pkt, x) 903 if x & 1: 904 if self.multi: --> 905 r += [ self.names[i] ] 906 else: 907 r += self.names[i]
IndexError: list index out of range
This seems to happen on Linux for me, but not on OS X - even running the same version of scapy and the same version of Python.
Hi there, Also happens on linux for me - seems to only happen when trying to print RadioTap dummy layer.
>>>pkts=sniff(iface = 'mon0', count=10)
>>> pkts[0].show()
###[ RadioTap dummy ]###
version= 0
pad= 0
len= 36
present= TSFT+Flags+Rate+Channel+dBm_AntSignal+RX_Flags+Reset+Ext
tsft= 2080
flags= short+WEP+failed+HT
rate= 31
channel_freq= 56593
channel_flags= b0+b1+b2
dbm_antsignal= 0
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/local/lib/python3.5/dist-packages/scapy/packet.py", line 869, in show
reprval = f.i2repr(self,fvalue)
File "/usr/local/lib/python3.5/dist-packages/scapy/fields.py", line 905, in i2repr
r += [ self.names[i] ]
IndexError: list index out of range```