Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error eve2pcap not work #66

Open
Canon88 opened this issue Jan 30, 2018 · 8 comments
Open

Error eve2pcap not work #66

Canon88 opened this issue Jan 30, 2018 · 8 comments

Comments

@Canon88
Copy link

Canon88 commented Jan 30, 2018

When I use eve2pcap, it does not work and throws the following exception.

[root@localhost bin]# python3 idstools-eve2pcap /tmp/eve.json --payload -o /tmp/tmp_pcap
b''
Traceback (most recent call last):
  File "idstools-eve2pcap", line 12, in <module>
    sys.exit(main())
  File "/usr/local/python3/lib/python3.6/site-packages/idstools/scripts/eve2pcap.py", line 227, in main
    dumper = pcap.dump_open(args.output)
  File "/usr/local/python3/lib/python3.6/site-packages/idstools/scripts/eve2pcap.py", line 116, in dump_open
    raise Exception(pcap_errbuf.value)
Exception: b''
@jasonish
Copy link
Owner

I justed tested with Python 3.6 and it works here, however, I have found that the interaction between Python, libpcap and scapy to be somewhat fragile given what version of everything is installed.

If you can provide the following, I'll look further.

  • OS, if Linux the distribution.
  • Version of idstools.
  • Idstools installed manually or with package manager

I did notice that this same error is thrown when the output file is not writable by the user, rather than giving a pretty error message. Can you check that /tmp/tmp_pcap does not exist, or is at least writeablt by you. Also make sure its not a directory.

@Canon88
Copy link
Author

Canon88 commented Jan 30, 2018 via email

@jasonish
Copy link
Owner

I've made a few fixes with respect to Python 3. Would you be willing to test?

pip3 install --upgrade https://github.com/jasonish/py-idstools/archive/master.zip

@Canon88
Copy link
Author

Canon88 commented Jan 30, 2018 via email

@Canon88
Copy link
Author

Canon88 commented Jan 30, 2018 via email

@jasonish
Copy link
Owner

jasonish commented Jan 30, 2018

Check the size of the pcap. Run it through tcpdump and see if there is anything: "tcpdump -r filename".

Also make sure your input eve.json file has "packet" and/or "payload" fields.

@Canon88
Copy link
Author

Canon88 commented Jan 30, 2018 via email

@jasonish
Copy link
Owner

You’ll need to enable the payload option in your Suricata config. Looks like you have payload_printable enabled which eve2pcap doesn’t handle. Converting it to pcap wouldn’t provide any extra value anyways, as you can see the data in it’s printable form already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants