DNS Amplification Scanner - Metasploit
This page contains detailed information about how to use the auxiliary/scanner/dns/dns_amp metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: DNS Amplification Scanner
Module: auxiliary/scanner/dns/dns_amp
Source code: modules/auxiliary/scanner/dns/dns_amp.rb
Disclosure date: -
Last modification time: 2017-08-26 21:01:10 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: -
Target network port(s): 53
List of CVEs: CVE-2006-0987, CVE-2006-0988
This module can be used to discover DNS servers which expose recursive name lookups which can be used in an amplification attack against a third party.
Module Ranking and Traits
Module Ranking:
- normal: The exploit is otherwise reliable, but depends on a specific version and can't (or doesn't) reliably autodetect. More information about ranking can be found here.
Basic Usage
This module is a scanner module, and is capable of testing against multiple hosts.
msf > use auxiliary/scanner/dns/dns_amp
msf auxiliary(dns_amp) > show options
... show and set options ...
msf auxiliary(dns_amp) > set RHOSTS ip-range
msf auxiliary(dns_amp) > exploit
Other examples of setting the RHOSTS option:
Example 1:
msf auxiliary(dns_amp) > set RHOSTS 192.168.1.3-192.168.1.200
Example 2:
msf auxiliary(dns_amp) > set RHOSTS 192.168.1.1/24
Example 3:
msf auxiliary(dns_amp) > set RHOSTS file:/tmp/ip_list.txt
Required Options
- RHOSTS: The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
Knowledge Base
Vulnerable Application
This module can be used to discover DNS servers which expose recursive name lookups which can be used in an amplification attack against a third party.
BIND 9.4.1-P1: source Ubuntu 7.10: Gutsy Gibbon
Verification Steps
- Start msfconsole
- Do:
use modules/auxiliary/scanner/dns/dns_amp
- Do:
set DOMAINNAME [domain]
- Do:
set RHOST [ip]
- Do:
run
Scenarios
A run on Ubuntu 7.10 (Gutsy Gibbon) and BIND 9.4.1-P1
msf > use modules/auxiliary/scanner/dns/dns_amp
msf auxiliary(scanner/dns/dns_amp) > set DOMAINNAME domain.com
DOMAINNAME => domain.com
msf auxiliary(scanner/dns/dns_amp) > set RHOSTS 192.168.10.254
RHOSTS => 192.168.10.254
msf auxiliary(scanner/dns/dns_amp) > run
[*] Sending DNS probes to 192.168.10.254->192.168.10.254 (1 hosts)
[*] Sending 70 bytes to each host using the IN ANY domain.com request
[+] 192.168.10.254:53 - Response is 374 bytes [5.34x Amplification]
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
Go back to menu.
Msfconsole Usage
Here is how the scanner/dns/dns_amp auxiliary module looks in the msfconsole:
msf6 > use auxiliary/scanner/dns/dns_amp
msf6 auxiliary(scanner/dns/dns_amp) > show info
Name: DNS Amplification Scanner
Module: auxiliary/scanner/dns/dns_amp
License: Metasploit Framework License (BSD)
Rank: Normal
Provided by:
xistence <[email protected]>
Check supported:
No
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
BATCHSIZE 256 yes The number of hosts to probe in each set
DOMAINNAME isc.org yes Domain to use for the DNS request
FILTER no The filter string for capturing traffic
INTERFACE no The name of the interface
PCAPFILE no The name of the PCAP capture file to process
QUERYTYPE ANY yes Query type(A, NS, SOA, MX, TXT, AAAA, RRSIG, DNSKEY, ANY)
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORT 53 yes The target port (UDP)
SNAPLEN 65535 yes The number of bytes to capture
THREADS 10 yes The number of concurrent threads
TIMEOUT 500 yes The number of seconds to wait for new data
Description:
This module can be used to discover DNS servers which expose
recursive name lookups which can be used in an amplification attack
against a third party.
References:
https://nvd.nist.gov/vuln/detail/CVE-2006-0987
https://nvd.nist.gov/vuln/detail/CVE-2006-0988
Module Options
This is a complete list of options available in the scanner/dns/dns_amp auxiliary module:
msf6 auxiliary(scanner/dns/dns_amp) > show options
Module options (auxiliary/scanner/dns/dns_amp):
Name Current Setting Required Description
---- --------------- -------- -----------
BATCHSIZE 256 yes The number of hosts to probe in each set
DOMAINNAME isc.org yes Domain to use for the DNS request
FILTER no The filter string for capturing traffic
INTERFACE no The name of the interface
PCAPFILE no The name of the PCAP capture file to process
QUERYTYPE ANY yes Query type(A, NS, SOA, MX, TXT, AAAA, RRSIG, DNSKEY, ANY)
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORT 53 yes The target port (UDP)
SNAPLEN 65535 yes The number of bytes to capture
THREADS 10 yes The number of concurrent threads
TIMEOUT 500 yes The number of seconds to wait for new data
Advanced Options
Here is a complete list of advanced options supported by the scanner/dns/dns_amp auxiliary module:
msf6 auxiliary(scanner/dns/dns_amp) > show advanced
Module advanced options (auxiliary/scanner/dns/dns_amp):
Name Current Setting Required Description
---- --------------- -------- -----------
CHOST no The local client address
CPORT no The local client port
GATEWAY_PROBE_HOST 8.8.8.8 yes Send a TTL=1 random UDP datagram to this host to discover the default gateway's MAC
GATEWAY_PROBE_PORT no The port on GATEWAY_PROBE_HOST to send a random UDP probe to (random if 0 or unset)
NUM_REQUESTS 1 no Number of requests to send
SECRET 1297303073 yes A 32-bit cookie for probe requests.
SRCIP no Use this source IP
ScannerMaxResends 10 yes The maximum times to resend a packet when out of buffers
ScannerRecvInterval 30 yes The maximum numbers of sends before entering the processing loop
ScannerRecvQueueLimit 100 yes The maximum queue size before breaking out of the processing loop
ScannerRecvWindow 15 yes The number of seconds to wait post-scan to catch leftover replies
ShowProgress true yes Display progress messages during a scan
ShowProgressPercent 10 yes The interval in percent that progress should be shown
VERBOSE false no Enable detailed status messages
WORKSPACE no Specify the workspace for this module
Auxiliary Actions
This is a list of all auxiliary actions that the scanner/dns/dns_amp module can do:
msf6 auxiliary(scanner/dns/dns_amp) > show actions
Auxiliary actions:
Name Description
---- -----------
Evasion Options
Here is the full list of possible evasion options supported by the scanner/dns/dns_amp auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 auxiliary(scanner/dns/dns_amp) > show evasion
Module evasion options:
Name Current Setting Required Description
---- --------------- -------- -----------
Go back to menu.
Error Messages
This module may fail with the following error messages:
Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.
Invalid query type!
Here is a relevant code snippet related to the "Invalid query type!" error message:
59: when 'DNSKEY'
60: querypacket="\x30"
61: when 'ANY'
62: querypacket="\xff"
63: else
64: print_error("Invalid query type!")
65: return
66: end
67:
68: targdomainpacket = []
69: # Before every part of the domainname there should be the length of that part (instead of a ".")
<SHOST>:<RPORT> - Recursion not allowed
Here is a relevant code snippet related to the "<SHOST>:<RPORT> - Recursion not allowed" error message:
131: :refs => self.references)
132: end
133:
134: # If these flags are set, we get a valid response but recursion is not available
135: if qr == "1" and ra == "0" and rcode == "0101"
136: print_status("#{shost}:#{datastore['RPORT']} - Recursion not allowed")
137: report_service(:host => shost, :port => datastore['RPORT'], :proto => 'udp', :name => "dns")
138: end
139: end
140: end
141: end
Go back to menu.
Related Pull Requests
- #8888 Merged Pull Request: spelling/grammar fixes part 1
- #8716 Merged Pull Request: Print_Status -> Print_Good (And OCD bits 'n bobs)
- #8518 Merged Pull Request: update CVE reference in where modules report_vuln
- #8338 Merged Pull Request: Fix msf/core and self.class msftidy warnings
- #6655 Merged Pull Request: use MetasploitModule as a class name
- #6648 Merged Pull Request: Change metasploit class names
- #4670 Merged Pull Request: dns_amp rely on ra which is not set when additionnal RRs received
- #3166 Merged Pull Request: Fix syntax error in dns_amp
- #3164 Merged Pull Request: Fixup on some modules for release
- #2929 Merged Pull Request: Added DNS recursion amplification scanner
References
See Also
Check also the following modules related to this module:
- auxiliary/fuzzers/dns/dns_fuzzer
- auxiliary/vsploit/malware/dns/dns_mariposa
- auxiliary/vsploit/malware/dns/dns_query
- auxiliary/vsploit/malware/dns/dns_zeus
- payload/cmd/windows/powershell/dns_txt_query_exec
- payload/windows/dns_txt_query_exec
- post/linux/manage/dns_spoofing
- post/multi/gather/dns_bruteforce
- post/multi/gather/dns_reverse_lookup
- post/multi/gather/dns_srv_lookup
- auxiliary/admin/dns/dyn_dns_update
- auxiliary/dos/dns/bind_tkey
- auxiliary/dos/dns/bind_tsig
- auxiliary/dos/dns/bind_tsig_badtime
- auxiliary/server/dns/native_server
- auxiliary/server/dns/spoofhelper
- auxiliary/spoof/dns/bailiwicked_domain
- auxiliary/spoof/dns/bailiwicked_host
- auxiliary/spoof/dns/compare_results
- auxiliary/spoof/dns/native_spoofer
- auxiliary/dos/mdns/avahi_portzero
- auxiliary/dos/windows/llmnr/ms11_030_dnsapi
- auxiliary/gather/enum_dns
- auxiliary/scanner/mdns/query
- auxiliary/server/fakedns
- auxiliary/spoof/mdns/mdns_response
- auxiliary/scanner/memcached/memcached_amp
- auxiliary/scanner/portmap/portmap_amp
- auxiliary/scanner/upnp/ssdp_amp
- auxiliary/scanner/udp/udp_amplification
- exploit/windows/browser/aol_ampx_convertfile
- exploit/windows/fileformat/abbs_amp_lst
- exploit/osx/mdns/upnp_location
- auxiliary/scanner/sap/sap_ctc_verb_tampering_user_mgmt
Authors
- xistence <xistence[at]0x90.nl>
Version
This page has been produced using Metasploit Framework version 6.2.1-dev. For more modules, visit the Metasploit Module Library.
Go back to menu.