root@kali:/home/kali/Desktop# pip install NetfilterQueue
Collecting NetfilterQueue
Using cached NetfilterQueue-0.8.1.tar.gz (58 kB)
Building wheels for collected packages: NetfilterQueue
Building wheel for NetfilterQueue (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6ltnc7gf/netfilterqueue/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6ltnc7gf/netfilterqueue/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-v0vd42ah
cwd: /tmp/pip-install-6ltnc7gf/netfilterqueue/
Complete output (13 lines):
running bdist_wheel
running build
running build_ext
skipping 'netfilterqueue.c' Cython extension (up-to-date)
building 'netfilterqueue' extension
creating build
creating build/temp.linux-x86_64-3.8
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.8 -c netfilterqueue.c -o build/temp.linux-x86_64-3.8/netfilterqueue.o
netfilterqueue.c:437:10: fatal error: libnfnetlink/linux_nfnetlink.h: No such file or directory
437 | #include "libnfnetlink/linux_nfnetlink.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for NetfilterQueue
Running setup.py clean for NetfilterQueue
Failed to build NetfilterQueue
DEPRECATION: Could not build wheels for NetfilterQueue which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368.
Installing collected packages: NetfilterQueue
Running setup.py install for NetfilterQueue ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6ltnc7gf/netfilterqueue/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6ltnc7gf/netfilterqueue/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-qodwn5k_/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/NetfilterQueue
cwd: /tmp/pip-install-6ltnc7gf/netfilterqueue/
Complete output (13 lines):
running install
running build
running build_ext
skipping 'netfilterqueue.c' Cython extension (up-to-date)
building 'netfilterqueue' extension
creating build
creating build/temp.linux-x86_64-3.8
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.8 -c netfilterqueue.c -o build/temp.linux-x86_64-3.8/netfilterqueue.o
netfilterqueue.c:437:10: fatal error: libnfnetlink/linux_nfnetlink.h: No such file or directory
437 | #include "libnfnetlink/linux_nfnetlink.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6ltnc7gf/netfilterqueue/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6ltnc7gf/netfilterqueue/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-qodwn5k_/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/NetfilterQueue Check the logs for full command output.
我尝试了 apt-get install build-essential python3-dev libnetfilter-queue-dev 但后来我明白了
root@kali:/home/kali/Desktop# apt-get install build-essential python3-dev libnetfilter-queue-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libnetfilter-queue-dev
我正在尝试为 python3 安装 netfilterqueue 库,但我无法安装 netfilter 队列,有什么帮助吗?我尝试安装 livnetfilter 队列,但它也不起作用,我在网上搜索但找不到任何东西。有什么问题
你好,首先在你的 Linux 机器上安装 netfilterqueue
sudo apt install libnfnetlink-dev libnetfilter-queue-dev
那么你应该知道 python3+ 的 netfilterqueue 被命名为 nfqp3 所以安装它
pip3 install nfqp3
值得一提的是,在 python 脚本中导入它时,您应该将其导入为 netfilterqueue 而不是 nfqp3
在这方面进行了大量研究后,我发现 scapy 在 python-python2 中不能很好地工作,而 netfilterqueue 在 python3 中不能很好地工作,无需降级语言我可以实现这一点,我建议您纠正任何其他错误,执行 << dpkg - configure -a > > 然后 << apt-get update >>,因为此版本是无人值守的,并且可能会在您的存储库列表中生成损坏的包
安装 python3-pip git libnfnetlink-dev libnetfilter-queue-dev
pip3 install -U git+https://github.com/kti/python-netfilterqueue
从源安装:
$ git clone [email protected]:kti/python-netfilterqueue.git
cd python-netfilterqueue
python setup.py install
我在 Windows 机器和 Linux 虚拟机上安装 netfilterqueue 时遇到了同样的问题。
对我有用的是:
apt-get install build-essential python3-dev libnetfilter-queue-dev
这是在 Debian 或 Ubuntu 上安装使用 netfilter 的先决条件
接下来通过 pip 安装只需编写
pip install NetfilterQueue