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

Check for sniffer promiscuous permissions #1

Open
mjoblin opened this issue Nov 25, 2016 · 0 comments
Open

Check for sniffer promiscuous permissions #1

mjoblin opened this issue Nov 25, 2016 · 0 comments

Comments

@mjoblin
Copy link
Owner

mjoblin commented Nov 25, 2016

Attempting to run nd-snifty without permissions to enter promiscuous mode generates a stack trace. It would be nice to detect this and produce a more useful message to the user.

Here's the stack track:

Traceback (most recent call last):
  File "/usr/local/opt/python-3.5.2/lib/python3.5/multiprocessing/process.py", line 249, in _bootstrap
    self.run()
  File "/usr/local/opt/python-3.5.2/lib/python3.5/multiprocessing/process.py", line 93, in run
    self._target(*self._args, **self._kwargs)
  File "/home/pi/venv/nd/lib/python3.5/site-packages/netdumplings/console/snifty.py", line 101, in network_sniffer
    sniffer_kitchen.run()
  File "/home/pi/venv/nd/lib/python3.5/site-packages/netdumplings/dumplingkitchen.py", line 175, in run
    sniff(filter=self.filter, prn=self._process_packet, store=0)
  File "/home/pi/venv/nd/lib/python3.5/site-packages/scapy/sendrecv.py", line 572, in sniff
    s = L2socket(type=ETH_P_ALL, *arg, **karg)
  File "/home/pi/venv/nd/lib/python3.5/site-packages/scapy/arch/linux.py", line 468, in __init__
    self.ins = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, socket.htons(type))
  File "/usr/local/opt/python-3.5.2/lib/python3.5/socket.py", line 134, in __init__
    _socket.socket.__init__(self, family, type, proto, fileno)
PermissionError: [Errno 1] Operation not permitted
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

1 participant