Nmap oracle-enum-users NSE Script


This page contains detailed information about how to use the oracle-enum-users NSE script. For list of all NSE scripts, visit the Nmap NSE Library.

Select:
Overview
Error Messages

Script Overview


Script source code: https://github.com/nmap/nmap/tree/master/scripts/oracle-enum-users.nse
Script categories: intrusive, auth
Target service / protocol: oracle-tns
Target network port(s): 1521
List of CVEs: -

Script Description


The oracle-enum-users.nse script attempts to enumerate valid Oracle user names against unpatched Oracle 11g servers (this bug was fixed in Oracle's October 2009 Critical Patch Update).

Oracle-enum-users NSE Script Arguments


This is a full list of arguments supported by the oracle-enum-users.nse script:

oracle-enum-users.sid

The instance against which to attempt user enumeration

passdb

The filename of an alternate password database. Default: nselib/data/passwords.lst

unpwdb.passlimit

The maximum number of passwords passwords will return (default unlimited).

unpwdb.timelimit

The maximum amount of time that any iterator will run before stopping. The value is in seconds by default and you can follow it with ms, s, m, or h for milliseconds, seconds, minutes, or hours. For example, unpwdb.timelimit=30m or unpwdb.timelimit=.5h for 30 minutes. The default depends on the timing template level (see the module description). Use the value 0 to disable the time limit.

unpwdb.userlimit

The maximum number of usernames usernames will return (default unlimited).

userdb

The filename of an alternate username database. Default: nselib/data/usernames.lst

- - -
To use these script arguments, add them to the Nmap command line using the --script-args arg1=value,[arg2=value,..] syntax. For example:

nmap --script=oracle-enum-users --script-args oracle-enum-users.sid=value,passdb=value <target>

Oracle-enum-users NSE Script Example Usage


Here's an example of how to use the oracle-enum-users.nse script:

nmap --script oracle-enum-users --script-args oracle-enum-users.sid=ORCL,userdb=orausers.txt -p 1521-1560 <host>

If no userdb is supplied the default userlist is used

Oracle-enum-users NSE Script Example Output


Here's a sample output from the oracle-enum-users.nse script:

PORT     STATE SERVICE REASON
1521/tcp open  oracle  syn-ack
| oracle-enum-users:
|   haxxor is a valid user account
|   noob is a valid user account
|_  patrik is a valid user account

Oracle-enum-users NSE Script Example XML Output


There is no sample XML output for this module. However, by providing the -oX <file> option, Nmap will produce a XML output and save it in the file.xml file.

Author


  • Patrik Karlsson

References


See Also


Related NSE scripts to the oracle-enum-users.nse script:

Visit Nmap NSE Library for more scripts.

The oracle-enum-users.nse script may fail with the following error messages. Check for the possible causes by using the code snippets highlighted below found in the script source code. This can often times help in identifying the root cause of the problem.

Oracle instance not set (see oracle-enum-users.sid or tns.sid)


Here is a relevant code snippet related to the "Oracle instance not set (see oracle-enum-users.sid or tns.sid)" error message:

77:	  local count = 0
78:	  local result = {}
79:	  local usernames
80:	
81:	  if ( not( nmap.registry.args['oracle-enum-users.sid'] ) and not( nmap.registry.args['tns.sid'] ) ) then
82:	    return fail("Oracle instance not set (see oracle-enum-users.sid or tns.sid)")
83:	  end
84:	
85:	  status, usernames = unpwdb.usernames()
86:	  if( not(status) ) then
87:	    return fail("Failed to load the usernames dictionary")

Failed to load the usernames dictionary


Here is a relevant code snippet related to the "Failed to load the usernames dictionary" error message:

82:	    return fail("Oracle instance not set (see oracle-enum-users.sid or tns.sid)")
83:	  end
84:	
85:	  status, usernames = unpwdb.usernames()
86:	  if( not(status) ) then
87:	    return fail("Failed to load the usernames dictionary")
88:	  end
89:	
90:	  -- Check for some known good accounts
91:	  for _, user in ipairs( known_good_accounts ) do
92:	    status, salt = checkAccount(host, port, user)

None of the known accounts were detected (oracle < 11g)


Here is a relevant code snippet related to the "None of the known accounts were detected (oracle < 11g)" error message:

96:	    end
97:	  end
98:	
99:	  -- did we atleast get a single salt back?
100:	  if ( count < 20 ) then
101:	    return fail("None of the known accounts were detected (oracle < 11g)")
102:	  end
103:	
104:	  -- Check for some known bad accounts
105:	  count = 0
106:	  for i=1, 10 do

%d of %d random accounts were detected (Patched Oracle 11G or Oracle 11G R2)


Here is a relevant code snippet related to the "%d of %d random accounts were detected (Patched Oracle 11G or Oracle 11G R2)" error message:

113:	    end
114:	  end
115:	
116:	  -- It's unlikely that we hit 3 random combinations as valid users
117:	  if ( count > 60 ) then
118:	    return fail(("%d of %d random accounts were detected (Patched Oracle 11G or Oracle 11G R2)"):format(count/20, 10))
119:	  end
120:	
121:	  for user in usernames do
122:	    status, salt = checkAccount(host, port, user)
123:	    if ( not(status) ) then return salt end

Failed to find any valid user accounts


Here is a relevant code snippet related to the "Failed to find any valid user accounts" error message:

124:	    if ( salt and #salt == 20 ) then
125:	      table.insert( result, ("%s is a valid user account"):format(user))
126:	    end
127:	  end
128:	
129:	  if ( #result == 0 ) then
130:	    table.insert( result, "Failed to find any valid user accounts")
131:	  end
132:	
133:	  return stdnse.format_output(true, result)
134:	end

Version


This page has been created based on Nmap version 7.92.

Go back to menu.