OpenTechStrategies / streetcrm

StreetCRM is a free software contact management application
Other
5 stars 4 forks source link

rdpcap function does not work: NoneType' object is not callable #341

Closed trivox closed 6 years ago

trivox commented 6 years ago

Hello, all, My system is:

$ uname -a
Linux osboxes 4.15.5-1-ARCH #1 SMP PREEMPT Thu Feb 22 22:15:20 UTC 2018 x86_64 GNU/Linux

I build scapy from source code, revision 59098e926 (but tried also few earlier commits with same bad result). My python version is 3.6.4. I wrote this script:

#!/usr/bin/python

import sys
from scapy.utils import rdpcap
from scapy import *

pkts=rdpcap( sys.argv[1] )

I attach mytcpdump.zip file that I used for input. It opens in wireshark ok. After I try python myscript.py mytcpdump.pcap I get these messages:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/scapy/utils.py", line 894, in read_packet
    p = self.LLcls(s)
TypeError: 'NoneType' object is not callable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "rt_server.py", line 7, in <module>
    pkts=rdpcap( sys.argv[1] )  # could be used like this rdpcap("filename",500) fetches first 500 pkts
  File "/usr/lib/python3.6/site-packages/scapy/utils.py", line 720, in rdpcap
    return fdesc.read_all(count=count)
  File "/usr/lib/python3.6/site-packages/scapy/utils.py", line 905, in read_all
    res = RawPcapReader.read_all(self, count)
  File "/usr/lib/python3.6/site-packages/scapy/utils.py", line 855, in read_all
    p = self.read_packet()
  File "/usr/lib/python3.6/site-packages/scapy/utils.py", line 900, in read_packet
    p = conf.raw_layer(s)
TypeError: 'NoneType' object is not callable

Hope it could help you while i'm learning for some other pcap-replay tools!

trivox commented 6 years ago

I have no idea how I posted issue to a wrong repo O_o

cecilia-donnelly commented 6 years ago

o/ @trivox, no worries! Thanks for stopping by anyway. :)