Oracle RDBMS Login Utility - Metasploit
This page contains detailed information about how to use the auxiliary/scanner/oracle/oracle_login metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: Oracle RDBMS Login Utility
Module: auxiliary/scanner/oracle/oracle_login
Source code: modules/auxiliary/scanner/oracle/oracle_login.rb
Disclosure date: -
Last modification time: 2020-02-21 08:41:42 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: -
Target network port(s): -
List of CVEs: CVE-1999-0502
This module attempts to authenticate against an Oracle RDBMS instance using username and password combinations indicated by the USER_FILE, PASS_FILE, and USERPASS_FILE options. Due to a bug in nmap versions 6.50-7.80 may not work.
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/oracle/oracle_login
msf auxiliary(oracle_login) > show options
... show and set options ...
msf auxiliary(oracle_login) > set RHOSTS ip-range
msf auxiliary(oracle_login) > exploit
Other examples of setting the RHOSTS option:
Example 1:
msf auxiliary(oracle_login) > set RHOSTS 192.168.1.3-192.168.1.200
Example 2:
msf auxiliary(oracle_login) > set RHOSTS 192.168.1.1/24
Example 3:
msf auxiliary(oracle_login) > 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
This module attempts to authenticate against an Oracle RDBMS instance using username and password combinations indicated by the USER_FILE, PASS_FILE, and USERPASS_FILE options. The default wordlist is oracle_default_userpass.txt.
Default port for SQL*Net listener is 1521/tcp. If this port is open, try this module to login.
Install
This module needs nmap 5.50 or above to function. However due to an nmap bug versions 6.50-7.80 may not work.
nmap -V
apt-get install nmap
In addition, if you encounter errors due to OCI libraries not being found, please see the How to get Oracle Support working with Kali Linux.
For Oracle Server, please follow the following guide.
Verification Steps
- Install Oracle Database server and metasploit components
- Start msfconsole
- Do:
use auxiliary/scanner/oracle/oracle_login
- Do:
run
Options
BLANK_PASSWORDS
Try blank passwords for all users
BRUTEFORCE_SPEED
How fast to bruteforce, scale of 0 to 5
DB_ALL_CREDS
Try each user/password couple stored in the current database
DB_ALL_PASS
Add all passwords in the current database to the list to try
DB_ALL_USERS
Add all users in the current database to the list to try
NMAP_VERBOSE
Display nmap output
PASSWORD
Specify one password to use for all usernames
PASS_FILE
File of passwords, one per line.
RHOSTS
Target hosts, range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORTS
Ports of the target
SID
Instance (SID) to authenticate against. Default XE
STOP_ON_SUCCESS
Stop the bruteforce attack when a valid combination is found
THREADS
Number of concurrent threads (max of one per host)
USERNAME
Specific username to try for all passwords
USERPASS_FILE
File of username and passwords, separated by space, one set per line. Default oracle_default_userpass.txt
USER_AS_PASS
Try the username as the password for all users
USER_FILE
File containing usernames, one per line
Scenarios
Unfortunately due to the nmap bug mentioned above, it was not possible to create an example run.
Go back to menu.
Msfconsole Usage
Here is how the scanner/oracle/oracle_login auxiliary module looks in the msfconsole:
msf6 > use auxiliary/scanner/oracle/oracle_login
msf6 auxiliary(scanner/oracle/oracle_login) > show info
Name: Oracle RDBMS Login Utility
Module: auxiliary/scanner/oracle/oracle_login
License: Metasploit Framework License (BSD)
Rank: Normal
Provided by:
Patrik Karlsson <[email protected]>
todb <[email protected]>
Check supported:
No
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
BLANK_PASSWORDS false no Try blank passwords for all users
BRUTEFORCE_SPEED 5 yes How fast to bruteforce, from 0 to 5
DB_ALL_CREDS false no Try each user/password couple stored in the current database
DB_ALL_PASS false no Add all passwords in the current database to the list
DB_ALL_USERS false no Add all users in the current database to the list
NMAP_VERBOSE true no Display nmap output
PASSWORD no A specific password to authenticate with
PASS_FILE no File containing passwords, one per line
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORTS no Ports to target
SID XE yes The instance (SID) to authenticate against
STOP_ON_SUCCESS false yes Stop guessing when a credential works for a host
THREADS 1 yes The number of concurrent threads (max one per host)
USERNAME no A specific username to authenticate as
USERPASS_FILE /opt/metasploit-framework/embedded/framework/data/wordlists/oracle_default_userpass.txt no File containing (space-separated) users and passwords, one pair per line
USER_AS_PASS false no Try the username as the password for all users
USER_FILE no File containing usernames, one per line
VERBOSE true yes Whether to print output for all attempts
Description:
This module attempts to authenticate against an Oracle RDBMS
instance using username and password combinations indicated by the
USER_FILE, PASS_FILE, and USERPASS_FILE options. Due to a bug in
nmap versions 6.50-7.80 may not work.
References:
http://www.oracle.com/us/products/database/index.html
https://nvd.nist.gov/vuln/detail/CVE-1999-0502
http://nmap.org/nsedoc/scripts/oracle-brute.html
Module Options
This is a complete list of options available in the scanner/oracle/oracle_login auxiliary module:
msf6 auxiliary(scanner/oracle/oracle_login) > show options
Module options (auxiliary/scanner/oracle/oracle_login):
Name Current Setting Required Description
---- --------------- -------- -----------
BLANK_PASSWORDS false no Try blank passwords for all users
BRUTEFORCE_SPEED 5 yes How fast to bruteforce, from 0 to 5
DB_ALL_CREDS false no Try each user/password couple stored in the current database
DB_ALL_PASS false no Add all passwords in the current database to the list
DB_ALL_USERS false no Add all users in the current database to the list
NMAP_VERBOSE true no Display nmap output
PASSWORD no A specific password to authenticate with
PASS_FILE no File containing passwords, one per line
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORTS no Ports to target
SID XE yes The instance (SID) to authenticate against
STOP_ON_SUCCESS false yes Stop guessing when a credential works for a host
THREADS 1 yes The number of concurrent threads (max one per host)
USERNAME no A specific username to authenticate as
USERPASS_FILE /opt/metasploit-framework/embedded/framework/data/wordlists/oracle_default_userpass.txt no File containing (space-separated) users and passwords, one pair per line
USER_AS_PASS false no Try the username as the password for all users
USER_FILE no File containing usernames, one per line
VERBOSE true yes Whether to print output for all attempts
Advanced Options
Here is a complete list of advanced options supported by the scanner/oracle/oracle_login auxiliary module:
msf6 auxiliary(scanner/oracle/oracle_login) > show advanced
Module advanced options (auxiliary/scanner/oracle/oracle_login):
Name Current Setting Required Description
---- --------------- -------- -----------
MaxGuessesPerService 0 no Maximum number of credentials to try per service instance. If set to zero or a non-number, this option will not be used.
MaxGuessesPerUser 0 no Maximum guesses for a particular username for the service instance. Note that users are considered unique among different services, so a user at 10.1.1.1:22 is different from one at 10.2.2.2:
22, and both will be tried up to the MaxGuessesPerUser limit. If set to zero or a non-number, this option will not be used.
MaxMinutesPerService 0 no Maximum time in minutes to bruteforce the service instance. If set to zero or a non-number, this option will not be used.
PASSWORD_SPRAY false yes Reverse the credential pairing order. For each password, attempt every possible user.
REMOVE_PASS_FILE false yes Automatically delete the PASS_FILE on module completion
REMOVE_USERPASS_FILE false yes Automatically delete the USERPASS_FILE on module completion
REMOVE_USER_FILE false yes Automatically delete the USER_FILE on module completion
ShowProgress true yes Display progress messages during a scan
ShowProgressPercent 10 yes The interval in percent that progress should be shown
TRANSITION_DELAY 0 no Amount of time (in minutes) to delay before transitioning to the next user in the array (or password when PASSWORD_SPRAY=true)
WORKSPACE no Specify the workspace for this module
Auxiliary Actions
This is a list of all auxiliary actions that the scanner/oracle/oracle_login module can do:
msf6 auxiliary(scanner/oracle/oracle_login) > show actions
Auxiliary actions:
Name Description
---- -----------
Evasion Options
Here is the full list of possible evasion options supported by the scanner/oracle/oracle_login auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 auxiliary(scanner/oracle/oracle_login) > 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.
Installed Nmap version is not at least <MINIMUM_NMAP_VERSION>. Exiting...
Here is a relevant code snippet related to the "Installed Nmap version is not at least <MINIMUM_NMAP_VERSION>. Exiting..." error message:
46: "5.50"
47: end
48:
49: def run
50: unless nmap_version_at_least? minimum_nmap_version
51: print_error "Installed Nmap version is not at least #{minimum_nmap_version}. Exiting..."
52: return false
53: end
54: print_status "Nmap: Setting up credential file..."
55: credfile = create_credfile
56: cred_count = 0
<MSG> Invalid SID: <SID>
Here is a relevant code snippet related to the "<MSG> Invalid SID: <SID>" error message:
165:
166: def parse_script_output(addr,port,output)
167: msg = "#{addr}:#{port} - Oracle -"
168: @oracle_reported = false
169: if output =~ /TNS: The listener could not resolve \x22/n
170: print_error "#{msg} Invalid SID: #{sid}"
171: elsif output =~ /Accounts[\s]+No valid accounts found/nm
172: print_status "#{msg} No valid accounts found"
173: else
174: output.each_line do |oline|
175: if oline =~ /Login correct/
<MSG> No valid accounts found
Here is a relevant code snippet related to the "<MSG> No valid accounts found" error message:
167: msg = "#{addr}:#{port} - Oracle -"
168: @oracle_reported = false
169: if output =~ /TNS: The listener could not resolve \x22/n
170: print_error "#{msg} Invalid SID: #{sid}"
171: elsif output =~ /Accounts[\s]+No valid accounts found/nm
172: print_status "#{msg} No valid accounts found"
173: else
174: output.each_line do |oline|
175: if oline =~ /Login correct/
176: if not @oracle_reported
177: report_service(:host => addr, :port => port, :proto => "tcp", :name => "oracle")
<MSG> NSE script error
Here is a relevant code snippet related to the "<MSG> NSE script error" error message:
203: user: "#{sid}/#{user}",
204: service_name: 'tcp',
205: status: Metasploit::Model::Login::Status::DENIED_ACCESS
206: )
207: elsif oline =~ /^\s+ERROR: (.*)/
208: print_error "#{msg} NSE script error: #{$1}"
209: end
210: end
211: end
212: end
213: end
Go back to menu.
Related Pull Requests
- #8716 Merged Pull Request: Print_Status -> Print_Good (And OCD bits 'n bobs)
- #8338 Merged Pull Request: Fix msf/core and self.class msftidy warnings
- #6655 Merged Pull Request: use MetasploitModule as a class name
- #6648 Merged Pull Request: Change metasploit class names
- #5935 Merged Pull Request: My final round of updating modules to use the metasploit-credential API
- #2525 Merged Pull Request: Change module boilerplate
- #2426 Merged Pull Request: Find and replace Msf::Config.install_root, "data"
- #1228 Merged Pull Request: MSFTIDY cleanup #1 - auxiliary
References
- http://www.oracle.com/us/products/database/index.html
- CVE-1999-0502
- http://nmap.org/nsedoc/scripts/oracle-brute.html
See Also
Check also the following modules related to this module:
- auxiliary/scanner/telnet/brocade_enable_login
- auxiliary/scanner/db2/db2_auth
- auxiliary/scanner/http/dell_idrac
- auxiliary/scanner/http/dlink_dir_300_615_http_login
- auxiliary/scanner/http/dlink_dir_615h_http_login
- auxiliary/scanner/http/dlink_dir_session_cgi_http_login
- auxiliary/scanner/ftp/ftp_login
- auxiliary/scanner/http/http_login
- auxiliary/scanner/http/joomla_bruteforce_login
- auxiliary/scanner/mysql/mysql_login
- auxiliary/scanner/nntp/nntp_login
- auxiliary/scanner/pcanywhere/pcanywhere_login
- auxiliary/scanner/postgres/postgres_login
- auxiliary/scanner/rservices/rexec_login
- auxiliary/scanner/rservices/rlogin_login
- auxiliary/scanner/rservices/rsh_login
- exploit/multi/ssh/sshexec
- auxiliary/scanner/ssh/ssh_login
- auxiliary/scanner/telnet/telnet_login
- auxiliary/scanner/http/tomcat_mgr_login
- auxiliary/scanner/vmware/vmauthd_login
- auxiliary/scanner/vmware/vmware_http_login
- auxiliary/scanner/winrm/winrm_login
- auxiliary/scanner/http/wordpress_xmlrpc_login
- auxiliary/scanner/oracle/oracle_hashdump
- auxiliary/scanner/http/oracle_demantra_database_credentials_leak
- auxiliary/scanner/http/oracle_demantra_file_retrieval
- auxiliary/scanner/http/oracle_ilom_login
- auxiliary/admin/oracle/oracle_index_privesc
- auxiliary/admin/oracle/oracle_login
- auxiliary/admin/oracle/oracle_sql
- exploit/dialup/multi/login/manyargs
- 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/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
Related Nessus plugins:
- MPEi/X Default FTP Accounts
- Netscape Enterprise Default Administrative Password
- Unpassworded 'guest' Account
- Unpassworded 'EZsetup' Account
- Unpassworded 'demos' Account
- Unpassworded '4Dgifts' Account
- Unpassworded 'OutOfBox' Account
- Unpassworded 'root' Account
- Unpassworded 'lp' Account
- Unpassworded 'sync' Account
Authors
- Patrik Karlsson <patrik[at]cqure.net>
- todb
Version
This page has been produced using Metasploit Framework version 6.1.29-dev. For more modules, visit the Metasploit Module Library.
Go back to menu.