Luke
Machine Level: Medium OS: FreeBSD
Scanning
I ran an aggressive NMAP scan to get a peak into the services on the machine.
ajread@aj-ubuntu:~/hackthebox/htb_writeups$ nmap -A [TARGET IP]
Starting Nmap 7.80 ( https://nmap.org ) at 2023-01-19 16:19 CST
Nmap scan report for [TARGET IP]
Host is up (0.079s latency).
Not shown: 995 closed ports
PORT STATE SERVICE VERSION
21/tcp open ftp vsftpd 3.0.3+ (ext.1)
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
|_drwxr-xr-x 2 0 0 512 Apr 14 2019 webapp
| ftp-syst:
| STAT:
| FTP server status:
| Connected to [LOCAL IP]
| Logged in as ftp
| TYPE: ASCII
| No session upload bandwidth limit
| No session download bandwidth limit
| Session timeout in seconds is 300
| Control connection is plain text
| Data connections will be plain text
| At session startup, client count was 1
| vsFTPd 3.0.3+ (ext.1) - secure, fast, stable
|_End of status
22/tcp open ssh?
|_ssh-hostkey: ERROR: Script execution failed (use -d to debug)
80/tcp open http Apache httpd 2.4.38 ((FreeBSD) PHP/7.3.3)
| http-methods:
|_ Potentially risky methods: TRACE
|_http-server-header: Apache/2.4.38 (FreeBSD) PHP/7.3.3
|_http-title: Luke
3000/tcp open http Node.js Express framework
|_http-title: Site doesn't have a title (application/json; charset=utf-8).
8000/tcp open http Ajenti http control panel
|_http-title: Ajenti
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 198.75 secondsEnumeration
I went after the FTP service and was able to log in anonymously. I found a txt file called for_Cihiro.txt.
The file contained information from anothe user named Derry.
I wanted to take a closer look at the service running on port 3000.
I looks like I need to supply a token in order to access. I was able to find something on port 80 within a config.php file after running gobuster.
I was able to send the credentials to port 3000 in the header and I was able to obtain a good token to use.
Initial Access
I sent the token back to the server and logged in as a user to the database.
I was able to grab the list of users from the database with the token as well.
I saw the various users and I wanted to see if I could get their passwords as well. I know that Derry seems to be and admin or management user from the note in the FTP server.
I was able to log into the http server running on port 80 at the /management subdirectory using Derry's credentials. I found a config.json file with what appeared to be the root user password.
I logged into the service running on port 8000 and found the user and root flags within /home/derry/user.txt and /root/root.txt. There was no need to elevate privileges to do so.
Last updated