DNS Parlor Tricks for Network Discovery

|
Updated

DNS is an amazing protocol. After starting life as a simple mechanism for name resolution, it is now used to enforce TLS rules, prevent email impersonation, authorize users, protect endpoints, enable service discovery, and much more. DNS services run across a range of devices and provide quite a bit of information about the environment, given the right queries. This post describes the techniques used by the Beta 2 version of Rumble Network Discovery to identify DNS services.

Version via TXT VERSION.BIND #

The version.bind TXT response is supported by a handful of common DNS implementations, including ISC BIND, and returns the name and version number of the service. This can be correlated against public fingerprints to determine the operating system and version. Querying this by hand is easy with dig:

$ dig version.bind txt chaos @target-dns
version.bind.           0       CH      TXT     "9.11.3-1ubuntu1.5-Ubuntu"

Hostname via TXT HOSTNAME.BIND #

The hostname.bind TXT response is less common, but supported by newer versions of ISC BIND and a few other DNS server implementations. This query returns the hostname of the DNS server itself. This is also simple to query by hand using dig:

$ dig hostname.bind txt chaos @target-dns
hostname.bind.          0       CH      TXT     "ns01"

Internet A Query #

Rumble will send an A record lookup for a common internet domain name.This lookup returns the resolved address for the name, indicating whether a DNS-based captive portal is in place, and whether DNS queries are being modified. This lookup is equivalent the following command:

$ dig www.google.com A @target-dns
www.google.com.         30      IN      A       172.217.8.164

Destination PTR Lookup #

In addition to queries above, Rumble will ask the server for a PTR record for it's own IPv4 address. This can return the internally-configured hostname of the server, making identification more accurate, especially when normal reverse DNS and the hostname.bind result is not available. An example of doing this query using the dig command:

$ dig 254.0.168.192.in-addr.arpa PTR @target-dns
254.0.168.192.in-addr.arpa.   20384   IN      PTR     firewall.lab.

Trace Request to rumble.network #

Rumble will send a DNS query for a randomized subdomain of rumble.network with the destination server address and timestamp encoded into the request. A custom DNS server handles these requests, echoes the timestamp, and returns the IP addresses of the requesting DNS resolvers back to the server, which forwards it on to the Rumble scan engine. This process acts as a DNS traceroute and can identify problems with the destination server's performance and configuration. The DNS service details within the Rumble console will show the upstream resolvers:

DNS Upstream Resolver Detection

EDNS0 Request to rumble.network #

Rumble will send a second DNS query for a randomized subdomain of rumble.network, identical to the first, except using a different prefix (e0 vs t0) and with the EDNS0 flag set. If the destination server supports the Client Subnet extension, this will be sent to the rumble.network DNS server, which will encode the received subnet information back into the response. This can identify the egress network used by the DNS server, which can be helpful when diagnosing configuration issues. An example

DNS Client Subnet Detection

Continuing Work #

The five queries described above are designed to be safe and informative, but are just the beginning of Rumble's support for DNS. We are continuing to look into service discovery and specific product fingerprinting that would help with asset identication and inventory. If you haven't had a chance to try runZero yet, please give it a shot and share your thoughts.

Written by HD Moore

HD Moore is the founder and CEO of runZero. Previously, he founded the Metasploit Project and served as the main developer of the Metasploit Framework, which is the world's most widely used penetration testing framework.

More about HD Moore
Subscribe Now

Get the latest news and expert insights delivered in your inbox.

Welcome to the club! Your subscription to our newsletter is successful.

Explore more runZero

Product
Announcing runZero 4.9: Unmask attack paths and segmentation gaps with advanced topology and deep OT device intelligence
With runZero 4.9, visualize attacker lateral movement, harden network choke points, gain deep OT telemetry to secure converged environments, and more.
Webcasts
runZero Hour, Ep. 30: Segmentation - stop assuming & start verifying with runZero 4.9
See runZero 4.9 in action! Join HD Moore and Tod Beardsley to learn how interactive attack path mapping and advanced OT intelligence expose hidden...
Product Videos
runZero 4.9: Advanced topology, attack path mapping, & deep OT intelligence
With runZero 4.9, visualize attacker lateral movement, harden network choke points, gain deep OT telemetry to secure converged environments, and more.
runZero Perspective
Dawn of the apex agentic adversary
When agentic AI can weaponize exploits in seconds, visibility is everything. Stop the predator with runZero’s exposure management for the AI-attack...
Product Videos
runZero 5.0: Platform Demo
With the new 5.0 release, runZero is giving defenders the edge they need to succeed in the AI-attack era.
Webcasts
Defending in the shadow era: when the CVE feed goes dark
HD Moore walks through the three eras of vulnerability management: the predictable cycles era, the triage ara of AI-scale discovery, and now the...
Webcasts
runZero Hour, Ep. 31: The New Rules of Risk: EPSS v5 and Agentic Adversaries
In this episode, learn how your security team can use EPSS v5 to inform daily risk decisions in a world increasingly targeted by the apex agentic...
Webcasts
Beyond the Zero-Day: Mapping the network attackers actually see
Breaches are inevitable. Learn from HD Moore how attackers exploit the seams between IT, IoT, and OT networks — and how to fix the segmentation...

See Results in Minutes

See & secure your total attack surface. Even the unknowns & unmanageable.