ODAT (Oracle Database Attacking Tool) is an open source penetration testing tool that tests the security of Oracle Databases remotely.
Usage examples of ODAT:
You have an Oracle database listening remotely and want to find valid SIDs and credentials in order to connect to the database
You have a valid Oracle account on a database and want to escalate your privileges to become DBA or SYSDBA
You have a Oracle account and you want to execute system commands (e.g. reverse shell) in order to move forward on the operating system hosting the database
Tested on Oracle Database 10g, 11g, 12c, 18c and 19c.
ODAT linux standalone version at https://github.com/quentinhardy/odat/releases/. Notice it is recommended to use the development version (git clone), master-python3 branch (python 3 version).
Changelog
Version 5.1.1 (27/04/2022):
print a warning message when an “ORA-12519 - TNS:no appropriate service handler found” occured. This error can be triggered by the database server (listener) when too many connections have been established (when bruteforcing credentials for example). In this case, –sleep option should be used (e.g. –sleep 0.2).
Version 5.1 (12/03/2021):
new option in all module: –nmap-file for loading all Oracle databases from a nmap XML outpout file
new option in all module: -l for loading all targets from a text file (ip:port or ip on each line)
In all module, a TCP connection is tested on each target before to start ODAT tests now. –timeout-tcp-check can be used to manage timeout value.
In all module, a test is done on each target now for checking if the TNS listener is well configured. This test is done after TCP connection test.
new global option: –client-driver. Allows to set the client name for database connection (client_driver from V$SESSION_CONNECT_INFO).
Useful for applications whose end-users are not aware cx_Oracle is being. used. By default, ‘sql*plus’ now.
ODAT accepts a sqlnet.ora file now. A default file is in conf/. The timeout TCP & OUTBOUND (TNS) connection is set to 60 seconds by default now.
Version 5.0 (08/02/2021):
Important new module: Service Name Guesser, for searching valid Service Names. Specific module named snguesser and integrated in all module too. By default, all module searches all valid Service Names now after searching SIDs. SIDs can be identical to Service Name. When a Service Name is found but not a SID, Service Name can be used as a SID for connection.
–basic-info option in search module for getting some basic technical information about the database/instance. It gets Service Name, SID, databases, Oracle Database Vault status, Java status, hostname, ip address of the server, password policy, current system pivileges, current roles, pathches (when >= 12c and user is privileged), etc. Requires high pivileges for very interesting information (e.g. password policy & lock status).
Reverse shell implemented in DbmsScheduler module when the target is Windows. Starts a minimal http server, makes the Oracle Database download the powershell code and executes it remotely. The user has an interactive PS shell. Downloaded file is removed automatically.
–make-download option implemented in DbmsScheduler in order to make download a Windows target a script/binary file.
Bug fix in output in DbmsScheduler module (printOSCmdOutput()).
Better explanations in DbmsScheduler module (options).
Version 4.3 (28/06/2020):
new option: –both-ul. Try each password in lower case and upper case if it is not done in credential file(s)
new option: –random-order. Test accounts in random order. By default, it uses the text file order
all passwords are tested in lower case now by default (account files modified from upper to lower case)
some new accounts
Version 4.2 (04/02/2020):
minimal interactive SQL shell in search module
new feature for downloading files with DBMS_XSLPROCESSOR.read2clob in DbmsXslprocessor module
improvement for having remote OS after authentication
bug fix (e.g. terminal size)
Version 4.1 (01/15/2020):
Option for connection with SERVICE NAME instead of SID
Encoding set to UTF-8 by default for some operations (e.g. NVARCHAR2 and NCLOB, VARCHAR2 and CLOB)
Multiple bug fixes (encoding problems)
Version 4.0 (08/10/2019):
Odat with python 3, stable version
Version 3.0 (01/09/2019):
Compatible with Oracle Database 18c
New option in Java module for setting the path to shell (e.g. /usr/bin/sh when CentOS)
A new module (cve) for exploiting some CVE (Common Vulnerabilities and Exposures). CVE-2012-3137 (perhaps this number, I’m not sure…) implemented at the moment: A user authenticated can modify all tables who can select even if he can’t modify them normally (no ALTER privilege).
new option (–accounts-files) for remote authentication attack which uses 2 distinct files: a login list and password list.
Print 10g passwords for oclHashcat compatibility.
bug fixes (listening with nc).
Version 2.0 (21/02/2016) :
A new module (privesc) for using system privileges of an Oracle user (e.g. CREATE ANY PROCEDURE) in order to gain privileged access (i.e. DBA). System privileges that can be used by ODAT in this version:
CREATE ANY PROCEDURE: execution of arbitrary requests with APEX_040200’s privileges (e.g. modification of Oracle users’ passwords)
CREATE PROCEDURE and EXECUTE ANY PROCEDURE: execution of arbitrary requests as SYS (e.g. gives DBA role to a user)
CREATE ANY TRIGER (and CREATE PROCEDURE): execution of arbitrary requests as SYS (e.g. gives DBA role to a user)
ANALYZE ANY (and CREATE PROCEDURE): execution of arbitrary requests as SYS (e.g. gives DBA role to a user)
CREATE ANY INDEX (and CREATE PROCEDURE): execution of arbitrary requests as SYS (e.g. gives DBA role to a user)
The module privesc can be used to get all system privileges and roles granted. It shows system privileges that can be used to gain privileged access.
new option (-vvv) for showing SQL requests sent by ODAT in debugs
Standalone version exists in order to don’t have need to install dependencies (see https://github.com/quentinhardy/odat/releases/).
The ODAT standalone has been generated thanks to pyinstaller.
If you want to have the development version installed on your computer, these following tools and dependencies are needed:
Langage: Python 3
Oracle dependancies:
Instant Oracle basic
Instant Oracle sdk
Python libraries:
cx_Oracle
passlib
pycrypto
python-scapy
python-libnmap (new from python 5.1)
colorlog (recommended)
termcolor (recommended)
argcomplete (recommended)
pyinstaller (recommended)
Installation (optional, for development version)
This part describes how to install instantclient, CX_Oracle and some others python libraries on Ubuntu in order to have the ODAT development version.
Don’t forget that an ODAT standalone version exists at https://github.com/quentinhardy/odat/releases/: It is not required to install something for use the standalone version
For the moment (03/2021), Oracle Database instant client version 11.2 is the best version if you want to generate the ODAT standalone with pyinstaller.
For using the ODAT development version, the last version of the Oracle client can be used (e.g. version 19).
Install python3-dev, alien and libaio1 package (for sqlplus):
ODAT
ODAT (Oracle Database Attacking Tool) is an open source penetration testing tool that tests the security of Oracle Databases remotely.
Usage examples of ODAT:
Tested on Oracle Database 10g, 11g, 12c, 18c and 19c.
ODAT linux standalone version at https://github.com/quentinhardy/odat/releases/. Notice it is recommended to use the development version (git clone), master-python3 branch (python 3 version).
Changelog
Features
Thanks to ODAT, you can:
This list is not exhaustive.
Mind map - ODAT & Oracle Database pentests
Supported Platforms and dependencies
ODAT is compatible with Linux only.
Standalone version exists in order to don’t have need to install dependencies (see https://github.com/quentinhardy/odat/releases/). The ODAT standalone has been generated thanks to pyinstaller.
If you want to have the development version installed on your computer, these following tools and dependencies are needed:
Installation (optional, for development version)
This part describes how to install instantclient, CX_Oracle and some others python libraries on Ubuntu in order to have the ODAT development version. Don’t forget that an ODAT standalone version exists at https://github.com/quentinhardy/odat/releases/: It is not required to install something for use the standalone version
Clone the repository to get the ODAT source code:
Update wiki pages in this repository for getting the ODAT documentation locally:
Get instant client basic, sdk (devel) and sqlplus from the Oracle web site:
For the moment (03/2021), Oracle Database instant client version 11.2 is the best version if you want to generate the ODAT standalone with pyinstaller. For using the ODAT development version, the last version of the Oracle client can be used (e.g. version 19).
Install python3-dev, alien and libaio1 package (for sqlplus):
Generate DEB files from RPM files with :
Install instant client basic, sdk and sqlplus:
Put these lines in your /etc/profile file in order to define Oracle env variables:
Restart your session (to apply env variables)
Create the /etc/ld.so.conf.d/oracle.conf file and add the path to Oracle home:
Update the ldpath using:
Install CX_Oracle
Test if all is good:
Install some python libraries:
Download and install the development version of pyinstaller (http://www.pyinstaller.org/) for python 3.
or install through pip:
Run ODAT:
Docs and examples
Docs and examples are on the WIKI
Donation
If you want to support my work doing a donation, I will appreciate a lot: