V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Suki2Y
V2EX  ›  PHP

tp5 框架疑似后门文件

  •  
  •   Suki2Y · 2017-11-28 11:14:31 +08:00 · 14595 次点击
    这是一个创建于 2334 天前的主题,其中的信息可能已经有所发展或是发生改变。

    /vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php

    代码详情

    eval('?>' . file_get_contents('php://stdin'));

    31 条回复    2017-11-29 09:08:07 +08:00
    sheepkx
        1
    sheepkx  
       2017-11-28 11:26:31 +08:00 via iPhone
    确实是。不过一般 tp5 文件夹不要放在可以访问的主目录。
    zhongkouwei
        2
    zhongkouwei  
       2017-11-28 11:40:42 +08:00
    收到腾讯云报警,也是这个
    topthink
        3
    topthink  
       2017-11-28 11:42:48 +08:00   ❤️ 5
    这是 phpunit 扩展 根本不是 TP5 的文件
    wkan
        4
    wkan  
       2017-11-28 11:45:59 +08:00 via iPhone
    这不是 phpunit 的文件吗
    Light3
        5
    Light3  
       2017-11-28 11:50:57 +08:00
    那个麻烦您 目录写的很明白了 phpunit 的 这也分 tp 一口锅 我也是服
    oneonesv
        6
    oneonesv  
       2017-11-28 11:55:20 +08:00
    不看目录的吗?
    x86
        7
    x86  
       2017-11-28 11:56:02 +08:00
    /vendor/phpunit
    wkan
        8
    wkan  
       2017-11-28 11:57:07 +08:00 via iPhone
    不过生产环境不应该装上 phpunit 吧
    gouchaoer
        9
    gouchaoer  
       2017-11-28 11:57:41 +08:00
    这提示了我们不要把 vendor 目录暴漏到 web 目录下,你不知道哪些 vendor 得代码有坑
    YumeMichi
        10
    YumeMichi  
       2017-11-28 12:22:40 +08:00
    tp: 这口锅我们不背
    mcfog
        11
    mcfog  
       2017-11-28 12:27:29 +08:00
    f2f2f
        12
    f2f2f  
       2017-11-28 12:40:59 +08:00
    @Light3 而且主帖还被 upvote 了一个 23333
    yongjing
        13
    yongjing  
       2017-11-28 13:22:35 +08:00
    修改一下描述吧,免得一帮无脑黑 tp
    klgd
        14
    klgd  
       2017-11-28 13:29:02 +08:00
    楼主是不是就不知道 phpunit 是什么啊?
    `vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php`的全文
    ```php
    <?php
    /*
    * This file is part of PHPUnit.
    *
    * (c) Sebastian Bergmann <[email protected]>
    *
    * For the full copyright and license information, please view the LICENSE
    * file that was distributed with this source code.
    */
    eval('?>' . \file_get_contents('php://stdin'));

    ```
    SourceMan
        15
    SourceMan  
       2017-11-28 13:32:37 +08:00
    /vendor 目录下面都是依赖的第三方吧?
    YMB
        16
    YMB  
       2017-11-28 13:53:20 +08:00
    @SourceMan 对的,都是依赖
    RIcter
        17
    RIcter  
       2017-11-28 14:28:03 +08:00   ❤️ 2
    stdin 没问题,input 才有问题。这个是腾讯云 webshell 识别没训练好。
    vus520
        18
    vus520  
       2017-11-28 15:24:50 +08:00
    `file_get_contents('php://stdin')`

    命令行里获取管道输入的内容。
    都有服务器权限了还用后门搞毛线,能不能专业点。
    8355
        19
    8355  
       2017-11-28 16:06:25 +08:00
    露怯被喷现场
    Bridegroom777
        20
    Bridegroom777  
       2017-11-28 16:37:45 +08:00
    emmm,vendor 目录下面的不是扩展吗??
    Fedor
        21
    Fedor  
       2017-11-28 17:42:47 +08:00
    大型车祸现场
    muziyue
        22
    muziyue  
       2017-11-28 18:00:06 +08:00
    生产环境为什么要装 phpunit
    skyjerry
        23
    skyjerry  
       2017-11-28 18:19:07 +08:00 via iPhone
    场面一度十分尴尬
    Va1n3R
        24
    Va1n3R  
       2017-11-28 18:40:14 +08:00
    PHP 伪协议当中,php://input 这类才算有威胁吧。LZ 这个根本不是后门吧= =
    cevincheung
        25
    cevincheung  
       2017-11-28 19:19:29 +08:00
    @RIcter #17 目测都没带训练的,就是识别 eval
    ic3z
        26
    ic3z  
       2017-11-28 19:44:04 +08:00 via Android
    linoder
        27
    linoder  
       2017-11-28 19:46:39 +08:00
    为啥 vendor 可以被访问?
    orFish
        28
    orFish  
       2017-11-28 20:05:17 +08:00
    /public/index.php
    /vendor/...

    nginx/apache 指向 public/index.php 这是主流框架的安装方法吧。

    所以为什么会访问到 vendor
    orFish
        29
    orFish  
       2017-11-28 20:06:09 +08:00
    zjsxwc
        30
    zjsxwc  
       2017-11-28 22:48:47 +08:00 via Android
    stdin 只能在命令行终端输入啊,有这权限不是多此一举吗
    lepig
        31
    lepig  
       2017-11-29 09:08:07 +08:00
    关注一下
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3981 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 05:13 · PVG 13:13 · LAX 22:13 · JFK 01:13
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.