便民查询系统存在代码执行漏洞

我也懒得截图了所以直接贴代码,代码我都注释好了。

set_time_limit(0);
$prescription = trim($_GET['q']);//获取q的参数值
$id = intval($_GET['id']);//获取id整数值

$r_num = 0; //结果个数
$lan = 3;
$pf = "";
$pf_l = "";

if($prescription!=""){
    $dreamdb=file("data/yf.dat");//读取验方文件
    $count=count($dreamdb);//计算行数

    for($i=0; $i<$count; $i++) {
        $keyword=explode(" ",$prescription);//拆分关键字
        $dreamcount=count($keyword);//关键字个数
        $detail=explode("t",$dreamdb[$i]);//返回搜索数据
        for ($ai=0; $ai<$dreamcount; $ai++) {
            @eval("$found = eregi("$keyword[$ai]","$detail[0]");");//eval..并且可控

影响文件

【 邮编篇 】 漏洞文件:/yb/index.php
【 酒方篇 】漏洞文件:/jiufang/index.php
【 粥普篇 】漏洞文件:/zhoupu/index.php
【 谚语篇 】漏洞文件:/yanyu/index.php
【 偏方篇 】:漏洞文件:/pianfang/index.php
【 谜语篇 】:漏洞文件:/miyu/index.php
【 名言篇 】:漏洞文件:/mingyan/index.php
【 名方片 】:漏洞文件:/mingfang/index.php
【 解梦篇 】:漏洞文件:/meng/index.php
【 验方篇 】漏洞文件:/yanfang/index.php
【中草药篇】 漏洞文件:/zhongcaoyao/index.php
【歇后语篇】:漏洞文件:/xiehouyu/index.php
【绕口令篇】:漏洞文件:/raokouling/index.php
【脑筋急转弯篇】:文件:/naojin/index.php

漏洞验证

Exp我就不放了 放上一张成功利用截图

猜你喜欢

转载自www.cnblogs.com/M0rta1s/p/11707864.html
今日推荐