Problems with netfilerqueue (dns spoof)

So following the “learn python for ethical hacking from scratch-course”

-------------------------------------THE CODE:
#!/usr/bin/env python

import netfilterqueue
import scapy.all as scapy

def process_packet(packet):
scapy_packet = scapy.IP(packet.get_payload())
if scapy_packet.haslayer(scapy.DNSRR):
print(scapy_packet.show())
packet.accept()

queue = netfilterqueue.NetfilterQueue()
queue.bind(0, process_packet)
queue.run()


Firstly i am using these commands to setup some rules for iptables:
iptables -I OUTPUT -j NFQUEUE --queue-num 0
iptables -I INPUT -j NFQUEUE --queue-num 0

then i run my program (in python2) as Zaid does it.

But everytime i run the program i get this ERROR:

Traceback (most recent call last):
File “dnsspoof.py”, line 15, in
queue.bind(0, process_packet)
File “netfilterqueue.pyx”, line 182, in netfilterqueue.NetfilterQueue.bind (netfilterqueue.c:4388)
OSError: Failed to create queue 0.


I have tried everything: making sure it was the correct installation, i have cython installed as well and followed every single netfilter trouble shooting.

Any advice?

Try Zaid’s website forums for support:
https://zsecurity.org/forums/

Also try Zaid’s customized Kali, which will probably help with many issues:
https://zsecurity.org/download-custom-kali/

1 Like

thank you my friend :slight_smile:

I cannot post on his forum, you ahve to buy a course from the website :slight_smile:

but i will keep on fighting, and downloading his kali. and trying it out again

the funny thing is; i just downloaded Zaids kali linux version, and tried the coding. i still get the same error :stuck_out_tongue:

Hey i am stuck at the same bit . Did you solve it by any chance ?