Oracle Database Enumeration - Metasploit


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

Module Overview


Name: Oracle Database Enumeration
Module: auxiliary/admin/oracle/oraenum
Source code: modules/auxiliary/admin/oracle/oraenum.rb
Disclosure date: -
Last modification time: 2017-07-24 06:26:21 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: -
Target network port(s): 1521
List of CVEs: -

This module provides a simple way to scan an Oracle database server for configuration parameters that may be useful during a penetration test. Valid database credentials must be provided for this module to run.

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

Go back to menu.

Msfconsole Usage


Here is how the admin/oracle/oraenum auxiliary module looks in the msfconsole:

msf6 > use auxiliary/admin/oracle/oraenum

msf6 auxiliary(admin/oracle/oraenum) > show info

       Name: Oracle Database Enumeration
     Module: auxiliary/admin/oracle/oraenum
    License: Metasploit Framework License (BSD)
       Rank: Normal

Provided by:
  Carlos Perez <[email protected]>

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.

Description:
  This module provides a simple way to scan an Oracle database server 
  for configuration parameters that may be useful during a penetration 
  test. Valid database credentials must be provided for this module to 
  run.

Module Options


This is a complete list of options available in the admin/oracle/oraenum auxiliary module:

msf6 auxiliary(admin/oracle/oraenum) > show options

Module options (auxiliary/admin/oracle/oraenum):

   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.

Advanced Options


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

msf6 auxiliary(admin/oracle/oraenum) > show advanced

Module advanced options (auxiliary/admin/oracle/oraenum):

   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/oraenum module can do:

msf6 auxiliary(admin/oracle/oraenum) > show actions

Auxiliary actions:

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

Evasion Options


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

msf6 auxiliary(admin/oracle/oraenum) > 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.

It appears you do not have sufficient rights to perform the check


Here is a relevant code snippet related to the "It appears you do not have sufficient rights to perform the check" error message:

34:	        name,value = l.split(",")
35:	        vparm["#{name}"] = value
36:	      end
37:	    rescue => e
38:	      if e.to_s =~ /ORA-00942: table or view does not exist/
39:	        print_error("It appears you do not have sufficient rights to perform the check")
40:	      else
41:	        raise e
42:	      end
43:	    end
44:	

Database Auditing is not enabled!


Here is a relevant code snippet related to the "Database Auditing is not enabled!" error message:

