漏洞描述

漏洞详情

WebSVN是一个基于Web的Subversion Repository浏览器,可以查看文件或文件夹的日志,查看文件的变化列表等。其search.php?search= 参数下过滤不严谨导致RCE。

WebSVN官网地址:https://websvnphp.github.io/

漏洞源码:https://github.com/websvnphp/websvn/releases/tag/2.6.0

漏洞影响
WebSVN 2.6.1之前

漏洞分析

ubuntu上安装apache

apt-get update
apt-get install nginx
# 防火墙未开启

# 启动web服务器,查看状态,是否开启
systemctl status nginx

# 浏览器访问

要停止Web服务器,输入:

sudo systemctl stop nginx

要在停止时,启动Web服务器,键入:

sudo systemctl start nginx

要停止,然后再次启动该服务,键入:

sudo systemctl restart nginx

如果我们只是修改配置,Nginx 可以在不终端的情况下热加载。我们可以键入:

sudo systemctl reload nginx

默认情况下,Nginx 会在服务器启动时,跟随系统启动,如果我们不想这样,我们可以用这个命令来禁止:

sudo systemctl disable nginx

要重新让系统启动时引导 Nginx 启动,那么我们可以输入:

sudo systemctl enable nginx

访问nginx页面

apache与nginx是共用同一个站点目录的,即在apache和nginx中部署的网页文件都放在同一个目录下—/var/www/html.因此访问nginx的端口时本应该调用第三个文件作为欢迎页,却调用了apache的欢迎页文件.

修改nginx端口;w

vim /etc/nginx/sites-available/default
# 第一行白字部分可修改nginx的端口号
# 第二行白字用来设置nginx自己的站点目录
# 第三行白字是根据所排列的顺序调用站点目录里的网页文件作为自己的欢迎页(解决一开始的问题只需把index.nginx-debian.html放在index.html前就行了)

漏洞验证

环境安装

下载2.6.0的websvn到服务器

cd /usr/share/nginx/html
wget https://github.com/websvnphp/websvn/archive/refs/tags/2.6.0.zip
unzip 2.6.0.zip
cd websvn-2.6.0
cp include/distconfig.php include/config.php
vim include/config.php
$config->addRepository('FirServer', 'http://81.70.247.200/FirServer', null, 'root', 'root123');
$config->addRepositorySubpath('FirServer-Rose', 'http://81.70.247.200/FirServer', 'branches/branche_rose', null, 'root', 'root123');

参考文章

https://shenyu.me/2016/06/12/websvn.html

评论