以下的操作会比较新手,不是那种利用链pop、cc、cc1、或者任意类调用之类的,还请师傅们见谅,如有不妥的地方,请多多包含。
工具部分:
Seay源代码审计系统、phpstorm64
首先还是自动化审计,可以省下部分时间

一、写文件
以上发现了一些文件操作函数可控的,这就有得玩了,进行跟进/guest_auth/cfg/config.php这个文件。

发现了有俩个文件操作函数file_put_contents的参数可控,先看第一个函数的文件名,往上翻就会看到定义的文件名。 ps:截图不了这么长的图,就分段发了

在18行处进行了一次判断,判断getIsPostRequest方式是否为真之类的,可以跟进看看。文件在/guest_auth/pub.php


以上的意思就是判断是否为post还是get请求,可以不用深究,继续往下走。当type=wrCfg时就进入if判断,然后将post获取的请求进行赋值。

看着参数很多,其实上面的都没进行安全过滤就直接file_put_contents进/data/guestauthVar.php文件。
其需要的参数:
type=wrCfg empIpNum= empIpRange= pc_disable= pcTimeNum= pcTimeRange= mb_disable= mbTimeNum= mbTimeRange= empIdTimes= empAuthLocal= empAuthSms= empAuthLdap= guestIpNum= guestIpRange= guestAllowTime= guestAuthPas= guestAuthAct= serIpAddr= netType= guestAuthTimes=
以下的判断可以以字符、字符串来进行绕过。


这里empIpNum参数我是赋值为@eval($_POST[‘p’]),而其他都是赋值为false。


二、文件包含

可以全局搜索包含这个文件的文件,然后来进行文件包含并执行漏洞

该文章来源火线zone社区:https://zone.huoxian.cn/d/423-0day
|