Ubiquiti Discovery Scanner - Metasploit


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

Module Overview


Name: Ubiquiti Discovery Scanner
Module: auxiliary/scanner/ubiquiti/ubiquiti_discover
Source code: modules/auxiliary/scanner/ubiquiti/ubiquiti_discover.rb
Disclosure date: -
Last modification time: 2019-02-01 14:49:14 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: -
Target network port(s): 10001
List of CVEs: -

Detects Ubiquiti devices using a UDP discovery service

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

Other examples of setting the RHOSTS option:

Example 1:

msf auxiliary(ubiquiti_discover) > set RHOSTS 192.168.1.3-192.168.1.200 

Example 2:

msf auxiliary(ubiquiti_discover) > set RHOSTS 192.168.1.1/24

Example 3:

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


Many devices produced by Ubiquiti are affected by this issue.

Verification Steps


  1. Locate a network known or suspected to house Ubiquiti devices
  2. Start msfconsole
  3. Do: use auxiliary/scanner/ubiquiti_discovery
  4. Do: set RHOSTS <some_targets>
  5. Do: run

Scenarios


An example run against a Ubiquiti EdgeRouter-X:

  msf5 auxiliary(scanner/ubiquiti/ubiquiti_discover) > run
  [+] 192.168.1.1:10001 Ubiquiti Discovery metadata: {"ips"=>["192.168.0.1", "192.168.1.1"], "macs"=>["80:2a:a8:df:aa:bb", "f8:1e:df:f8:aa:bb"], "name"=>"ubnt", "model_short"=>"ER-X", "firmware"=>"EdgeRouter.ER-e50.v1.9.7+hotfix.4.5024279.171006.0255"}

Go back to menu.

Msfconsole Usage


Here is how the scanner/ubiquiti/ubiquiti_discover auxiliary module looks in the msfconsole:

msf6 > use auxiliary/scanner/ubiquiti/ubiquiti_discover

msf6 auxiliary(scanner/ubiquiti/ubiquiti_discover) > show info

       Name: Ubiquiti Discovery Scanner
     Module: auxiliary/scanner/ubiquiti/ubiquiti_discover
    License: Metasploit Framework License (BSD)
       Rank: Normal

Provided by:
  Jon Hart <[email protected]>

Check supported:
  No

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

Description:
  Detects Ubiquiti devices using a UDP discovery service

References:
  https://www.us-cert.gov/ncas/alerts/TA14-017A
  https://community.ubnt.com/t5/airMAX-General-Discussion/airOS-airMAX-and-management-access/td-p/2654023
  https://blog.rapid7.com/2019/02/01/ubiquiti-discovery-service-exposures/

Module Options


This is a complete list of options available in the scanner/ubiquiti/ubiquiti_discover auxiliary module:

msf6 auxiliary(scanner/ubiquiti/ubiquiti_discover) > show options

Module options (auxiliary/scanner/ubiquiti/ubiquiti_discover):

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

Advanced Options


Here is a complete list of advanced options supported by the scanner/ubiquiti/ubiquiti_discover auxiliary module:

msf6 auxiliary(scanner/ubiquiti/ubiquiti_discover) > show advanced

Module advanced options (auxiliary/scanner/ubiquiti/ubiquiti_discover):

   Name                   Current Setting  Required  Description
   ----                   ---------------  --------  -----------
   CHOST                                   no        The local client address
   CPORT                                   no        The local client port
   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/ubiquiti/ubiquiti_discover module can do:

msf6 auxiliary(scanner/ubiquiti/ubiquiti_discover) > show actions

Auxiliary actions:

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

Evasion Options


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

msf6 auxiliary(scanner/ubiquiti/ubiquiti_discover) > 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.

<SHOST>:<SPORT> skipping unhandled <LENGTH>-byte field type '<TYPE>': '<VALUE>'


Here is a relevant code snippet related to the "<SHOST>:<SPORT> skipping unhandled <LENGTH>-byte field type '<TYPE>': '<VALUE>'" error message:

80:	        info['firmware'] = field_data
81:	      # essid in some situations
82:	      when 0x0d
83:	        info['essid'] = field_data
84:	      else
85:	        vprint_warning("#{shost}:#{sport} skipping unhandled #{length}-byte field type '#{type}': '#{field_data.unpack("H*")}'")
86:	      end
87:	    end
88:	
89:	    if ! info['macs'].any?
90:	      info.delete('macs')

Go back to menu.


References


See Also


Check also the following modules related to this module:

Authors


Jon Hart <jon_hart[at]rapid7.com>

Version


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

Go back to menu.