Oracle DB 11g R1/R2 DBMS_JVM_EXP_PERMS OS Code Execution - Metasploit


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

Module Overview


Name: Oracle DB 11g R1/R2 DBMS_JVM_EXP_PERMS OS Code Execution
Module: auxiliary/sqli/oracle/jvm_os_code_11g
Source code: modules/auxiliary/sqli/oracle/jvm_os_code_11g.rb
Disclosure date: 2010-02-01
Last modification time: 2020-10-02 17:38:06 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: -
Target network port(s): 1521
List of CVEs: CVE-2010-0866

This module exploits a flaw (0 day) in DBMS_JVM_EXP_PERMS package that allows any user with create session privilege to grant themselves java IO privileges. Identified by David Litchfield. Works on 11g R1 and R2 (Windows only).

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/sqli/oracle/jvm_os_code_11g
msf auxiliary(jvm_os_code_11g) > show targets
    ... a list of targets ...
msf auxiliary(jvm_os_code_11g) > set TARGET target-id
msf auxiliary(jvm_os_code_11g) > show options
    ... show and set options ...
msf auxiliary(jvm_os_code_11g) > exploit

Go back to menu.

Msfconsole Usage


Here is how the sqli/oracle/jvm_os_code_11g auxiliary module looks in the msfconsole:

msf6 > use auxiliary/sqli/oracle/jvm_os_code_11g

msf6 auxiliary(sqli/oracle/jvm_os_code_11g) > show info

       Name: Oracle DB 11g R1/R2 DBMS_JVM_EXP_PERMS OS Code Execution
     Module: auxiliary/sqli/oracle/jvm_os_code_11g
    License: Metasploit Framework License (BSD)
       Rank: Normal
  Disclosed: 2010-02-01

Provided by:
  sid <[email protected]>

Check supported:
  No

Basic options:
  Name    Current Setting                                    Required  Description
  ----    ---------------                                    --------  -----------
  CMD     echo metasploit >> %SYSTEMDRIVE%\\unbreakable.txt  no        CMD to execute.
  DBPASS  TIGER                                              yes       The password to authenticate with.
  DBUSER  SCOTT                                              yes       The username to authenticate with.
  RHOST                                                      yes       The Oracle host.
  RPORT   1521                                               yes       The TNS port.
  SID     ORCL                                               yes       The sid to authenticate with.

Description:
  This module exploits a flaw (0 day) in DBMS_JVM_EXP_PERMS package 
  that allows any user with create session privilege to grant 
  themselves java IO privileges. Identified by David Litchfield. Works 
  on 11g R1 and R2 (Windows only).

References:
  https://nvd.nist.gov/vuln/detail/CVE-2010-0866
  OSVDB (62184)
  http://blackhat.com/html/bh-dc-10/bh-dc-10-archives.html#Litchfield
  http://www.notsosecure.com/folder2/2010/02/04/hacking-oracle-11g/

Module Options


This is a complete list of options available in the sqli/oracle/jvm_os_code_11g auxiliary module:

msf6 auxiliary(sqli/oracle/jvm_os_code_11g) > show options

Module options (auxiliary/sqli/oracle/jvm_os_code_11g):

   Name    Current Setting                                    Required  Description
   ----    ---------------                                    --------  -----------
   CMD     echo metasploit >> %SYSTEMDRIVE%\\unbreakable.txt  no        CMD to execute.
   DBPASS  TIGER                                              yes       The password to authenticate with.
   DBUSER  SCOTT                                              yes       The username to authenticate with.
   RHOST                                                      yes       The Oracle host.
   RPORT   1521                                               yes       The TNS port.
   SID     ORCL                                               yes       The sid to authenticate with.

Advanced Options


Here is a complete list of advanced options supported by the sqli/oracle/jvm_os_code_11g auxiliary module:

msf6 auxiliary(sqli/oracle/jvm_os_code_11g) > show advanced

Module advanced options (auxiliary/sqli/oracle/jvm_os_code_11g):

   Name       Current Setting  Required  Description
   ----       ---------------  --------  -----------
   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 sqli/oracle/jvm_os_code_11g module can do:

msf6 auxiliary(sqli/oracle/jvm_os_code_11g) > show actions

Auxiliary actions:

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

Evasion Options


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

msf6 auxiliary(sqli/oracle/jvm_os_code_11g) > 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.

Error: <E.CLASS> <E>


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

43:	
44:	    begin
45:	      print_status("Attempting to grant JAVA IO Privileges")
46:	      prepare_exec(package)
47:	      print_status("Attempting to execute OS Code")
48:	      prepare_exec(os_code)
49:	    rescue => e
50:	      print_error("Error: #{e.class} #{e}")
51:	    end
52:	  end
53:	end

Go back to menu.


References


See Also


Check also the following modules related to this module:

Authors


  • sid[at]notsosecure.com

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.