Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2016-1542 PoC — BMC Software BladeLogic Server Automation Suite RSCD Agent 安全漏洞

Source
Associated Vulnerability
Title:BMC Software BladeLogic Server Automation Suite RSCD Agent 安全漏洞 (CVE-2016-1542)
Description:BMC BladeLogic Server Automation(BSA)是美国BMC Software公司的一套用于服务器自动化管理、控制和配置的解决方案。该方案支持所有操作系统以及虚拟化和云计算平台自动安装、配置操作系统等。 基于Linux和UNIX平台的BMC BSA的RSCD代理中的RPC API存在安全漏洞。远程攻击者可通过在身份验证失败后向xmlrpc发送action数据包利用该漏洞绕过身份验证,枚举用户。以下版本受到影响:BMC BSA 8.2.x版本,8.3.x版本,8.5.x版本,8.6
Description
A rebuilt version of the exploit for CVE-2016-1542 and CVE-2016-1543 from insinuator.net
Readme
# bladelogic_bmc-cve-2016-1542
A rebuilt version of the exploit for CVE-2016-1542 and CVE-2016-1543 from insinuator.net (https://insinuator.net/2016/03/bmc-bladelogic-cve-2016-1542-and-cve-2016-1543/)

I recently came across systems vulnerable to this CVE in a recent penetration test and found exploits from insinuator - however for unknown reasons (change in Python requests functionality in newer versions?) the exploit wasn't working properly.

XMLRPC communication with the RSCD agent is done by:
- Connecting to the agent on port 4750 and send "TLSRPC" in cleartext
- Set up an SSL session
- Send any subsequent data through the established SSL session

The insinuator PoC code tries to do this by setting up a socket that's SSL wrapped and then have `urllib3` use that but some functionality in that seems to have changed in later versions. Looking around I found [this stackoverflow post](http://stackoverflow.com/questions/40722024/using-pythons-requests-module-with-an-pre-existing-socket) with code that seems oddly familiar. :)

The answer there was to use a custom transport adapter. Actually doing this was surprisingly complex (to me at least) for just being able to send 7 characters of cleartext before establishing an SSL connection, so I thought I might as well share what I came up with. Hopefully it works for others as well.
File Snapshot

[4.0K] /data/pocs/01b0f5798bf6feea5cee3df911bd09d2a28d12d3 ├── [4.9K] getUsers.py ├── [1.3K] README.md └── [2.3K] RSCDAdapter.py 0 directories, 3 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. If the original source is unavailable, please email f.jinxu#gmail.com for a local snapshot (replace # with @).
    3. Shenlong has snapshotted the POC code for you. To support long-term maintenance, please consider donating. Thank you for your support.