Could anyone help me, please?
I wrote the same code:
from netfilterqueue import NetfilterQueue
def print_and_accept(pkt):
print(pkt)
pkt.accept()
nfqueue = NetfilterQueue()
nfqueue.bind(1, print_and_accept)
try:
nfqueue.run()
except KeyboardInterrupt:
print('')
nfqueue.unbind()
Before push the run button I wrote
iptables -I FORWARD -j NFQUEUE --queue-num 0
I tried to write INPUT and OUTPUT instead FORWARD; and change --queue-num
1,2,3...
When I write python3 net_cut.py
nothing happens and then pushing CTRL + C
I get a message:
^CTraceback (most recent call last):
File "PycharmProjects/net_cut/net_cut.py", line 12, in <module>
nfqueue.run()
KeyboardInterrupt