0x01 下载地址
下载地址
版本
友情提示
安装过程需要注意,会一直提示config.php文件不可写,需要修改文件名称
config.samlpe.php更改为config.php
安装成功

0x02 代码审计
为了方便的审计各个功能点,需要突破注册限制

仅仅用于测试学习
定位到验证请求注册码的函数 checkEmKey
将其返回值修改为 true

构造注册的数据包
POST /admin/register.php?action=register HTTP/1.1
Host: emlog.test
Content-Length: 9
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
Origin: http://emlog.test
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Referer: http://emlog.test/admin/register.php
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Cookie: PHPSESSID=ll7vttt0trnkrvs9788bc801ft; EM_AUTHCOOKIE_coTN2HYOMn8gLrUJC4wndk9ShCpcWQzC=admin%7C%7C7818bbe9400578f5b78aaf619f002497
Connection: close
emkey=123456

上传压缩包 getshell(emUnZip)
- 登录 emlog 后存在上传压缩包的功能,安装模板、安装插件

构造一个恶意压缩包

上传到路由 /admin/template.php?action=upload_zip

admin/template.php

http://emlog.test/content/templates/VideoTheme/phpinfo.php

更新压缩包,功能点位于
admin/upgrade.php

会从指定的 url 下载文件并进行解压操作
利用 phpstudy 中的 http 服务,并构造恶意压缩包文件


构造数据包

可以看到根目录下已经生成了 phpinfo.php

可以利用的就是这三个,但是同样有一个很有意思的地方
商店安装(不可利用)
admin/store.php

这是商店安装模板和插件的功能,就是从官网下载压缩包,然后再进行解压的操作,OFFICIAL_SERVICE_HOST = 'https://www.emlog.net/'
,但是压缩包必须是存在于官网上的,如果 url 最后没有 /
的话,就可以利用 url 解析不当来进行绕过 https://www.emlog.net@10.0.21.25/phpinfo.zip
0x03 但是
但是加了 /
之后是没有绕过的思路了