67:	    #-------------------------------------------------------
68:	    # Audit Check
69:	    print_status("Auditing:")
70:	    begin
71:	      if vparm["audit_trail"] == "NONE"
72:	        print_status("\tDatabase Auditing is not enabled!")
73:	        report_note(
74:	          :host => datastore['RHOST'],
75:	          :proto => 'tcp',
76:	          :sname => 'oracle',
77:	          :port => datastore['RPORT'],

Auditing of SYS Operations is not enabled!


Here is a relevant code snippet related to the "Auditing of SYS Operations is not enabled!" error message:

91:	          :update => :unique_data
92:	        )
93:	      end
94:	
95:	      if vparm["audit_sys_operations"] == "FALSE"
96:	        print_status("\tAuditing of SYS Operations is not enabled!")
97:	        report_note(
98:	          :host => datastore['RHOST'],
99:	          :proto => 'tcp',
100:	          :sname => 'oracle',
101:	          :port => datastore['RPORT'],

SQL92 Security restriction on SELECT is not Enabled


Here is a relevant code snippet related to the "SQL92 Security restriction on SELECT is not Enabled" error message:

122:	    # Security Settings
123:	    print_status("Security Settings:")
124:	    begin
125:	
126:	      if vparm["sql92_security"] == "FALSE"
127:	        print_status("\tSQL92 Security restriction on SELECT is not Enabled")
128:	        report_note(
129:	          :host => datastore['RHOST'],
130:	          :proto => 'tcp',
131:	          :sname => 'oracle',
132:	          :port => datastore['RPORT'],

Here is a relevant code snippet related to the "Link Encryption for Logins is not Enabled" error message:

149:	
150:	      # check for encryption of logins on version before 10g
151:	
152:	      if majorrel.join.to_i < 10
153:	        if vparm["dblink_encrypt_login"] == "FALSE"
154:	          print_status("\tLink Encryption for Logins is not Enabled")
155:	          report_note(
156:	            :host => datastore['RHOST'],
157:	            :proto => 'tcp',
158:	            :sname => 'oracle',
159:	            :port => datastore['RPORT'],

It appears you do not have sufficient rights to perform the check


Here is a relevant code snippet related to the "It appears you do not have sufficient rights to perform the check" error message:

219:	        :update => :unique_data
220:	      )
221:	
222:	    rescue => e
223:	      if e.to_s =~ /ORA-00942: table or view does not exist/
224:	        print_error("It appears you do not have sufficient rights to perform the check")
225:	      else
226:	        raise e
227:	      end
228:	    end
229:	

The Number of Failed Logins before an account is locked is set to <VALUE>


Here is a relevant code snippet related to the "The Number of Failed Logins before an account is locked is set to <VALUE>" error message:

233:	        FROM dba_profiles
234:	        WHERE resource_name = 'FAILED_LOGIN_ATTEMPTS'
235:	        AND profile         = 'DEFAULT'
236:	      |
237:	      failed_logins = prepare_exec(query)
238:	      print_status("\tThe Number of Failed Logins before an account is locked is set to #{failed_logins[0].chomp}")
239:	      report_note(
240:	        :host => datastore['RHOST'],
241:	        :proto => 'tcp',
242:	        :sname => 'oracle',
243:	        :port => datastore['RPORT'],

It appears you do not have sufficient rights to perform the check


Here is a relevant code snippet related to the "It appears you do not have sufficient rights to perform the check" error message:

246:	        :update => :unique_data
247:	      )
248:	
249:	    rescue => e
250:	      if e.to_s =~ /ORA-00942: table or view does not exist/
251:	        print_error("It appears you do not have sufficient rights to perform the check")
252:	      else
253:	        raise e
254:	      end
255:	    end
256:	

It appears you do not have sufficient rights to perform the check


Here is a relevant code snippet related to the "It appears you do not have sufficient rights to perform the check" error message:

273:	        :update => :unique_data
274:	      )
275:	
276:	    rescue => e
277:	      if e.to_s =~ /ORA-00942: table or view does not exist/
278:	        print_error("It appears you do not have sufficient rights to perform the check")
279:	      else
280:	        raise e
281:	      end
282:	    end
283:	

It appears you do not have sufficient rights to perform the check


Here is a relevant code snippet related to the "It appears you do not have sufficient rights to perform the check" error message:

300:	        :update => :unique_data
301:	      )
302:	
303:	    rescue => e
304:	      if e.to_s =~ /ORA-00942: table or view does not exist/
305:	        print_error("It appears you do not have sufficient rights to perform the check")
306:	      else
307:	        raise e
308:	      end
309:	    end
310:	

It appears you do not have sufficient rights to perform the check


Here is a relevant code snippet related to the "It appears you do not have sufficient rights to perform the check" error message:

327:	        :update => :unique_data
328:	      )
329:	
330:	    rescue => e
331:	      if e.to_s =~ /ORA-00942: table or view does not exist/
332:	        print_error("It appears you do not have sufficient rights to perform the check")
333:	      else
334:	        raise e
335:	      end
336:	    end
337:	

It appears you do not have sufficient rights to perform the check


Here is a relevant code snippet related to the "It appears you do not have sufficient rights to perform the check" error message:

355:	      )
356:	      print_status("\tThe Number of Times a Password can be reused is set to #{passreuse[0].chomp}")
357:	
358:	    rescue => e
359:	      if e.to_s =~ /ORA-00942: table or view does not exist/
360:	        print_error("It appears you do not have sufficient rights to perform the check")
361:	      else
362:	        raise e
363:	      end
364:	    end
365:	

Password Complexity is not checked


Here is a relevant code snippet related to the "Password Complexity is not checked" error message:

