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

[Fix] Error when installing Scapy + tcpdump missing #141

Closed
4 of 9 tasks
Keiishu opened this issue Jul 27, 2019 · 5 comments
Closed
4 of 9 tasks

[Fix] Error when installing Scapy + tcpdump missing #141

Keiishu opened this issue Jul 27, 2019 · 5 comments
Assignees

Comments

@Keiishu
Copy link

Keiishu commented Jul 27, 2019

Put an x into all the boxes [ ] relevant to your issue (like this: [x])

What is the purpose of your issue?

  • Bug report (encountered problems with amazon-dash)
  • Feature request (request for a new functionality)
  • Question
  • Other

Guideline for bug reports

  • amazon-dash version: 1.3.2
  • Python version: 3.7.3
  • Pip & Setuptools version: 18.1
  • Operating System: Raspbian Buster Lite on a Raspi 3B+ (1.2)
  • The pip install or setup install command has been completed without errors
  • The python -m amazon_dash.install command has been completed without errors
  • The amazon-dash discovery command works without errors
  • I have created/edited the configuration file
  • Amazon-dash service or amazon-dash --debug run works

Description

  • At the end of the installation of Amazon-Dash with sudo pip3 install amazon-dash, there's an error message caused by the installation of Scapy, including a certain LICENSE file.
    error: [Errno 2] No such file or directory: 'LICENSE'

  • When trying to run sudo amazon-dash discovery, an error message appears :

  File "/usr/local/bin/amazon-dash", line 6, in <module>
    catch(cli)()
  File "/usr/local/lib/python3.7/dist-packages/amazon_dash/exceptions.py", line 91, in wrap
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/amazon_dash/management.py", line 127, in discovery
    discover(interface)
  File "/usr/local/lib/python3.7/dist-packages/amazon_dash/discovery.py", line 98, in discover
    scan_devices(discovery_print, lfilter=lambda d: d.src not in mac_id_list, iface=interface)
  File "/usr/local/lib/python3.7/dist-packages/amazon_dash/scan.py", line 27, in scan_devices
    lfilter=lfilter, iface=iface)
  File "/usr/local/lib/python3.7/dist-packages/scapy/sendrecv.py", line 971, in sniff
    sniffer._run(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/scapy/sendrecv.py", line 841, in _run
    *arg, **karg)] = iface
  File "/usr/local/lib/python3.7/dist-packages/scapy/arch/linux.py", line 458, in __init__
    attach_filter(self.ins, filter, iface)
  File "/usr/local/lib/python3.7/dist-packages/scapy/arch/linux.py", line 143, in attach_filter
    bp = compile_filter(bpf_filter, iface)
  File "/usr/local/lib/python3.7/dist-packages/scapy/arch/common.py", line 152, in compile_filter
    raise Scapy_Exception("tcpdump is not available. Cannot use filter !")
scapy.error.Scapy_Exception: tcpdump is not available. Cannot use filter !

What I did to get it working

Assuming you're on a Debian-based distro or just using the apt package manager + using Python 3.x . Otherwise, you need to adapt these commands to your configuration.

  • This is apparently a known issue with the latest stable version of Scapy. At this day, the way to install it properly is to get the latest Release Candidate (v2.4.3rc3 at this moment).
    sudo pip3 install --pre scapy

  • This is also a known issue here (Can't run discovery: tcpdump is not available #125) but I repost it here as a "bump", a little reminder, because it's only one little package missing.
    sudo apt install tcpdump

@Nekmo Nekmo self-assigned this Jul 27, 2019
@Nekmo Nekmo added the bug label Jul 27, 2019
@Nekmo
Copy link
Owner

Nekmo commented Jul 27, 2019

I didn't know this problem with Scapy. Apparently it only happens in Raspberry PI. I can try to force a fixed version of Scapy, but it should not be forced on other architectures without this error.

secdev/scapy#1864

I will study the best way to solve this issue. Thanks!

@Nekmo Nekmo added the Setup label Jul 27, 2019
@Keiishu
Copy link
Author

Keiishu commented Jul 27, 2019

I didn't know it was only the RPi either lmao
No problem and many thanks for your work!

@Nekmo
Copy link
Owner

Nekmo commented Jul 31, 2019

Same error on x86_64:

Collecting scapy
  Using cached https://files.pythonhosted.org/packages/d0/04/b8512e5126a1816581767bf95cbf525e0681a22c055bcd45f47ecff60170/scapy-2.4.2.tar.gz
...
  error: [Errno 2] No such file or directory: 'LICENSE'
  ----------------------------------------
  ERROR: Failed building wheel for scapy
  Running setup.py clean for scapy
Failed to build scapy
Installing collected packages: scapy
  Running setup.py install for scapy ... done
Successfully installed scapy-2.4.2
(tmp-f5b3f44388f340c) [nekmo@homura ~/.virtualenvs/tmp-f5b3f44388f340c]$ pip install scapy

Nekmo added a commit that referenced this issue Jul 31, 2019
@Nekmo
Copy link
Owner

Nekmo commented Jul 31, 2019

Fixed. Thanks!

@Nekmo Nekmo closed this as completed Jul 31, 2019
@gpotter2
Copy link
Contributor

FTR we ended up removing the tcpdump dependency by using libpcap directly (secdev/scapy#2336).

This is not included in a release as of today (will be in 2.4.4+)

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

No branches or pull requests

3 participants