Aerosol Posted January 6, 2015 Report Posted January 6, 2015 Hi,This is part 11 of the ManageOwnage series. For previous parts, see [1].This time we have two remote code execution via file upload (anddirectory traversal) on several ManageEngine products - Service DeskPlus, Asset Explorer, Support Center and IT360.The first vulnerability can only be exploited by an authenticateduser, but it can be a low privileged guest (which is a default accountpresent in almost all installations). This vulnerability can be abusedto drop an EAR file in the JBOSS directory which gets deployedautomatically, giving code execution as SYSTEM / root.The second vulnerability allows you to perform an unauthenticatedupload to anywhere in the file system with SYSTEM / root privileges.However only text files are handled correctly, as the servlet manglesbinary files.Given the prevalence of guest / low privileged / default accounts inthese products, the first vulnerability is by far the mostinteresting. I've released a Metasploit module which exploits it forall products. It should hopefully be integrated soon into Metasploit[2].The full text of the advisory is below, and a copy can be obtained inmy PoC repo [3].Regards,Pedro======================>> Remote code execution / file upload in ManageEngine ServiceDesk Plus, AssetExplorer, SupportCenter Plus and IT360>> Discovered by Pedro Ribeiro (pedrib@gmail.com), Agile Information Security==========================================================================Disclosure: 04/01/2015 / Last updated: 04/01/2015>> Background on the affected products:"ServiceDesk Plus is a help desk software with integrated asset andproject management built on the ITIL framework. It is available in 29different languages and is used by more than 85,000 companies, across186 countries, to manage their IT help desk and assets.""SupportCenter Plus is a web-based customer support software that letsorganizations effectively manage customer tickets, their account &contact information, the service contracts and in the processproviding a superior customer experience.""ManageEngine AssetExplorer is a web-based IT Asset Management (ITAM)software that helps you monitor and manage assets in your network fromPlanning phase to Disposal phase. AssetExplorer provides you with anumber of ways to ensure discovery of all the assets in your network.""Managing mission critical business applications is now made easythrough ManageEngine IT360. With agentless monitoring methodology,monitor your applications, servers and databases with ease. Agentlessmonitoring of your business applications enables you high ROI and lowTOC. With integrated network monitoring and bandwidth utilization,quickly troubleshoot any performance related issue with your networkand assign issues automatically with ITIL based ServiceDeskintegration.">> Technical details:#1Vulnerability: Remote code execution via file upload and directorytraversal (authenticated)CVE-2014-5301Constraints: user login needed, but exploitable with the default lowprivilege guest account (u:guest/p:guest)Affected versions (inclusive): ServiceDesk Plus / Plus MSP v5 to v9.0v9030; AssetExplorer v4 to v6.1; SupportCenter v5 to v7.9; IT360 v8 tov10.4POST /common/FileAttachment.jspPOST /workorder/Attachment.jsp (older versions < v7 build 7016;AssetExplorer v4; all SupportCenter versions)It is possible to abuse a directory traversal vulnerability whenuploading attachments. A Metasploit module that exploits thisvulnerability has been released.Post data has to be formatted as a multi-part request with an embeddedear file. Below is the form data for the newer versions:Content-Type: multipart/form-data;boundary=---------------------------9313517619947Content-Length: 1337-----------------------------9313517619947Content-Disposition: form-data; name="module"../../server/default/deploy-----------------------------9313517619947Content-Disposition: form-data; name="filePath"; filename="whatever.ear"Content-Type: application/octet-stream<...EAR file here...>-----------------------------9313517619947Content-Disposition: form-data; name="att_desc"-----------------------------9313517619947--#2Vulnerability: Remote code execution via file upload (unauthenticated)CVE-2014-5302Constraints: no authentication or any other information needed exceptfor IT360 (guest account needed); code execution is only possible byreplacing one of the <install_dir>bin/ scripts and waiting for them tobe executed or for a periodic task to run. This is because only textfiles can be uploaded as binary files are mangled; and there no JSPcompiler in the $PATH.Affected versions: ServiceDesk Plus / Plus MSP v7.6 to v9.0 build9026; AssetExplorer v? to v6.1 build 6106; IT360 v? to v10.4POST /discoveryServlet/WsDiscoveryServlet?computerName=../bin/run.bat%00POST /discoveryServlet/WsDiscoveryServlet?computerName=../bin/backUpData.bat%00<...text file / script payload here...>>> Fix:#1 is fixed on ServiceDesk Plus 9.0 build 9031. It is UNFIXED on allother products. Disclosure to ManageEngine was done on 04/08/2014, soover 150 days have elapsed. The last communication I received fromthem was that "Once we released this fix in ServiceDesk plus, weeventually take this in other products like AssetExplorer andSupportCenter."#2 is fixed on ServiceDesk Plus 9.0 build 9027 and on AssetExplorer6.1 build 6107. It is UNFIXED for IT360.======================[1]http://seclists.org/fulldisclosure/2014/Aug/55http://seclists.org/fulldisclosure/2014/Aug/75http://seclists.org/fulldisclosure/2014/Aug/88http://seclists.org/fulldisclosure/2014/Sep/1http://seclists.org/fulldisclosure/2014/Sep/110http://seclists.org/fulldisclosure/2014/Nov/12http://seclists.org/fulldisclosure/2014/Nov/18http://seclists.org/fulldisclosure/2014/Nov/21http://seclists.org/fulldisclosure/2014/Dec/9http://seclists.org/fulldisclosure/2015/Jan/2[2]https://github.com/rapid7/metasploit-framework/pull/4517[3]https://raw.githubusercontent.com/pedrib/PoC/master/ManageEngine/me_sd_file_upload.txtSource Quote