370:	        WHERE resource_name = 'PASSWORD_VERIFY_FUNCTION'
371:	        AND profile         = 'DEFAULT'
372:	      |
373:	      passrand = prepare_exec(query)
374:	      if passrand[0] =~ /NULL/
375:	        print_status("\tPassword Complexity is not checked")
376:	        report_note(
377:	          :host => datastore['RHOST'],
378:	          :proto => 'tcp',
379:	          :sname => 'oracle',
380:	          :port => datastore['RPORT'],

It appears you do not have sufficient rights to perform the check


Here is a relevant code snippet related to the "It appears you do not have sufficient rights to perform the check" error message:

395:	        )
396:	      end
397:	
398:	    rescue => e
399:	      if e.to_s =~ /ORA-00942: table or view does not exist/
400:	        print_error("It appears you do not have sufficient rights to perform the check")
401:	      else
402:	        raise e
403:	      end
404:	    end
405:	

It appears you do not have sufficient rights to perform the check


Here is a relevant code snippet related to the "It appears you do not have sufficient rights to perform the check" error message:

450:	        end
451:	      end
452:	
453:	    rescue => e
454:	      if e.to_s =~ /ORA-00942: table or view does not exist/
455:	        print_error("It appears you do not have sufficient rights to perform the check")
456:	      else
457:	        raise e
458:	      end
459:	    end
460:	

It appears you do not have sufficient rights to perform the check


Here is a relevant code snippet related to the "It appears you do not have sufficient rights to perform the check" error message:

501:	        end
502:	      end
503:	
504:	    rescue => e
505:	      if e.to_s =~ /ORA-00942: table or view does not exist/
506:	        print_error("It appears you do not have sufficient rights to perform the check")
507:	      else
508:	        raise e
509:	      end
510:	    end
511:	

It appears you do not have sufficient rights to perform the check


Here is a relevant code snippet related to the "It appears you do not have sufficient rights to perform the check" error message:

530:	        )
531:	      end
532:	
533:	    rescue => e
534:	      if e.to_s =~ /ORA-00942: table or view does not exist/
535:	        print_error("It appears you do not have sufficient rights to perform the check")
536:	      else
537:	        raise e
538:	      end
539:	    end
540:	

It appears you do not have sufficient rights to perform the check


Here is a relevant code snippet related to the "It appears you do not have sufficient rights to perform the check" error message:

558:	          :update => :unique_data)
559:	      end
560:	
561:	    rescue => e
562:	      if e.to_s =~ /ORA-00942: table or view does not exist/
563:	        print_error("It appears you do not have sufficient rights to perform the check")
564:	      else
565:	        raise e
566:	      end
567:	    end
568:	

It appears you do not have sufficient rights to perform the check


Here is a relevant code snippet related to the "It appears you do not have sufficient rights to perform the check" error message:

587:	        )
588:	      end
589:	
590:	    rescue => e
591:	      if e.to_s =~ /ORA-00942: table or view does not exist/
592:	        print_error("It appears you do not have sufficient rights to perform the check")
593:	      else
594:	        raise e
595:	      end
596:	    end
597:	

It appears you do not have sufficient rights to perform the check


Here is a relevant code snippet related to the "It appears you do not have sufficient rights to perform the check" error message:

617:	        )
618:	      end
619:	
620:	    rescue => e
621:	      if e.to_s =~ /ORA-00942: table or view does not exist/
622:	        print_error("It appears you do not have sufficient rights to perform the check")
623:	      else
624:	        raise e
625:	      end
626:	    end
627:	

It appears you do not have sufficient rights to perform the check


Here is a relevant code snippet related to the "It appears you do not have sufficient rights to perform the check" error message:

675:	          end
676:	        end
677:	      end
678:	    rescue => e
679:	      if e.to_s =~ /ORA-00942: table or view does not exist/
680:	        print_error("It appears you do not have sufficient rights to perform the check")
681:	      else
682:	        raise e
683:	      end
684:	    end
685:	  end

Go back to menu.


Go back to menu.

See Also


Check also the following modules related to this module:

Authors


  • Carlos Perez <carlos_perez[at]darkoperator.com>

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.