Closed masind closed 2 years ago
Hi @masind , can you please paste your code inside a code-block ? The indentation is messed up :)
It's hard to tell from the indentation, but it looks like you're calling accept()
unconditionally, even though you've already called drop()
in some cases. Only the first verdict (of accept, drop, repeat) that you issue will have any effect, so netfilterqueue makes issuing a second verdict for the same packet an error.
import scapy.all as scapy import socket from colorama import Fore,init from dns import reversename,resolver import re init() def process_packet(packet): scapy.packet=scapy.IP(packet.get_payload()) if scapy.packet.haslayer(scapy.Raw): if scapy.packet[scapy.TCP].dport==443: tcppayload=scapy.packet[scapy.Raw].load if re.search('\x16\x03',str(tcppayload),flags=0): print("mull")
packet.drop()
queue=netfilterqueue.NetfilterQueue() queue.bind(0,process_packet) queue.run()