Fake DNS Service - Metasploit


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

Module Overview


Name: Fake DNS Service
Module: auxiliary/server/fakedns
Source code: modules/auxiliary/server/fakedns.rb
Disclosure date: -
Last modification time: 2020-05-12 22:15:21 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: -
Target network port(s): -
List of CVEs: -

This module provides a DNS service that redirects all queries to a particular address.

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


msf > use auxiliary/server/fakedns
msf auxiliary(fakedns) > show targets
    ... a list of targets ...
msf auxiliary(fakedns) > set TARGET target-id
msf auxiliary(fakedns) > show options
    ... show and set options ...
msf auxiliary(fakedns) > exploit

Go back to menu.

Msfconsole Usage


Here is how the server/fakedns auxiliary module looks in the msfconsole:

msf6 > use auxiliary/server/fakedns

msf6 auxiliary(server/fakedns) > show info

       Name: Fake DNS Service
     Module: auxiliary/server/fakedns
    License: Metasploit Framework License (BSD)
       Rank: Normal

Provided by:
  ddz <[email protected]>
  hdm <[email protected]>
  fozavci

Available actions:
  Name     Description
  ----     -----------
  Service  Run DNS server

Check supported:
  No

Basic options:
  Name          Current Setting  Required  Description
  ----          ---------------  --------  -----------
  SRVHOST       0.0.0.0          yes       The local host to listen on.
  SRVPORT       53               yes       The local port to listen on.
  TARGETACTION  BYPASS           yes       Action for TARGETDOMAIN (Accepted: FAKE, BYPASS)
  TARGETDOMAIN  www.google.com   yes       The list of target domain names we want to fully resolve (BYPASS) or fake resolve (FAKE). Use '*' for wildcard.
  TARGETHOST                     no        The address that all names should resolve to

Description:
  This module provides a DNS service that redirects all queries to a 
  particular address.

Module Options


This is a complete list of options available in the server/fakedns auxiliary module:

msf6 auxiliary(server/fakedns) > show options

Module options (auxiliary/server/fakedns):

   Name          Current Setting  Required  Description
   ----          ---------------  --------  -----------
   SRVHOST       0.0.0.0          yes       The local host to listen on.
   SRVPORT       53               yes       The local port to listen on.
   TARGETACTION  BYPASS           yes       Action for TARGETDOMAIN (Accepted: FAKE, BYPASS)
   TARGETDOMAIN  www.google.com   yes       The list of target domain names we want to fully resolve (BYPASS) or fake resolve (FAKE). Use '*' for wildcard.
   TARGETHOST                     no        The address that all names should resolve to

Auxiliary action:

   Name     Description
   ----     -----------
   Service  Run DNS server

Advanced Options


Here is a complete list of advanced options supported by the server/fakedns auxiliary module:

msf6 auxiliary(server/fakedns) > show advanced

Module advanced options (auxiliary/server/fakedns):

   Name         Current Setting  Required  Description
   ----         ---------------  --------  -----------
   LogConsole   true             no        Determines whether to log all request to the console
   LogDatabase  false            no        Determines whether to log all request to the database
   RR_SRV_PORT  5060             no        The port field in the SRV response when FAKE
   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 server/fakedns module can do:

msf6 auxiliary(server/fakedns) > show actions

Auxiliary actions:

   Name     Description
   ----     -----------
   Service  Run DNS server

Evasion Options


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

msf6 auxiliary(server/fakedns) > 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.

Unable to resolve SRV record for <NAME> -- skipping


Here is a relevant code snippet related to the "Unable to resolve SRV record for <NAME> -- skipping" error message:

191:	            # if we are in bypass mode or we are in fake mode but the target didn't match,
192:	            # just return the real response RRs
193:	            resources = Resolv::DNS.new().getresources(Resolv::DNS::Name.create(name), Resolv::DNS::Resource::IN::SRV)
194:	            if resources.empty?
195:	              @error_resolving = true
196:	              print_error("Unable to resolve SRV record for #{name} -- skipping")
197:	              next
198:	            end
199:	            resources.each do |resource|
200:	              host = resource.target
201:	              port = resource.port.to_i

XID <REQUEST.ID> (<VALUE>) - Error resolving


Here is a relevant code snippet related to the "XID <REQUEST.ID> (<VALUE>) - Error resolving" error message:

241:	        end
242:	      }
243:	
244:	      if(@log_console)
245:	        if(@error_resolving)
246:	          print_error("XID #{request.id} (#{lst.join(", ")}) - Error resolving")
247:	        else
248:	          print_status("XID #{request.id} (#{lst.join(", ")})")
249:	        end
250:	      end
251:	

fakedns: <E.CLASS> <E> <E.BACKTRACE>


Here is a relevant code snippet related to the "fakedns: <E.CLASS> <E> <E.BACKTRACE>" error message:

260:	
261:	      @sock.send(request.encode(), 0, addr[3], addr[1])
262:	    end
263:	
264:	    rescue ::Exception => e
265:	      print_error("fakedns: #{e.class} #{e} #{e.backtrace}")
266:	    # Make sure the socket gets closed on exit
267:	    ensure
268:	      @sock.close
269:	    end
270:	  end

Go back to menu.


Go back to menu.

See Also


Check also the following modules related to this module:

Authors


  • ddz
  • hdm
  • fozavci

Version


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

Go back to menu.