Mentor
Enumeration
Rustscan
mkdir rust; sudo rustscan -t 1500 -b 1500 --ulimit 65000 -a 10.129.84.190 -- -sV -sC -oA ./rust/{{ip}}Open 10.129.84.190:22
Open 10.129.84.190:80
PORT STATE SERVICE REASON VERSION
22/tcp open ssh syn-ack ttl 63 OpenSSH 8.9p1 Ubuntu 3 (Ubuntu Linux; protocol 2.0)
80/tcp open http syn-ack ttl 63 Apache httpd 2.4.52
|_http-title: Did not follow redirect to http://mentorquotes.htb/
| http-methods:
|_ Supported Methods: GET HEAD POST OPTIONS
|_http-server-header: Apache/2.4.52 (Ubuntu)
Service Info: Host: mentorquotes.htb; OS: Linux; CPE: cpe:/o:linux:linux_kernelSubdomains
ffuf -w /usr/share/seclists/Discovery/DNS/shubs-subdomains.txt -u http://mentorquotes.htb -H "Host: FUZZ.mentorquotes.htb" -o subs.json -mc all -fw 18api [Status: 404, Size: 22, Words: 2, Lines: 1, Duration: 98ms]Dirsearch
Foothold
Create a new user
If you check http://api.mentorquotes.htb/docs/ you'll see that the authors user name seems to be james and his mailaddress is [email protected] We will use james as username with a different address to get access to any admin endpoint.
Sign In
Our Access Token
Admin Endpoint
We discovered http://api.mentorquotes.htb/admin/backup using dirsearch before.
Missing body
Missing path
Finally
Command Injection
Poking around didn't show any results that are interesting. Assuming that this endpoints is being used to get or create backups we will check for Command Injections.
We got a callback to our http.server
Shell
Local Enum
Within the app directory we'll find a file called db.py which will indicate that a postgres db is running on IP 172.22.0.1.
Priv Esc
Postgres
We will setup chisel for portfowarding/tunneling and check the database
We will find two interesting password hashes within the mentorquotes db. One can be cracked!
53f22d0dfa10dce7e29cd31f4f953fd8 = 123meunomeeivani
SSH Access
We can use svc:123meunomeeivani to access the main server.
User: James
Since there was no obvious way for privilege escalation to root we started checking for basic things like passwords that has been set somewhere and could be accessed by anyone
Using the password SuperSecurePassword123__ we are able to become james
Root
Last updated