NetfilterQueue

Python bindings for libnetfilter_queue
Download

NetfilterQueue Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Publisher Name:
  • Matthew Fox
  • Publisher web site:
  • http://kerkhofftech.ca

NetfilterQueue Tags


NetfilterQueue Description

Python bindings for libnetfilter_queue NetfilterQueue is a module that provides access to packets matched by an iptables rule in Linux. Packets so matched can be accepted, dropped, altered, or given a mark.Libnetfilter_queue (the netfilter library, not this module) is part of the Netfilter project.Installation:NetfilterQueue is a C extention module that links against libnetfilter_queue. Before installing, ensure you have:1. A C compiler2. Python development files3. Libnetfilter_queue development files and associated dependenciesOn Debian or Ubuntu, these files are install with:sudo apt-get install build-essential python-dev libnetfilter-queue-devFrom PyPITo install from PyPI by pip:pip install NetfilterQueueFrom sourceTo install from source:wget http://pypi.python.org/packages/source/N/NetfilterQueue/NetfilterQueue-0.1.tar.gztar -xvzf NetfilterQueue-0.1.tar.gzcd NetfilterQueue-0.1python setup.py installSetup will use Cython if it is installed, regenerating the .c source from the .pyx before compiling the .so.Usage:Now route packets to the queue:# iptables -I INPUT -p tcp --dport 80 -j NFQUEUE --queue-num 1The only special part of the rule is the target. Rules can have any match and can be added to any table or chain.Valid queue numbers are integers from 0 to 65,536 inclusive. Requirements: · Python Limitations: · compiled to max 2048-byte packets, so won't work on LO? · full API not implemented: omits set_payload(), interface methods, and what else?


NetfilterQueue Related Software