Director of Reverse Engineering for security vendor. Podcaster with PaulDotCom Contributor to to Metasploit Blog: http://www.darkoperator.com/ Twitter: @Carlos_Perez
The research and slides shown is my own and do not in any way are related or of knowledge of my current employer. All expressions and comments are my own.
It is a systematic and methodical approach for gathering information about a target. The information will provide a view in to the technologies and security posture of the target. The process must be one of little impact and draw as little attention to the task as possible.
The reliance of DNS in the enterprise has grown at the same rate as the complexity and distribution of the technologies has grown. VOIP Instant Messaging Email Management
Most organizations do not monitor DNS server traffic and logs. Those that do monitor generally only do do Zone Transfer Transfer attempts in their IPS/IDS Systems. Can provide information on security posture of the target.
DNS is UDP so it is sensitive to the health of the connection path from the attacker to the target. DNS tends to have fake entries, stale entries, incorrect entries and entries to hosts that can not be reached. Location, location, location! what server we query will dictate what wha t records we get.
Included in BackTrack Linux 5, tested on OSX, Linux and Windows. Written in Python and tested on Python 2.6, 2.7 and 3.2 (Original was written in ruby 2 years ago) Can save results in XML, CSV or SQLite3. Includes Metasploit Plugin for importing XML and CSV results Includes Parser tool for XML and CSV results
Provide most of the known DNS enumeration techniques under one tool and that it. What techniques are executed and automation must be controlled by the user for best precision. Output must be easy to parse and easy to consume via command line or other tools.
Standard Record Enumeration (W (Wildcard, ildcard, DNSSEC, NS, SOA, MX, A, AAA, TXT, SPF and SRV) Zone Transfer Reverse Lookup Domain and Host Brute-force Cache Snooping Zone Walking (DNSSEC) Google Lookup
What it does Checks for Wildcard Resolving Check if it responds to DNSSEC and type of proof of non-existence record used. Resolves SOA, NS, MX, A, AAAA, TXT and SPF. Enumerate known SRV Records Types
Presence of DKIM (DomainKeys Identified Mail) and SPF (Sender Policy Framework) will reveal that email security technologies are in use. SPF will reveal what servers can send email. SRV (Service Records) Provide information SRV on service, transport, port and order of importance for services and type of software can be deduced.
Presence of records not having A, AAAA or CNAME records records associated may show lack of maintenance or internal in ternal record names being leaked (no_ip).
To run standard enumeration: ./dnsrecon.py -d ./dnsrecon.py -d -t std
The -a option can be given to perform a AXFR against all NS recor records ds with port 53 TCP open The -s option can be given to perform a Reverse Lookup against all ranges in the SPF (Sender Policy Framework) F ramework) record
It is still found in engagements to this day. Selects the Domain SOA and then queries for all of the NS records. Tests each NS record to see if port TCP 53 is open and if it is it tries a AXFR for the zone against the Name Server Server.. Records returned are parsed and formatted. Made optional since it is easily picked up in Logs and IDS/IPS Systems
Even when a zone transfer is successful other NS servers should be queried for standard records recor ds compared to rule out: Name Server may be a test server. Name Server may contain stale data. Name Server may be a decoy.
To run AXFR enumeration: ./dnsrecon.py -d -a ./dnsrecon.py -d -t axfr
More than one type can be specified ./dnsrecon.py -d -t std,axfr
Performs a lookup for PTR (Pointer) Records against a given IPv4 or IPv6 range. Can be performed against all ranges in SPF Records. Can be performed against ranges found via Whois Queries against agains t all A and PTR Records found.
To run reverse lookup enumeration: ./dnsrecon.py ./dnsrecon.p y -r ./dnsrecon.py -r
Expand SPF Record Ranges ./dnsrecon.py -d -s
Perform Whois Queries against all IPs found ./dnsrecon.py -d -w
Append to the domain each entry given in a dictionary and an d tries to resolve A, AAA and CNAME Record Will perform a test to see if Wildcard resolution is enabled for the domain. To run Domain Name Brute-force: ./dnsrecon.py -d -D -t brt
Given a list of domain names it will check a specific Name Server for the presence of the record recor d in its cache. ca che. Great for determining relations and outside services used that can be leveraged in Phishing attempts To perform the Cache Enumeration ./dnsrecon.py -t snoop -n Sever -D
Abuses the the proof of non-existence NSEC records recor ds in the original DNSSEC standard to enumerate an entire zone. Slow but more accurate results. May reveal internal records if zone is improperly configured. It is a “Feature/Capability” so it is hard to detect.
Points to the next valid name in the zone file and is used to provide proof proof of non-existence of a name in the Zone
Replaced NSEC, points to the hashed value of next valid name in the zone file and is used to provide proof proof of non-existence of a name in the Zone
Usage: parser.py Options: -h, --help Show this help message and exit -f, --file <file> DNSRecon XML or CSV output file to parse. -l, --list Output an unique IP List that can be used with other tools. -i, --ips IP Ranges in a comma separated list each in formats (first-last) or in (range/bitmask) for ranges to be included from output. For A, AAAA, NS, MX, SOA, SRV and PTR Records. -t, --type Resource Record Types as a regular expression to filter output. For A, AAAA, NS, MX, SOA, TXT, SPF, SRV and PTR Records. -s, --str Regular expression between quotes for filtering host names on. For A, AAAA, NS, MX, SOA, SRV and PTR Records. -n, --name Return list of unique host names. For A, AAAA, NS, MX, SOA, SRV and PTR Records.
A Metasploit Plugin for importing CSV and XML results results is included with the tool. The file dnsr_import.rb just needs to be copied to the ~/.msf4/plugins folder to have it available to msfconsole. The load command is used to load the plugin msf > load dnsr_import [*] dnsr_import plugin loaded. [*] Successfully loaded plugin: dnsr_import msf >
Commands Comman ds Availa Available ble DNSR_Import Commands ==================== Command ------import_dnsrecon_csv import_dnsrecon _csv import_dnsrecon_xml import_dnsrecon _xml
Description ----------Import DNSRecon CSV output file. Import DNSRecon DNSRecon XML output file.
Commands Comman ds Availa Available ble DNSR_Import Commands ==================== Command ------import_dnsrecon_csv import_dnsrecon_xml
Description ----------Import DNSRecon CSV output file. Import DNSRecon XML output file.
Each command takes the -f option for loading the file generated by DNS Recon