Mr-Pepe/iscx-analysis

'PcapNgReader' object has no attribute 'read_allowed_exceptions'

Closed this issue · 4 comments

extract_flows_from_pcap.py, line 44,
read_allowed_exceptions = _main_socket.read_allowed_exceptions

AttributeError: 'PcapNgReader' object has no attribute 'read_allowed_exceptions'

Please hint.

Sorry for the late reply. Have you managed to solve your problem?

Honest I wasn't very thorough. I did a workaround. I had to fiddle with the error handling.
The issue I had was due to scapy update. Perhaps using scapy version before 2.1 still works.
But please let others know your environment requirements, that would be helpful.
Creating custom environment isn't that painstaking.

The new version of scapy sniff is handling errors differently. I have found that message in the developers discussion and version compare of source on Git. They have made changes.
My scapy.version
Out[3]: '2.4.4'
What I did:
# read_allowed_exceptions = _main_socket.read_allowed_exceptions
read_allowed_exceptions = (EOFError,)
this work-around worked, but I had to hit ctrl-C many times to end reading when pcap reading was accelerating (but not ending without another exeption).
Perhaps I should have added some condition check in a Try block, or more errors to process, like
if not read_allowed_exceptions:
read_allowed_exceptions = (IOError,EOFError,)
But I just hit the ctrl-c and went on. In a fear that I am getting some partial file read and paper submission deadline approaching, I did not use that code further, converted files to pcap and used the Flowmeter to get time agregates.

But I would like to get in touch on a topic you have described in your technical paper, which I find full of insight, please contact.

I tried looking into the problem but haven't really figured it out. Should've saved the environment I used back then..
Don't hesitate to open a pull request when you get it to work.

Also, feel free to send me an e-mail if you have questions concerning the report.

I have refactored the scripts a bit and added a requirements file. However, I have only tried the code on the pcap files from the NonVPN-PCAPs-01.zip file. If anybody has the full dataset available please let me know if everything works as expected.