Pit
Pit
Credentials
Plaintext
michelle
michelle
SeedDMS, dms-pit.htb/seeddms51x/seeddms
seeddms
ied^ieY6xoquu
/var/www/html/seeddms51x/conf/settings.xml
seeddms
seeddms
sqlite /home/www-data/seeddms51x/data/content.db
Hashes
admin
155dd275b4cb74bd1f80754b61148863
from seeddms sb
michelle
2345f10bb948c5665ef91f6773b3e455
same
jack
682d305fdaabc156430c4c6f6f5cc65d
same
Enumeration
nmap
TCP Scan
Here the ssl-cert field tells that domain name is dms-pit.htb
UDP Scan
Revealed that on port 161 service snmp is running
Port 9090

New hostname pit.htb. Fuzzing discovered the endpoint /ping that shows service name cockpit

Which appear to be https://github.com/cockpit-project/cockpit
Port 80

Looks just like nginx test website
Virtual host

dms-pit.htb is served on port 80 and 9090 but here returns 403 Forbidden
SNMP

With public community string dumping a lot information was possible including nsExtendObjects that leaked user michelle and SELinux Roles as well as system version CentOs Linux release 8.3.2011
Command returned interesting string /var/www/htmlseeddms51x/seeddms as this could indicate another web application running on the server.
SeedDMS
On port 80 SeedDMS was accessible on dms-pit.htb/seeddms51x/seeddms
SeedDMS
Login page

The obtained user michelle was using her name as a password that allowed to login to SeedDMS

Version
Upgrade note from administrator says that version was upgraded to 5.1.15
Users
Insider Docs/Users directory was listed one additional user Jack

Code Execution
User can add any file to the server and access it by going to the /seeddms51x/data/1048576/31/1.php url where data, 1048576 and 1.php are hardcoded values and 31 is DocumentID and this can be obtained from the URL


Exploit source: https://www.exploit-db.com/exploits/47022
Reverse Shell
Reverse shell was unsuccessful as returned permission denied

Enumeration
Inside /var/www/html/seeddms51x/conf/settings.xml password for sql database was found seeddms:ied^ieY6xoquu

As Admin note said the version was updated to 5.1.15 the version from the database says 5.1.0
Another database credential found this time to sqlite database

MySQL Database
With obtained credentials querying the database was possible

And dumping the users credentials

CentOs Cockpit
Service running on port 9090 allowed login as michelle with password ied^ieY6xoquu obtained from settings.xml

Privilege Escalation
The script /usr/bin/monitor is running when querying the snmp protocol

User michelle can write to the /usr/local/monitoring but can't read the directory content

PoC
User michelle can write to this directory

Writing public key to root authorized_keys

After running command snmpwalk -v2c -c public 10.10.10.241 1 or snmpwalk -v2c -c public 10.10.10.241 nsExtendObjects

Generated ssh key is added to /root/.ssh/authorized_keys and allowed to login via ssh


Last updated