Skip to content

Exception while trying to sniff packets #177

@achanda

Description

@achanda

I'm trying to use scapy to sniff packets, here is what I get

>>> sniff(filter="icmp and host 66.35.250.151", count=2)
WARNING: fileno: pcapy API does not permit to get capure file descriptor. Bugs ahead! Press Enter to trigger packet reading
WARNING: fileno: pcapy API does not permit to get capure file descriptor. Bugs ahead! Press Enter to trigger packet reading

WARNING: Unable to guess datalink type (interface=None linktype=0). Using Raw
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/usr/local/lib/python2.7/site-packages/scapy/sendrecv.py", line 586, in sniff
    p = s.recv(MTU)
  File "/usr/local/lib/python2.7/site-packages/scapy/arch/pcapdnet.py", line 145, in recv
    pkt = self.ins.next()
  File "/usr/local/lib/python2.7/site-packages/scapy/arch/pcapdnet.py", line 92, in next
    s,us = h.getts()
AttributeError: 'NoneType' object has no attribute 'getts'

Here are the versions

$ pip show scapy

---
Metadata-Version: 2.0
Name: scapy
Version: 2.3.2
Summary: Scapy: interactive packet manipulation tool
Home-page: http://www.secdev.org/projects/scapy
Author: Philippe BIONDI
Author-email: phil(at)secdev.org
Installer: pip
License: GPLv2
Location: /usr/local/lib/python2.7/site-packages
Requires: 
Classifiers:
$ pip show pcapy

---
Metadata-Version: 2.0
Name: pcapy
Version: 0.10.10
Summary: Python pcap extension
Home-page: https://github.com/CoreSecurity/pcapy
Author: CORE Security
Author-email: oss@coresecurity.com
Installer: pip
License: Apache modified
Location: /usr/local/lib/python2.7/site-packages
Requires: 
Classifiers:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions