原文始发于ssd-disclosure:SSD Advisory – Froxlor Server Management Panel File Upload Filter Bypass and RCE
SSD Advisory – Froxlor Server Management Panel File Upload Filter Bypass and RCE
TL;DR
A vulnerability in Froxlor allows remote attackers to bypass restrictions and execute arbitrary commands as root. Authentication as a customer is required to exploit this vulnerability.
The specific flaw exists within the uploading of files on the target server. The issue results from the possibility to upload Apache configuration files to the target server.
Vulnerability Summary
The Froxlor installation (when run with mod_php) contains a vulnerability that allows authenticated attackers to gain elevated (root) privileges.
CVE
TBD
Credit
An independent security researcher, Alex Birnberg of Zymo Security, has reported this to the SSD Secure Disclosure program.
Affected Versions
- Froxlor version 0.10.13
Vendor Response
“We’ve redone the whole installation process for the next major release (around summer this year) which preselects php-fpm and eases the configuration a lot. There’s also a note that mod_php usage is not recommended”
Vulnerability Analysis
Obtaining Code Execution as www-data
The Froxlor Server Management Panel offers users certain services for use within their environment. By default the IMAP, POP3, and PHP services are offered, however multiple other services are available such as Perl or FTP. Security aware administrators may disable the PHP or Perl engines in security-critical environments.
For each customer an FTP account is created for the purpose of file management in their environment. There are no restrictions in place on the type of files that can be uploaded.
The only restrictions that are placed on the customer environment are the ones declared in the Apache virtual host configuration however the AllowOverride
directive is not used.
Thus an attacker may upload via FTP an Apache configuration file named .htaccess
with the php_flag engine on
and bypass any restrictions set by the administrator.
Uploading a web shell and navigating to it’s location on the allocated customer subdomain will result in code execution as www-data
.
Elevating Privileges to root
By default, SQL credentials are stored in the `/var/www/froxlor/lib/userdata.inc.php` file.
The command that will be executed as root is stored in a file in the customer environment. This is done to bypass character restrictions later. By gaining control over the database, the system.crondreload
setting is updated to bash /path/to/commandfile
. Cron will then execute the command stored in the command file thus obtaining arbitrary code execution as root.
Exploit
The exploit script requires 4 arguments, the target URL, valid username and password of a customer account, and the command to be executed as root.
Code
转载请注明:SSD Advisory – Froxlor Server Management Panel File Upload Filter Bypass and RCE | CTF导航