BoxBilling
BoxBilling is an open-source billing and client management application. In the observed path, an exposed .git directory leaked bb-config.php database credentials that also worked for the BoxBilling admin login, leading to authenticated file write RCE through CVE-2022-3552.
Discovery
WhatWeb against the hostname may show BoxBilling:
Apache[2.4.52], Cookies[PHPSESSID], HTML5, HttpOnly[PHPSESSID], JQuery, PasswordField[password], PoweredBy[BoxBilling], Title[Client Area]If browsing by IP redirects to a hostname, add it locally:
TARGET bullybox.localUseful paths:
http://bullybox.local/login
http://bullybox.local/login?®ister=1
http://bullybox.local/order
http://bullybox.local/bb-admin/staff/loginThe staff login page disclosed the version:
Powered by BoxBilling 4.22.1.5Nmap HTTP scripts may also reveal BoxBilling paths:
http-robots.txt:
/boxbilling/bb-data/ /bb-data/ /bb-library/
/bb-locale/ /bb-modules/ /bb-uploads/ /bb-vendor/ /install/
http-enum:
/bb-admin/index.php
/bb-admin/login.php
/robots.txt
/.git/HEAD
/api/Exposed Git Credentials
Dump the exposed repository and inspect bb-config.php:
Useful values:
The database password also worked for the BoxBilling admin login:
Authenticated File Write RCE
Searchsploit identified the authenticated RCE:
The vulnerable endpoint writes files through the admin Filemanager API:
Confirm authenticated access to the endpoint:
Useful successful response when the session is valid:
Write a PHP command shell:
Trigger command execution:
Successful execution context:
SSH Access as yuki
Outbound reverse shell callbacks were blocked, so use the webshell-to-SSH-key fallback to connect as yuki. See Shells.
Successful SSH command:
Successful shell context:
Last updated