Rapid7 Vulnerability & Exploit Database

HorizontCMS Arbitrary PHP File Upload

Back to Search

HorizontCMS Arbitrary PHP File Upload

Disclosed
09/24/2020
Created
11/13/2020

Description

This module exploits an arbitrary file upload vulnerability in HorizontCMS 1.0.0-beta in order to execute arbitrary commands. The module first attempts to authenticate to HorizontCMS. It then tries to upload a malicious PHP file via an HTTP POST request to `/admin/file-manager/fileupload`. The server will rename this file to a random string. The module will therefore attempt to change the filename back to the original name via an HTTP POST request to `/admin/file-manager/rename`. For the `php` target, the payload is embedded in the uploaded file and the module attempts to execute the payload via an HTTP GET request to `/storage/file_name`. For the `linux` and `windows` targets, the module uploads a simple PHP web shell similar to ``. Subsequently, it leverages the CmdStager mixin to deliver the final payload via a series of HTTP GET requests to the PHP web shell. Valid credentials for a HorizontCMS user with permissions to use the FileManager are required. This would be all users in the Admin, Manager and Editor groups if HorizontCMS is configured with the default group settings.This module has been successfully tested against HorizontCMS 1.0.0-beta running on Ubuntu 18.04.

Author(s)

  • Erik Wynter

Platform

Linux,PHP,Windows

Architectures

x86, x64, php

Development

Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':

msf > use exploit/multi/http/horizontcms_upload_exec
msf exploit(horizontcms_upload_exec) > show targets
    ...targets...
msf exploit(horizontcms_upload_exec) > set TARGET < target-id >
msf exploit(horizontcms_upload_exec) > show options
    ...show and set options...
msf exploit(horizontcms_upload_exec) > exploit

Time is precious, so I don’t want to do something manually that I can automate. Leveraging the Metasploit Framework when automating any task keeps us from having to re-create the wheel as we can use the existing libraries and focus our efforts where it matters.

– Jim O’Gorman | President, Offensive Security

;