quentinhardy / odat

ODAT: Oracle Database Attacking Tool
1.6k stars 345 forks source link

Can't connect even though sqlplus working fine on same host #65

Closed AkikoOrenji closed 1 month ago

AkikoOrenji commented 9 months ago

Running the following

/u01/app/oracle/product/19.0/bin/sqlplus USERNAME/password@sid_tls works fine from the server itself. I get the following when i run odat from the server itself.

./odat-libc2.17-x86_64 privesc --get-privs -s 127.0.0.1 -p 1521 -vvv -U "USERNAME" -d sid_tls -P "password" -vvv

02:11:40 INFO -: CX_Oracle is well configured according to parameters 02:11:40 DEBUG -: cx_Oracle Version: 8.3.0 02:11:40 DEBUG -: Oracle Client Version: (12, 2, 0, 1, 0) 02:11:40 DEBUG -: PrivilegeEscalation object created 02:11:40 DEBUG -: OracleDatabase module created 02:11:40 DEBUG -: TNS Connection string mode enabled and SERVICE NAME used for connection string 02:11:40 DEBUG -: Oracle connection string: USERNAME/password@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(Host=127.0.0.1)(Port=1521)))(CONNECT_DATA=(SERVICE_NAME=sid_tls))) 02:22:17 CRITICAL -: Impossible to connect to the remote database: ORA-12505: TNS:listener does not currently know of SID given in connect descriptor

DB is oracle express 19. I've tried using the hostname, physical IP address instead of hostname, used TCP port the SID instead of the default oracle port, tried using service name instead of SID all with the some outcome.

Any ideas what the problem might be ?

AkikoOrenji commented 9 months ago

sorted. The SID was different from what i was using. Actual SID was found by using SHOW CON_NAME; in sqlplus.