All Projects → pynetwork → Pypcap

pynetwork / Pypcap

Licence: other
pypcap - python libpcap module, forked from code.google.com/p/pypcap, now actively maintained

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pypcap

tcpslice
tcpslice concatenates multiple pcap files together, or extracts time slices from one or more pcap files.
Stars: ✭ 48 (-81.18%)
Mutual labels:  pcap, packet-capture
Dnscap
Network capture utility designed specifically for DNS traffic
Stars: ✭ 234 (-8.24%)
Mutual labels:  pcap, packet-capture
Tcpdump
the TCPdump network dissector
Stars: ✭ 1,731 (+578.82%)
Mutual labels:  pcap, packet-capture
Node pcap
libpcap bindings for node
Stars: ✭ 849 (+232.94%)
Mutual labels:  pcap, packet-capture
Pcapplusplus
PcapPlusPlus is a multiplatform C++ library for capturing, parsing and crafting of network packets. It is designed to be efficient, powerful and easy to use. It provides C++ wrappers for the most popular packet processing engines such as libpcap, WinPcap, DPDK and PF_RING.
Stars: ✭ 1,322 (+418.43%)
Mutual labels:  networking, pcap
Homer
HOMER - 100% Open-Source SIP / VoIP Packet Capture & Monitoring
Stars: ✭ 855 (+235.29%)
Mutual labels:  pcap, packet-capture
Cuishark
A protocol analyzer like a wireshark on CUI. cuishark is using libwireshark to analyze packets. https://cuishark.slankdev.net
Stars: ✭ 208 (-18.43%)
Mutual labels:  pcap, packet-capture
Libpcap
the LIBpcap interface to various kernel packet capture mechanism
Stars: ✭ 1,785 (+600%)
Mutual labels:  pcap, packet-capture
Xdp
Package xdp allows one to use XDP sockets from the Go programming language.
Stars: ✭ 36 (-85.88%)
Mutual labels:  networking, packet-capture
Netsniff Ng
A Swiss army knife for your daily Linux network plumbing.
Stars: ✭ 915 (+258.82%)
Mutual labels:  networking, packet-capture
Scapy
Scapy: the Python-based interactive packet manipulation program & library. Supports Python 2 & Python 3.
Stars: ✭ 6,932 (+2618.43%)
Mutual labels:  pcap, packet-capture
dsc
DNS Statistics Collector
Stars: ✭ 94 (-63.14%)
Mutual labels:  pcap, packet-capture
Nfstream
NFStream: a Flexible Network Data Analysis Framework.
Stars: ✭ 622 (+143.92%)
Mutual labels:  pcap, packet-capture
Crafter
🔬 An R package to work with PCAPs
Stars: ✭ 27 (-89.41%)
Mutual labels:  pcap, packet-capture
Arkime
Arkime (formerly Moloch) is an open source, large scale, full packet capturing, indexing, and database system.
Stars: ✭ 4,994 (+1858.43%)
Mutual labels:  pcap, packet-capture
Poseidon
Poseidon is a python-based application that leverages software defined networks (SDN) to acquire and then feed network traffic to a number of machine learning techniques. The machine learning algorithms classify and predict the type of device.
Stars: ✭ 310 (+21.57%)
Mutual labels:  networking, pcap
Skydive
An open source real-time network topology and protocols analyzer
Stars: ✭ 2,086 (+718.04%)
Mutual labels:  networking, pcap
SnifferUI
基于MFC和WinPcap库开发的网络抓包和协议分析软件
Stars: ✭ 86 (-66.27%)
Mutual labels:  pcap, packet-capture
webshark
🦈 Tool for visualizing packet captures.
Stars: ✭ 41 (-83.92%)
Mutual labels:  pcap
Zeek-Network-Security-Monitor
A Zeek Network Security Monitor tutorial that will cover the basics of creating a Zeek instance on your network in addition to all of the necessary hardware and setup and finally provide some examples of how you can use the power of Zeek to have absolute control over your network.
Stars: ✭ 38 (-85.1%)
Mutual labels:  pcap

Python PCAP module

|travis| Read the Docs <http://pypcap.rtfd.org>__

This is a simplified object-oriented Python wrapper for libpcap - the current tcpdump.org version, and the WinPcap port for Windows.

Example use::

>>> import pcap
>>> sniffer = pcap.pcap(name=None, promisc=True, immediate=True, timeout_ms=50)
>>> addr = lambda pkt, offset: '.'.join(str(ord(pkt[i])) for i in range(offset, offset + 4))
>>> for ts, pkt in sniffer:
...     print('%d\tSRC %-16s\tDST %-16s' % (ts, addr(pkt, sniffer.dloff + 12), addr(pkt, sniffer.dloff + 16)))
...

Windows notes

WinPcap has compatibility issues with Windows 10, therefore it's recommended to use Npcap <https://nmap.org/npcap/>_ (Nmap's packet sniffing library for Windows, based on the WinPcap/Libpcap libraries, but with improved speed, portability, security, and efficiency). Please enable WinPcap API-compatible mode during the library installation.

Installation

This package requires:

  • libpcap-dev

  • python-dev

To install run::

pip install pypcap

Installation from sources


Please clone the sources and run::

    python setup.py install

Note for Windows users: Please download the `Npcap SDK <https://nmap.org/npcap/>`_, unpack the archive and put it into the sibling directory as ``wpdpack`` (``setup.py`` will discover it).

Sample procedure in PowerShell::

    cd ..
    wget -usebasicparsing -outfile npcap-sdk-0.1.zip https://nmap.org/npcap/dist/npcap-sdk-0.1.zip
    Expand-Archive -LiteralPath npcap-sdk-0.1.zip
    mv npcap-sdk-0.1\npcap-sdk-0.1 wpdpack
    cd pypcap
    python setup.py install


Support
-------

Visit https://github.com/pynetwork/pypcap for help!

.. |travis| image:: https://img.shields.io/travis/pynetwork/pypcap.svg
   :target: https://travis-ci.org/pynetwork/pypcap


Development notes
-----------------

Regenerating C code
~~~~~~~~~~~~~~~~~~~

The project uses Cython to generate the C code, it's recommended to install it from sources: https://github.com/cython/cython

To regenerate code please use::

    cython pcap.pyx


Building docs
~~~~~~~~~~~~~

To build docs you need the following additional dependencies::

    pip install sphinx mock sphinxcontrib.napoleon

Please use `build_sphinx` task to regenerate the docs::

    python setup.py build_sphinx
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].