DNSChef
DNSChef is a highly configurable DNS proxy for penetration testers and malware analysts. It allows faking DNS responses to redirect traffic to local machines for analysis and interception.
Description
DNSChef is a DNS proxy (aka 'Fake DNS') used for application network traffic analysis and other penetration testing purposes. It enables testers to spoof DNS responses, such as redirecting requests for specific domains like 'badguy.com' to a local machine instead of real Internet hosts. This facilitates traffic interception, termination, and detailed examination of network behavior.
The tool is particularly valuable for penetration testers and malware analysts who need fine-grained control over DNS replies. Users can configure which domains receive fake responses and which are proxied to real DNS servers. To utilize DNSChef, the target environment's DNS server must be manually configured or poisoned to point to the DNSChef instance, requiring root privileges for operation on privileged ports.
DNSChef supports both IPv4 and IPv6 spoofing, custom nameservers, and logging capabilities, making it versatile for various testing scenarios.
How It Works
DNSChef operates as a DNS proxy that listens on a specified interface (default 127.0.0.1) and intercepts DNS queries. It matches queries against configured fake domains and responds with spoofed records like custom IP (--fakeip) or IPv6 (--fakeipv6) addresses. Unmatched queries are proxied to specified nameservers (default 8.8.8.8) for legitimate resolution. The tool requires root privileges to bind to port 53 and supports parameters for domain-specific spoofing, true resolution bypasses, and activity logging.
Installation
sudo apt install dnschefFlags
Examples
dnschefdnschef -hdnschef --fakedomains thesprawl.org,google.comdnschef --truedomains thesprawl.org,google.comdnschef --fakeip 192.0.2.1dnschef --fakeipv6 2001:db8::1dnschef --nameservers 8.8.8.8,4.2.2.1dnschef --logfile /var/log/dnschef.log